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
11 PKG_RELEASE
:=$(AUTORELEASE
)
14 PKG_SOURCE_URL
=$(PROJECT_GIT
)/project
/procd.git
15 PKG_MIRROR_HASH
:=0e506062a992f77979bd59eb51fb5d500e45197cc7bfba3a9302415d754dbfd1
16 PKG_SOURCE_DATE
:=2022-01-11
17 PKG_SOURCE_VERSION
:=ac2b8b365bdbcbf292f77409d180ec3c0963faf3
23 PKG_MAINTAINER
:=John Crispin
<john@phrozen.org
>
25 PKG_ASLR_PIE_REGULAR
:=1
26 PKG_CONFIG_DEPENDS
:= \
27 CONFIG_TARGET_INIT_PATH CONFIG_KERNEL_SECCOMP \
28 CONFIG_PROCD_SHOW_BOOT CONFIG_PROCD_ZRAM_TMPFS \
29 CONFIG_KERNEL_NAMESPACES CONFIG_PACKAGE_procd-ujail CONFIG_PACKAGE_procd-seccomp
31 include $(INCLUDE_DIR
)/package.mk
32 include $(INCLUDE_DIR
)/cmake.mk
35 STAMP_CONFIGURED
:=$(strip $(STAMP_CONFIGURED
))_
$(shell echo
$(CONFIG_TARGET_INIT_PATH
) |
$(MKHASH
) md5
)
38 CMAKE_OPTIONS
+= -DEARLY_PATH
="$(TARGET_INIT_PATH)"
39 TARGET_LDFLAGS
+= $(if
$(CONFIG_USE_GLIBC
),-lrt
)
41 TARGET_CFLAGS
+= -flto
42 TARGET_LDFLAGS
+= -flto
44 define Package
/procd
/Default
47 DEPENDS
:=+ubusd
+ubus
+libjson-script
+ubox
+USE_GLIBC
:librt
+libubox \
48 +libubus
+libblobmsg-json
+libjson-c
+jshn
49 TITLE
:=OpenWrt system process manager
50 USERID
:=:dialout
=20 :audio
=29
54 $(call Package
/procd
/Default
)
56 CONFLICTS
:=procd-selinux
59 define Package
/procd-selinux
60 $(call Package
/procd
/Default
)
61 DEPENDS
+= +libselinux
62 TITLE
+= with SELinux support
67 define Package
/procd-ujail
70 DEPENDS
:=@KERNEL_NAMESPACES
+@KERNEL_UTS_NS
+@KERNEL_IPC_NS
+@KERNEL_PID_NS \
71 +libubox
+libubus
+libuci
+libblobmsg-json
72 TITLE
:=OpenWrt process jail helper
75 define Package
/procd-seccomp
78 DEPENDS
:=@SECCOMP
+libubox
+libblobmsg-json
79 TITLE
:=OpenWrt process seccomp helper
+ utrace
85 DEPENDS
:=+procd-ujail
+libubus
+libubox
+libblobmsg-json
+blockd
+PACKAGE_uxc
:rpcd
86 TITLE
:=OpenWrt container management
87 MAINTAINER
:=Daniel Golle
<daniel@makrotopia.org
>
90 define Package
/procd
/config
92 depends on PACKAGE_procd || PACKAGE_procd-selinux
94 config PROCD_SHOW_BOOT
97 prompt
"Print the shutdown to the console as well as logging it to syslog"
99 config PROCD_ZRAM_TMPFS
102 prompt
"Mount /tmp using zram."
106 ifeq ($(BUILD_VARIANT
),selinux
)
107 CMAKE_OPTIONS
+= -DSELINUX
=1
110 ifeq ($(CONFIG_PROCD_SHOW_BOOT
),y
)
111 CMAKE_OPTIONS
+= -DSHOW_BOOT_ON_CONSOLE
=1
114 ifeq ($(CONFIG_PROCD_ZRAM_TMPFS
),y
)
115 CMAKE_OPTIONS
+= -DZRAM_TMPFS
=1
118 ifdef CONFIG_PACKAGE_procd-ujail
119 CMAKE_OPTIONS
+= -DJAIL_SUPPORT
=1
122 SECCOMP
=$(if
$(CONFIG_PACKAGE_procd-seccomp
),1,0)
123 CMAKE_OPTIONS
+= -DSECCOMP_SUPPORT
=$(SECCOMP
) -DUTRACE_SUPPORT
=$(SECCOMP
)
125 define Package
/procd
/install
126 $(INSTALL_DIR
) $(1)/sbin
$(1)/etc
$(1)/lib
/functions
128 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/{init
,procd
,askfirst
,udevtrigger
,upgraded
} $(1)/sbin
/
129 $(INSTALL_DATA
) $(PKG_INSTALL_DIR
)/usr
/lib
/libsetlbf.so
$(1)/lib
130 $(INSTALL_BIN
) .
/files
/reload_config
$(1)/sbin
/
131 $(INSTALL_CONF
) .
/files
/hotplug
*.json
$(1)/etc
/
132 $(INSTALL_DATA
) .
/files
/procd.sh
$(1)/lib
/functions
/
135 Package
/procd-selinux
/install = $(Package
/procd
/install)
137 define Package
/procd-ujail
/install
138 $(INSTALL_DIR
) $(1)/sbin
139 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/ujail
$(1)/sbin
/
142 define Package
/procd-seccomp
/install
143 $(INSTALL_DIR
) $(1)/sbin
$(1)/lib
144 $(INSTALL_DATA
) $(PKG_INSTALL_DIR
)/usr
/lib
/libpreload-seccomp.so
$(1)/lib
145 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/utrace
$(1)/sbin
/
146 $(LN
) utrace
$(1)/sbin
/seccomp-trace
147 $(INSTALL_DATA
) $(PKG_INSTALL_DIR
)/usr
/lib
/libpreload-trace.so
$(1)/lib
150 define Package
/uxc
/conffiles
154 define Package
/uxc
/install
155 $(INSTALL_DIR
) $(1)/sbin
156 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/uxc
$(1)/sbin
/
157 $(INSTALL_DIR
) $(1)/etc
/init.d
158 $(INSTALL_BIN
) .
/files
/uxc.init
$(1)/etc
/init.d
/uxc
161 $(eval
$(call BuildPackage
,procd
))
162 $(eval
$(call BuildPackage
,procd-selinux
))
163 $(eval
$(call BuildPackage
,procd-ujail
))
164 $(eval
$(call BuildPackage
,procd-seccomp
))
165 $(eval
$(call BuildPackage
,uxc
))