2 # Copyright (C) 2014-2015 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
11 PKG_VERSION
:=2015-06-18
13 PKG_RELEASE
=$(PKG_SOURCE_VERSION
)
16 PKG_SOURCE_URL
:=git
://nbd.name
/luci2
/procd.git
17 PKG_SOURCE_SUBDIR
:=$(PKG_NAME
)-$(PKG_VERSION
)
18 PKG_SOURCE_VERSION
:=8559df08db51a2e5fe056e6a1c07984e51068eaf
19 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
)-$(PKG_SOURCE_VERSION
).
tar.gz
25 PKG_MAINTAINER
:=John Crispin
<blogic@openwrt.org
>
27 PKG_CONFIG_DEPENDS
:= CONFIG_KERNEL_SECCOMP CONFIG_NAND_SUPPORT CONFIG_PROCD_SHOW_BOOT CONFIG_PROCD_ZRAM_TMPFS CONFIG_PROCD_JAIL_SUPPORT
29 include $(INCLUDE_DIR
)/package.mk
30 include $(INCLUDE_DIR
)/cmake.mk
32 TARGET_LDFLAGS
+= $(if
$(CONFIG_USE_GLIBC
),-lrt
)
37 DEPENDS
:=+ubusd
+ubus
+libjson-script
+ubox
+USE_GLIBC
:librt
+libubox
+libubus
+NAND_SUPPORT
:procd-nand
38 TITLE
:=OpenWrt system process manager
41 define Package
/procd-jail
44 DEPENDS
:=procd
+@KERNEL_NAMESPACES
+@KERNEL_UTS_NS
+@KERNEL_IPC_NS
+@KERNEL_PID_NS @PROCD_JAIL_SUPPORT
45 TITLE
:=OpenWrt process jail
49 define Package
/procd-nand
52 DEPENDS
:=@NAND_SUPPORT
+ubi-utils
53 TITLE
:=OpenWrt sysupgrade nand helper
56 define Package
/procd-nand-firstboot
60 TITLE
:=OpenWrt firstboot nand helper
63 define Package
/procd
/config
65 depends on PACKAGE_procd
67 config PROCD_SHOW_BOOT
70 prompt
"Print the shutdown to the console as well as logging it to syslog"
72 config PROCD_ZRAM_TMPFS
75 prompt
"Mount /tmp using zram."
77 config PROCD_JAIL_SUPPORT
80 depends on
(arm || armeb || mips || mipsel || i386 || x86_64
) && PROCD_SECCOMP_SUPPORT
82 config PROCD_SECCOMP_SUPPORT
85 depends on
(arm || armeb || mips || mipsel || i386 || x86_64
) && !TARGET_uml
&& @KERNEL_SECCOMP
90 ifeq ($(CONFIG_NAND_SUPPORT
),y
)
91 CMAKE_OPTIONS
+= -DBUILD_UPGRADED
=1
94 ifeq ($(CONFIG_PROCD_SHOW_BOOT
),y
)
95 CMAKE_OPTIONS
+= -DSHOW_BOOT_ON_CONSOLE
=1
98 ifeq ($(CONFIG_PROCD_ZRAM_TMPFS
),y
)
99 CMAKE_OPTIONS
+= -DZRAM_TMPFS
=1
102 ifeq ($(CONFIG_PROCD_JAIL_SUPPORT
),y
)
103 CMAKE_OPTIONS
+= -DJAIL_SUPPORT
=1
106 ifeq ($(CONFIG_PROCD_SECCOMP_SUPPORT
),y
)
107 CMAKE_OPTIONS
+= -DSECCOMP_SUPPORT
=1
110 define Package
/procd
/install
111 $(INSTALL_DIR
) $(1)/sbin
$(1)/etc
$(1)/lib
/functions
113 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/{init
,procd
,askfirst
,udevtrigger
} $(1)/sbin
/
114 $(INSTALL_BIN
) .
/files
/reload_config
$(1)/sbin
/
115 $(INSTALL_DATA
) .
/files
/hotplug
*.json
$(1)/etc
/
116 $(INSTALL_DATA
) .
/files
/procd.sh
$(1)/lib
/functions
/
117 ifeq ($(CONFIG_PROCD_SECCOMP_SUPPORT
),y
)
118 $(INSTALL_DATA
) $(PKG_INSTALL_DIR
)/usr
/lib
/libpreload-seccomp.so
$(1)/lib
122 define Package
/procd-jail
/install
123 $(INSTALL_DIR
) $(1)/sbin
$(1)/lib
125 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/{utrace
,ujail
} $(1)/sbin
/
126 $(INSTALL_DATA
) $(PKG_INSTALL_DIR
)/usr
/lib
/libpreload-trace.so
$(1)/lib
129 define Package
/procd-nand
/install
130 $(INSTALL_DIR
) $(1)/sbin
$(1)/lib
/upgrade
132 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/upgraded
$(1)/sbin
/
133 $(INSTALL_DATA
) .
/files
/nand.sh
$(1)/lib
/upgrade
/
136 define Package
/procd-nand-firstboot
/install
137 $(INSTALL_DIR
) $(1)/lib
/preinit
139 $(INSTALL_DATA
) .
/files
/nand-preinit.sh
$(1)/lib
/preinit
/60-nand-firstboot.sh
142 $(eval
$(call BuildPackage
,procd
))
143 $(eval
$(call BuildPackage
,procd-jail
))
144 $(eval
$(call BuildPackage
,procd-nand
))
145 $(eval
$(call BuildPackage
,procd-nand-firstboot
))