Makefile 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. #
  2. # Copyright (C) 2014-2016 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_RELEASE:=2
  10. PKG_SOURCE_PROTO:=git
  11. PKG_SOURCE_URL=$(PROJECT_GIT)/project/procd.git
  12. PKG_SOURCE_DATE:=2018-01-23
  13. PKG_SOURCE_VERSION:=653629f19e591a0827ab39de07b4526bb119a57a
  14. PKG_MIRROR_HASH:=2e0c3ae45521eea456a8411c8d9ef19ed9a5ed6c0ab38b9496555625fb4ba6a2
  15. CMAKE_INSTALL:=1
  16. PKG_LICENSE:=GPL-2.0
  17. PKG_LICENSE_FILES:=
  18. PKG_MAINTAINER:=John Crispin <john@phrozen.org>
  19. PKG_CONFIG_DEPENDS:= \
  20. CONFIG_TARGET_INIT_PATH CONFIG_KERNEL_SECCOMP \
  21. CONFIG_PROCD_SHOW_BOOT CONFIG_PROCD_ZRAM_TMPFS \
  22. CONFIG_KERNEL_NAMESPACES CONFIG_PACKAGE_procd-ujail CONFIG_PACKAGE_procd-seccomp
  23. include $(INCLUDE_DIR)/package.mk
  24. include $(INCLUDE_DIR)/cmake.mk
  25. ifeq ($(DUMP),)
  26. STAMP_CONFIGURED:=$(strip $(STAMP_CONFIGURED))_$(shell echo $(CONFIG_TARGET_INIT_PATH) | mkhash md5)
  27. endif
  28. CMAKE_OPTIONS += -DEARLY_PATH="$(TARGET_INIT_PATH)"
  29. TARGET_LDFLAGS += $(if $(CONFIG_USE_GLIBC),-lrt)
  30. define Package/procd
  31. SECTION:=base
  32. CATEGORY:=Base system
  33. DEPENDS:=+ubusd +ubus +libjson-script +ubox +USE_GLIBC:librt +libubox +libubus
  34. TITLE:=OpenWrt system process manager
  35. endef
  36. define Package/procd-ujail
  37. SECTION:=base
  38. CATEGORY:=Base system
  39. DEPENDS:=@KERNEL_NAMESPACES +@KERNEL_UTS_NS +@KERNEL_IPC_NS +@KERNEL_PID_NS +libubox +libblobmsg-json
  40. TITLE:=OpenWrt process jail helper
  41. endef
  42. define Package/procd-seccomp
  43. SECTION:=base
  44. CATEGORY:=Base system
  45. DEPENDS:=@arm||@armeb||@mips||@mipsel||@i386||@x86_64 @!TARGET_uml @KERNEL_SECCOMP +libubox +libblobmsg-json
  46. TITLE:=OpenWrt process seccomp helper + utrace
  47. endef
  48. define Package/procd/config
  49. menu "Configuration"
  50. depends on PACKAGE_procd
  51. config PROCD_SHOW_BOOT
  52. bool
  53. default n
  54. prompt "Print the shutdown to the console as well as logging it to syslog"
  55. config PROCD_ZRAM_TMPFS
  56. bool
  57. default n
  58. prompt "Mount /tmp using zram."
  59. endmenu
  60. endef
  61. ifeq ($(CONFIG_PROCD_SHOW_BOOT),y)
  62. CMAKE_OPTIONS += -DSHOW_BOOT_ON_CONSOLE=1
  63. endif
  64. ifeq ($(CONFIG_PROCD_ZRAM_TMPFS),y)
  65. CMAKE_OPTIONS += -DZRAM_TMPFS=1
  66. endif
  67. ifdef CONFIG_PACKAGE_procd-ujail
  68. CMAKE_OPTIONS += -DJAIL_SUPPORT=1
  69. endif
  70. SECCOMP=$(if $(CONFIG_PACKAGE_procd-seccomp),1,0)
  71. CMAKE_OPTIONS += -DSECCOMP_SUPPORT=$(SECCOMP) -DUTRACE_SUPPORT=$(SECCOMP)
  72. define Package/procd/install
  73. $(INSTALL_DIR) $(1)/sbin $(1)/etc $(1)/lib/functions
  74. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{init,procd,askfirst,udevtrigger,upgraded} $(1)/sbin/
  75. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libsetlbf.so $(1)/lib
  76. $(INSTALL_BIN) ./files/reload_config $(1)/sbin/
  77. $(INSTALL_DATA) ./files/hotplug*.json $(1)/etc/
  78. $(INSTALL_DATA) ./files/procd.sh $(1)/lib/functions/
  79. endef
  80. define Package/procd-ujail/install
  81. $(INSTALL_DIR) $(1)/sbin
  82. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ujail $(1)/sbin/
  83. endef
  84. define Package/procd-seccomp/install
  85. $(INSTALL_DIR) $(1)/sbin $(1)/lib
  86. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libpreload-seccomp.so $(1)/lib
  87. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/utrace $(1)/sbin/
  88. $(LN) utrace $(1)/sbin/seccomp-trace
  89. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libpreload-trace.so $(1)/lib
  90. endef
  91. $(eval $(call BuildPackage,procd))
  92. $(eval $(call BuildPackage,procd-ujail))
  93. $(eval $(call BuildPackage,procd-seccomp))