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
=$(PROJECT_GIT
)/project
/procd.git
15 PKG_MIRROR_HASH
:=75a92c01ef85f41dc7e0b77ac35f464fbe45942af02ca6847516c4ebf574c4a4
16 PKG_SOURCE_DATE
:=2023-01-16
17 PKG_SOURCE_VERSION
:=190f13a75e67e0bdb662188da79b8be31e0aae01
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 CONFIG_PROCD_SHOW_BOOT \
28 CONFIG_KERNEL_NAMESPACES CONFIG_PACKAGE_procd-ujail CONFIG_PACKAGE_procd-seccomp
30 include $(INCLUDE_DIR
)/package.mk
31 include $(INCLUDE_DIR
)/cmake.mk
34 STAMP_CONFIGURED
:=$(strip $(STAMP_CONFIGURED
))_
$(shell echo
$(CONFIG_TARGET_INIT_PATH
) |
$(MKHASH
) md5
)
37 CMAKE_OPTIONS
+= -DEARLY_PATH
="$(TARGET_INIT_PATH)"
39 TARGET_CFLAGS
+= -flto
40 TARGET_LDFLAGS
+= -flto
42 define Package
/procd
/Default
45 DEPENDS
:=+ubusd
+ubus
+libjson-script
+ubox
+libubox \
46 +libubus
+libblobmsg-json
+libjson-c
+jshn
47 TITLE
:=OpenWrt system process manager
48 USERID
:=:dialout
=20 :audio
=29
52 $(call Package
/procd
/Default
)
54 CONFLICTS
:=procd-selinux
57 define Package
/procd-selinux
58 $(call Package
/procd
/Default
)
59 DEPENDS
+= +libselinux
60 TITLE
+= with SELinux support
65 define Package
/procd-ujail
68 DEPENDS
:=@KERNEL_NAMESPACES
+@KERNEL_UTS_NS
+@KERNEL_IPC_NS
+@KERNEL_PID_NS \
69 +libubox
+libubus
+libuci
+libblobmsg-json
70 TITLE
:=OpenWrt process jail helper
73 define Package
/procd-seccomp
76 DEPENDS
:=@SECCOMP
+libubox
+libblobmsg-json
77 TITLE
:=OpenWrt process seccomp helper
+ utrace
83 DEPENDS
:=+procd-ujail
+libubus
+libubox
+libblobmsg-json
+blockd
+PACKAGE_uxc
:rpcd
84 TITLE
:=OpenWrt container management
85 MAINTAINER
:=Daniel Golle
<daniel@makrotopia.org
>
88 define Package
/procd
/config
90 depends on PACKAGE_procd || PACKAGE_procd-selinux
92 config PROCD_SHOW_BOOT
95 prompt
"Print the shutdown to the console as well as logging it to syslog"
100 ifeq ($(BUILD_VARIANT
),selinux
)
101 CMAKE_OPTIONS
+= -DSELINUX
=1
104 ifeq ($(CONFIG_PROCD_SHOW_BOOT
),y
)
105 CMAKE_OPTIONS
+= -DSHOW_BOOT_ON_CONSOLE
=1
108 ifdef CONFIG_PACKAGE_procd-ujail
109 CMAKE_OPTIONS
+= -DJAIL_SUPPORT
=1
112 SECCOMP
=$(if
$(CONFIG_PACKAGE_procd-seccomp
),1,0)
113 CMAKE_OPTIONS
+= -DSECCOMP_SUPPORT
=$(SECCOMP
) -DUTRACE_SUPPORT
=$(SECCOMP
)
115 define Package
/procd
/install
116 $(INSTALL_DIR
) $(1)/sbin
$(1)/etc
$(1)/lib
/functions
118 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/{init
,procd
,askfirst
,udevtrigger
,upgraded
} $(1)/sbin
/
119 $(INSTALL_DATA
) $(PKG_INSTALL_DIR
)/usr
/lib
/libsetlbf.so
$(1)/lib
120 $(INSTALL_BIN
) .
/files
/reload_config
$(1)/sbin
/
121 $(INSTALL_CONF
) .
/files
/hotplug
*.json
$(1)/etc
/
122 $(INSTALL_DATA
) .
/files
/procd.sh
$(1)/lib
/functions
/
123 $(INSTALL_BIN
) .
/files
/service
$(1)/sbin
/service
126 Package
/procd-selinux
/install = $(Package
/procd
/install)
128 define Package
/procd-ujail
/install
129 $(INSTALL_DIR
) $(1)/sbin
130 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/ujail
$(1)/sbin
/
133 define Package
/procd-seccomp
/install
134 $(INSTALL_DIR
) $(1)/sbin
$(1)/lib
135 $(INSTALL_DATA
) $(PKG_INSTALL_DIR
)/usr
/lib
/libpreload-seccomp.so
$(1)/lib
136 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/utrace
$(1)/sbin
/
137 $(LN
) utrace
$(1)/sbin
/seccomp-trace
138 $(INSTALL_DATA
) $(PKG_INSTALL_DIR
)/usr
/lib
/libpreload-trace.so
$(1)/lib
141 define Package
/uxc
/conffiles
145 define Package
/uxc
/install
146 $(INSTALL_DIR
) $(1)/sbin
147 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/uxc
$(1)/sbin
/
148 $(INSTALL_DIR
) $(1)/etc
/init.d
149 $(INSTALL_BIN
) .
/files
/uxc.init
$(1)/etc
/init.d
/uxc
152 $(eval
$(call BuildPackage
,procd
))
153 $(eval
$(call BuildPackage
,procd-selinux
))
154 $(eval
$(call BuildPackage
,procd-ujail
))
155 $(eval
$(call BuildPackage
,procd-seccomp
))
156 $(eval
$(call BuildPackage
,uxc
))