2 # Copyright (C) 2014-2016 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
14 PKG_SOURCE_URL
=$(LEDE_GIT
)/project
/procd.git
15 PKG_SOURCE_DATE
:=2018-01-22
16 PKG_SOURCE_VERSION
:=9a4036fb1b7412ab2ea4f360d2cc7e6a5e0fa6b5
17 PKG_MIRROR_HASH
:=669f062e9c5228ef9d09cc9904d8ce4651f0b8506a6c2fff27b21e83b26f0abb
23 PKG_MAINTAINER
:=John Crispin
<john@phrozen.org
>
27 PKG_CONFIG_DEPENDS
:= \
28 CONFIG_TARGET_INIT_PATH CONFIG_KERNEL_SECCOMP \
29 CONFIG_NAND_SUPPORT CONFIG_PROCD_SHOW_BOOT CONFIG_PROCD_ZRAM_TMPFS \
30 CONFIG_KERNEL_NAMESPACES CONFIG_PACKAGE_procd-ujail CONFIG_PACKAGE_procd-seccomp
32 include $(INCLUDE_DIR
)/package.mk
33 include $(INCLUDE_DIR
)/cmake.mk
36 STAMP_CONFIGURED
:=$(strip $(STAMP_CONFIGURED
))_
$(shell echo
$(CONFIG_TARGET_INIT_PATH
) | mkhash md5
)
39 CMAKE_OPTIONS
+= -DEARLY_PATH
="$(TARGET_INIT_PATH)"
40 TARGET_LDFLAGS
+= $(if
$(CONFIG_USE_GLIBC
),-lrt
)
45 DEPENDS
:=+ubusd
+ubus
+libjson-script
+ubox
+USE_GLIBC
:librt
+libubox
+libubus
+NAND_SUPPORT
:procd-nand
46 TITLE
:=OpenWrt system process manager
49 define Package
/procd-ujail
52 DEPENDS
:=@KERNEL_NAMESPACES
+@KERNEL_UTS_NS
+@KERNEL_IPC_NS
+@KERNEL_PID_NS
+libubox
+libblobmsg-json
53 TITLE
:=OpenWrt process jail helper
56 define Package
/procd-seccomp
59 DEPENDS
:=@arm||@armeb||@mips||@mipsel||@i386||@x86_64 @
!TARGET_uml @KERNEL_SECCOMP
+libubox
+libblobmsg-json
60 TITLE
:=OpenWrt process seccomp helper
+ utrace
63 define Package
/procd-nand
66 DEPENDS
:=@NAND_SUPPORT
+ubi-utils
67 TITLE
:=OpenWrt sysupgrade nand helper
70 define Package
/procd-nand-firstboot
74 TITLE
:=OpenWrt firstboot nand helper
77 define Package
/procd
/config
79 depends on PACKAGE_procd
81 config PROCD_SHOW_BOOT
84 prompt
"Print the shutdown to the console as well as logging it to syslog"
86 config PROCD_ZRAM_TMPFS
89 prompt
"Mount /tmp using zram."
94 ifeq ($(CONFIG_NAND_SUPPORT
),y
)
95 CMAKE_OPTIONS
+= -DBUILD_UPGRADED
=1
98 ifeq ($(CONFIG_PROCD_SHOW_BOOT
),y
)
99 CMAKE_OPTIONS
+= -DSHOW_BOOT_ON_CONSOLE
=1
102 ifeq ($(CONFIG_PROCD_ZRAM_TMPFS
),y
)
103 CMAKE_OPTIONS
+= -DZRAM_TMPFS
=1
106 ifdef CONFIG_PACKAGE_procd-ujail
107 CMAKE_OPTIONS
+= -DJAIL_SUPPORT
=1
110 SECCOMP
=$(if
$(CONFIG_PACKAGE_procd-seccomp
),1,0)
111 CMAKE_OPTIONS
+= -DSECCOMP_SUPPORT
=$(SECCOMP
) -DUTRACE_SUPPORT
=$(SECCOMP
)
113 define Package
/procd
/install
114 $(INSTALL_DIR
) $(1)/sbin
$(1)/etc
$(1)/lib
/functions
116 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/{init
,procd
,askfirst
,udevtrigger
} $(1)/sbin
/
117 $(INSTALL_DATA
) $(PKG_INSTALL_DIR
)/usr
/lib
/libsetlbf.so
$(1)/lib
118 $(INSTALL_BIN
) .
/files
/reload_config
$(1)/sbin
/
119 $(INSTALL_DATA
) .
/files
/hotplug
*.json
$(1)/etc
/
120 $(INSTALL_DATA
) .
/files
/procd.sh
$(1)/lib
/functions
/
123 define Package
/procd-ujail
/install
124 $(INSTALL_DIR
) $(1)/sbin
125 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/ujail
$(1)/sbin
/
128 define Package
/procd-seccomp
/install
129 $(INSTALL_DIR
) $(1)/sbin
$(1)/lib
130 $(INSTALL_DATA
) $(PKG_INSTALL_DIR
)/usr
/lib
/libpreload-seccomp.so
$(1)/lib
131 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/utrace
$(1)/sbin
/
132 ln
-s utrace
$(1)/sbin
/seccomp-trace
133 $(INSTALL_DATA
) $(PKG_INSTALL_DIR
)/usr
/lib
/libpreload-trace.so
$(1)/lib
136 define Package
/procd-nand
/install
137 $(INSTALL_DIR
) $(1)/sbin
$(1)/lib
/upgrade
139 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/upgraded
$(1)/sbin
/
140 $(INSTALL_DATA
) .
/files
/nand.sh
$(1)/lib
/upgrade
/
143 define Package
/procd-nand-firstboot
/install
144 $(INSTALL_DIR
) $(1)/lib
/preinit
146 $(INSTALL_DATA
) .
/files
/nand-preinit.sh
$(1)/lib
/preinit
/60-nand-firstboot.sh
149 $(eval
$(call BuildPackage
,procd
))
150 $(eval
$(call BuildPackage
,procd-ujail
))
151 $(eval
$(call BuildPackage
,procd-seccomp
))
152 $(eval
$(call BuildPackage
,procd-nand
))
153 $(eval
$(call BuildPackage
,procd-nand-firstboot
))