2 # Copyright (C) 2014-2015 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_VERSION:=2015-03-25
13 PKG_RELEASE=$(PKG_SOURCE_VERSION)
16 PKG_SOURCE_URL:=git://nbd.name/luci2/procd.git
17 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
18 PKG_SOURCE_VERSION:=29f139217c71c8753643779c800788783bf43c23
19 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
25 PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
27 PKG_CONFIG_DEPENDS:=CONFIG_KERNEL_SECCOMP
29 include $(INCLUDE_DIR)/package.mk
30 include $(INCLUDE_DIR)/cmake.mk
32 TARGET_LDFLAGS += $(if $(CONFIG_USE_GLIBC),-lrt)
37 DEPENDS:=+ubusd +ubus +libjson-script +ubox +USE_GLIBC:librt +libubox +libubus +NAND_SUPPORT:procd-nand
38 TITLE:=OpenWrt system process manager
41 define Package/procd-jail
44 DEPENDS:=procd +@KERNEL_NAMESPACES +@KERNEL_UTS_NS +@KERNEL_IPC_NS +@KERNEL_PID_NS @mips||mipsel||i386||x86_64
45 TITLE:=OpenWrt process jail
49 define Package/procd-nand
52 DEPENDS:=@NAND_SUPPORT +ubi-utils
53 TITLE:=OpenWrt sysupgrade nand helper
56 define Package/procd-nand-firstboot
60 TITLE:=OpenWrt firstboot nand helper
63 define Package/procd/config
65 depends on PACKAGE_procd
67 config PROCD_SHOW_BOOT
70 prompt "Print the shutdown to the console as well as logging it to syslog"
72 config PROCD_ZRAM_TMPFS
75 prompt "Mount /tmp using zram."
79 PKG_CONFIG_DEPENDS:= CONFIG_NAND_SUPPORT CONFIG_PROCD_SHOW_BOOT CONFIG_PROCD_ZRAM_TMPFS
81 ifeq ($(CONFIG_NAND_SUPPORT),y)
82 CMAKE_OPTIONS += -DBUILD_UPGRADED=1
85 ifeq ($(CONFIG_PROCD_SHOW_BOOT),y)
86 CMAKE_OPTIONS += -DSHOW_BOOT_ON_CONSOLE=1
89 ifeq ($(CONFIG_PROCD_ZRAM_TMPFS),y)
90 CMAKE_OPTIONS += -DZRAM_TMPFS=1
93 define Package/procd/install
94 $(INSTALL_DIR) $(1)/sbin $(1)/etc $(1)/lib/functions
96 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{init,procd,askfirst,udevtrigger} $(1)/sbin/
97 $(INSTALL_BIN) ./files/reload_config $(1)/sbin/
98 $(INSTALL_DATA) ./files/hotplug*.json $(1)/etc/
99 $(INSTALL_DATA) ./files/procd.sh $(1)/lib/functions/
100 ifeq ($(CONFIG_KERNEL_SECCOMP),y)
101 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libpreload-seccomp.so $(1)/lib
105 define Package/procd-jail/install
106 $(INSTALL_DIR) $(1)/sbin $(1)/lib
108 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{utrace,ujail} $(1)/sbin/
109 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libpreload-trace.so $(1)/lib
112 define Package/procd-nand/install
113 $(INSTALL_DIR) $(1)/sbin $(1)/lib/upgrade
115 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/upgraded $(1)/sbin/
116 $(INSTALL_DATA) ./files/nand.sh $(1)/lib/upgrade/
119 define Package/procd-nand-firstboot/install
120 $(INSTALL_DIR) $(1)/lib/preinit
122 $(INSTALL_DATA) ./files/nand-preinit.sh $(1)/lib/preinit/60-nand-firstboot.sh
125 $(eval $(call BuildPackage,procd))
126 $(eval $(call BuildPackage,procd-jail))
127 $(eval $(call BuildPackage,procd-nand))
128 $(eval $(call BuildPackage,procd-nand-firstboot))