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_SOURCE_DATE
:=2020-05-28
16 PKG_SOURCE_VERSION
:=b9b39e2061d7035a9d84eecbb4a4613deaf6d03f
17 PKG_MIRROR_HASH
:=0d6a96a2fb38f72c72b457a2a8638bee22f91009f9686152fcf4aee97846fc84
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
47 DEPENDS
:=+ubusd
+ubus
+libjson-script
+ubox
+USE_GLIBC
:librt
+libubox
+libubus
+libblobmsg-json
+libjson-c
48 TITLE
:=OpenWrt system process manager
49 USERID
:=:dialout
=20 :audio
=29
52 define Package
/procd-ujail
55 DEPENDS
:=@KERNEL_NAMESPACES
+@KERNEL_UTS_NS
+@KERNEL_IPC_NS
+@KERNEL_PID_NS
+libubox
+libubus
+libblobmsg-json
56 TITLE
:=OpenWrt process jail helper
59 define Package
/procd-ujail-console
62 DEPENDS
:=+procd-ujail
+libubus
+libubox
63 TITLE
:=OpenWrt process jail console
66 define Package
/procd-seccomp
69 DEPENDS
:=@
(arm||armeb||mips||mipsel||i386||powerpc||x86_64
) @
!TARGET_uml @KERNEL_SECCOMP
+libubox
+libblobmsg-json
70 TITLE
:=OpenWrt process seccomp helper
+ utrace
73 define Package
/procd
/config
75 depends on PACKAGE_procd
77 config PROCD_SHOW_BOOT
80 prompt
"Print the shutdown to the console as well as logging it to syslog"
82 config PROCD_ZRAM_TMPFS
85 prompt
"Mount /tmp using zram."
90 ifeq ($(CONFIG_PROCD_SHOW_BOOT
),y
)
91 CMAKE_OPTIONS
+= -DSHOW_BOOT_ON_CONSOLE
=1
94 ifeq ($(CONFIG_PROCD_ZRAM_TMPFS
),y
)
95 CMAKE_OPTIONS
+= -DZRAM_TMPFS
=1
98 ifdef CONFIG_PACKAGE_procd-ujail
99 CMAKE_OPTIONS
+= -DJAIL_SUPPORT
=1
102 SECCOMP
=$(if
$(CONFIG_PACKAGE_procd-seccomp
),1,0)
103 CMAKE_OPTIONS
+= -DSECCOMP_SUPPORT
=$(SECCOMP
) -DUTRACE_SUPPORT
=$(SECCOMP
)
105 define Package
/procd
/install
106 $(INSTALL_DIR
) $(1)/sbin
$(1)/etc
$(1)/lib
/functions
108 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/{init
,procd
,askfirst
,udevtrigger
,upgraded
} $(1)/sbin
/
109 $(INSTALL_DATA
) $(PKG_INSTALL_DIR
)/usr
/lib
/libsetlbf.so
$(1)/lib
110 $(INSTALL_BIN
) .
/files
/reload_config
$(1)/sbin
/
111 $(INSTALL_CONF
) .
/files
/hotplug
*.json
$(1)/etc
/
112 $(INSTALL_DATA
) .
/files
/procd.sh
$(1)/lib
/functions
/
115 define Package
/procd-ujail
/install
116 $(INSTALL_DIR
) $(1)/sbin
117 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/ujail
$(1)/sbin
/
120 define Package
/procd-ujail-console
/install
121 $(INSTALL_DIR
) $(1)/sbin
122 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/ujail-console
$(1)/sbin
/
125 define Package
/procd-seccomp
/install
126 $(INSTALL_DIR
) $(1)/sbin
$(1)/lib
127 $(INSTALL_DATA
) $(PKG_INSTALL_DIR
)/usr
/lib
/libpreload-seccomp.so
$(1)/lib
128 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/utrace
$(1)/sbin
/
129 $(LN
) utrace
$(1)/sbin
/seccomp-trace
130 $(INSTALL_DATA
) $(PKG_INSTALL_DIR
)/usr
/lib
/libpreload-trace.so
$(1)/lib
133 $(eval
$(call BuildPackage
,procd
))
134 $(eval
$(call BuildPackage
,procd-ujail
))
135 $(eval
$(call BuildPackage
,procd-ujail-console
))
136 $(eval
$(call BuildPackage
,procd-seccomp
))