2 # Copyright (C) 2014 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:=2014-12-02
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:=40c4e68266a7b04239394c528c4c290d960fc38c
19 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
25 PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
27 include $(INCLUDE_DIR)/package.mk
28 include $(INCLUDE_DIR)/cmake.mk
30 TARGET_LDFLAGS += $(if $(CONFIG_USE_EGLIBC),-lrt)
35 DEPENDS:=+ubusd +ubus +libjson-script +ubox +USE_EGLIBC:librt +libubox +libubus +NAND_SUPPORT:procd-nand
36 TITLE:=OpenWrt system process manager
39 define Package/procd-nand
42 DEPENDS:=@NAND_SUPPORT +ubi-utils
43 TITLE:=OpenWrt sysupgrade nand helper
46 define Package/procd-nand-firstboot
50 TITLE:=OpenWrt firstboot nand helper
53 define Package/procd/config
55 depends on PACKAGE_procd
57 config PROCD_SHOW_BOOT
60 prompt "Print the shutdown to the console as well as logging it to syslog"
62 config PROCD_ZRAM_TMPFS
65 prompt "Mount /tmp using zram."
69 PKG_CONFIG_DEPENDS:= PROCD_SHOW_BOOT PROCD_ZRAM_TMPFS
71 ifeq ($(CONFIG_PROCD_SHOW_BOOT),y)
72 CMAKE_OPTIONS += -DSHOW_BOOT_ON_CONSOLE=1
75 ifeq ($(CONFIG_PROCD_ZRAM_TMPFS),y)
76 CMAKE_OPTIONS += -DZRAM_TMPFS=1
79 define Package/procd/install
80 $(INSTALL_DIR) $(1)/sbin $(1)/etc $(1)/lib/functions
82 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/{init,procd,askfirst,udevtrigger} $(1)/sbin/
83 $(INSTALL_BIN) ./files/reload_config $(1)/sbin/
84 $(INSTALL_DATA) ./files/hotplug*.json $(1)/etc/
85 $(INSTALL_DATA) ./files/procd.sh $(1)/lib/functions/
88 define Package/procd-nand/install
89 $(INSTALL_DIR) $(1)/sbin $(1)/lib/upgrade
91 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/upgraded $(1)/sbin/
92 $(INSTALL_DATA) ./files/nand.sh $(1)/lib/upgrade/
95 define Package/procd-nand-firstboot/install
96 $(INSTALL_DIR) $(1)/lib/preinit
98 $(INSTALL_DATA) ./files/nand-preinit.sh $(1)/lib/preinit/60-nand-firstboot.sh
101 $(eval $(call BuildPackage,procd))
102 $(eval $(call BuildPackage,procd-nand))
103 $(eval $(call BuildPackage,procd-nand-firstboot))