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:=2018-11-23
16 PKG_SOURCE_VERSION:=d6673547adc3768ce674799fa35952351866c9d0
17 PKG_MIRROR_HASH:=ee11e1f652e9268e21dfd7835d26993c682ed33f6ba474c283cb9ef04f71e626
23 PKG_MAINTAINER:=John Crispin <john@phrozen.org>
25 PKG_CONFIG_DEPENDS:= \
26 CONFIG_TARGET_INIT_PATH CONFIG_KERNEL_SECCOMP \
27 CONFIG_PROCD_SHOW_BOOT CONFIG_PROCD_ZRAM_TMPFS \
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)"
38 TARGET_LDFLAGS += $(if $(CONFIG_USE_GLIBC),-lrt)
40 TARGET_CFLAGS += -flto
41 TARGET_LDFLAGS += -flto
46 DEPENDS:=+ubusd +ubus +libjson-script +ubox +USE_GLIBC:librt +libubox +libubus
47 TITLE:=OpenWrt system process manager
50 define Package/procd-ujail
53 DEPENDS:=@KERNEL_NAMESPACES +@KERNEL_UTS_NS +@KERNEL_IPC_NS +@KERNEL_PID_NS +libubox +libblobmsg-json
54 TITLE:=OpenWrt process jail helper
57 define Package/procd-seccomp
60 DEPENDS:=@arm||@armeb||@mips||@mipsel||@i386||@x86_64 @!TARGET_uml @KERNEL_SECCOMP +libubox +libblobmsg-json
61 TITLE:=OpenWrt process seccomp helper + utrace
64 define Package/procd/config
66 depends on PACKAGE_procd
68 config PROCD_SHOW_BOOT
71 prompt "Print the shutdown to the console as well as logging it to syslog"
73 config PROCD_ZRAM_TMPFS
76 prompt "Mount /tmp using zram."
81 ifeq ($(CONFIG_PROCD_SHOW_BOOT),y)
82 CMAKE_OPTIONS += -DSHOW_BOOT_ON_CONSOLE=1
85 ifeq ($(CONFIG_PROCD_ZRAM_TMPFS),y)
86 CMAKE_OPTIONS += -DZRAM_TMPFS=1
89 ifdef CONFIG_PACKAGE_procd-ujail
90 CMAKE_OPTIONS += -DJAIL_SUPPORT=1
93 SECCOMP=$(if $(CONFIG_PACKAGE_procd-seccomp),1,0)
94 CMAKE_OPTIONS += -DSECCOMP_SUPPORT=$(SECCOMP) -DUTRACE_SUPPORT=$(SECCOMP)
96 define Package/procd/install
97 $(INSTALL_DIR) $(1)/sbin $(1)/etc $(1)/lib/functions
99 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{init,procd,askfirst,udevtrigger,upgraded} $(1)/sbin/
100 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libsetlbf.so $(1)/lib
101 $(INSTALL_BIN) ./files/reload_config $(1)/sbin/
102 $(INSTALL_CONF) ./files/hotplug*.json $(1)/etc/
103 $(INSTALL_DATA) ./files/procd.sh $(1)/lib/functions/
106 define Package/procd-ujail/install
107 $(INSTALL_DIR) $(1)/sbin
108 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ujail $(1)/sbin/
111 define Package/procd-seccomp/install
112 $(INSTALL_DIR) $(1)/sbin $(1)/lib
113 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libpreload-seccomp.so $(1)/lib
114 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/utrace $(1)/sbin/
115 $(LN) utrace $(1)/sbin/seccomp-trace
116 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libpreload-trace.so $(1)/lib
119 $(eval $(call BuildPackage,procd))
120 $(eval $(call BuildPackage,procd-ujail))
121 $(eval $(call BuildPackage,procd-seccomp))