Makefile 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. #
  2. # Copyright (C) 2014 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=procd
  9. PKG_VERSION:=2014-12-02
  10. PKG_RELEASE=$(PKG_SOURCE_VERSION)
  11. PKG_SOURCE_PROTO:=git
  12. PKG_SOURCE_URL:=git://nbd.name/luci2/procd.git
  13. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  14. PKG_SOURCE_VERSION:=40c4e68266a7b04239394c528c4c290d960fc38c
  15. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
  16. CMAKE_INSTALL:=1
  17. PKG_LICENSE:=GPL-2.0
  18. PKG_LICENSE_FILES:=
  19. PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
  20. include $(INCLUDE_DIR)/package.mk
  21. include $(INCLUDE_DIR)/cmake.mk
  22. TARGET_LDFLAGS += $(if $(CONFIG_USE_EGLIBC),-lrt)
  23. define Package/procd
  24. SECTION:=base
  25. CATEGORY:=Base system
  26. DEPENDS:=+ubusd +ubus +libjson-script +ubox +USE_EGLIBC:librt +libubox +libubus +NAND_SUPPORT:procd-nand
  27. TITLE:=libreCMC system process manager
  28. endef
  29. define Package/procd-nand
  30. SECTION:=utils
  31. CATEGORY:=Utilities
  32. DEPENDS:=@NAND_SUPPORT +ubi-utils
  33. TITLE:=libreCMC sysupgrade nand helper
  34. endef
  35. define Package/procd-nand-firstboot
  36. SECTION:=utils
  37. CATEGORY:=Utilities
  38. DEPENDS:=procd-nand
  39. TITLE:=libreCMC firstboot nand helper
  40. endef
  41. define Package/procd/config
  42. menu "Configuration"
  43. depends on PACKAGE_procd
  44. config PROCD_SHOW_BOOT
  45. bool
  46. default n
  47. prompt "Print the shutdown to the console as well as logging it to syslog"
  48. config PROCD_ZRAM_TMPFS
  49. bool
  50. default n
  51. prompt "Mount /tmp using zram."
  52. endmenu
  53. endef
  54. PKG_CONFIG_DEPENDS:= PROCD_SHOW_BOOT PROCD_ZRAM_TMPFS
  55. ifeq ($(CONFIG_PROCD_SHOW_BOOT),y)
  56. CMAKE_OPTIONS += -DSHOW_BOOT_ON_CONSOLE=1
  57. endif
  58. ifeq ($(CONFIG_PROCD_ZRAM_TMPFS),y)
  59. CMAKE_OPTIONS += -DZRAM_TMPFS=1
  60. endif
  61. define Package/procd/install
  62. $(INSTALL_DIR) $(1)/sbin $(1)/etc $(1)/lib/functions
  63. $(CP) $(PKG_INSTALL_DIR)/usr/sbin/{init,procd,askfirst,udevtrigger} $(1)/sbin/
  64. $(INSTALL_BIN) ./files/reload_config $(1)/sbin/
  65. $(INSTALL_DATA) ./files/hotplug*.json $(1)/etc/
  66. $(INSTALL_DATA) ./files/procd.sh $(1)/lib/functions/
  67. endef
  68. define Package/procd-nand/install
  69. $(INSTALL_DIR) $(1)/sbin $(1)/lib/upgrade
  70. $(CP) $(PKG_INSTALL_DIR)/usr/sbin/upgraded $(1)/sbin/
  71. $(INSTALL_DATA) ./files/nand.sh $(1)/lib/upgrade/
  72. endef
  73. define Package/procd-nand-firstboot/install
  74. $(INSTALL_DIR) $(1)/lib/preinit
  75. $(INSTALL_DATA) ./files/nand-preinit.sh $(1)/lib/preinit/60-nand-firstboot.sh
  76. endef
  77. $(eval $(call BuildPackage,procd))
  78. $(eval $(call BuildPackage,procd-nand))
  79. $(eval $(call BuildPackage,procd-nand-firstboot))