Makefile 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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:=$(AUTORELEASE)
  10. PKG_SOURCE_PROTO:=git
  11. PKG_SOURCE_URL=$(PROJECT_GIT)/project/procd.git
  12. PKG_MIRROR_HASH:=d60b4aa9d47d75e906dfd812528a1bc28e91f5af72a9d9275056b71b19d99f04
  13. PKG_SOURCE_DATE:=2022-11-10
  14. PKG_SOURCE_VERSION:=039b88f75367203e540009cc97603b1bce3fafa6
  15. CMAKE_INSTALL:=1
  16. PKG_LICENSE:=GPL-2.0
  17. PKG_LICENSE_FILES:=
  18. PKG_MAINTAINER:=John Crispin <[email protected]>
  19. PKG_ASLR_PIE_REGULAR:=1
  20. PKG_CONFIG_DEPENDS:= \
  21. CONFIG_TARGET_INIT_PATH CONFIG_KERNEL_SECCOMP CONFIG_PROCD_SHOW_BOOT \
  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_CFLAGS += -flto
  30. TARGET_LDFLAGS += -flto
  31. define Package/procd/Default
  32. SECTION:=base
  33. CATEGORY:=Base system
  34. DEPENDS:=+ubusd +ubus +libjson-script +ubox +libubox \
  35. +libubus +libblobmsg-json +libjson-c +jshn
  36. TITLE:=OpenWrt system process manager
  37. USERID:=:dialout=20 :audio=29
  38. endef
  39. define Package/procd
  40. $(call Package/procd/Default)
  41. VARIANT:=default
  42. CONFLICTS:=procd-selinux
  43. endef
  44. define Package/procd-selinux
  45. $(call Package/procd/Default)
  46. DEPENDS += +libselinux
  47. TITLE += with SELinux support
  48. PROVIDES:=procd
  49. VARIANT:=selinux
  50. endef
  51. define Package/procd-ujail
  52. SECTION:=base
  53. CATEGORY:=Base system
  54. DEPENDS:=@KERNEL_NAMESPACES +@KERNEL_UTS_NS +@KERNEL_IPC_NS +@KERNEL_PID_NS \
  55. +libubox +libubus +libuci +libblobmsg-json
  56. TITLE:=OpenWrt process jail helper
  57. endef
  58. define Package/procd-seccomp
  59. SECTION:=base
  60. CATEGORY:=Base system
  61. DEPENDS:=@SECCOMP +libubox +libblobmsg-json
  62. TITLE:=OpenWrt process seccomp helper + utrace
  63. endef
  64. define Package/uxc
  65. SECTION:=base
  66. CATEGORY:=Base system
  67. DEPENDS:=+procd-ujail +libubus +libubox +libblobmsg-json +blockd +PACKAGE_uxc:rpcd
  68. TITLE:=OpenWrt container management
  69. MAINTAINER:=Daniel Golle <[email protected]>
  70. endef
  71. define Package/procd/config
  72. menu "Configuration"
  73. depends on PACKAGE_procd || PACKAGE_procd-selinux
  74. config PROCD_SHOW_BOOT
  75. bool
  76. default n
  77. prompt "Print the shutdown to the console as well as logging it to syslog"
  78. endmenu
  79. endef
  80. ifeq ($(BUILD_VARIANT),selinux)
  81. CMAKE_OPTIONS += -DSELINUX=1
  82. endif
  83. ifeq ($(CONFIG_PROCD_SHOW_BOOT),y)
  84. CMAKE_OPTIONS += -DSHOW_BOOT_ON_CONSOLE=1
  85. endif
  86. ifdef CONFIG_PACKAGE_procd-ujail
  87. CMAKE_OPTIONS += -DJAIL_SUPPORT=1
  88. endif
  89. SECCOMP=$(if $(CONFIG_PACKAGE_procd-seccomp),1,0)
  90. CMAKE_OPTIONS += -DSECCOMP_SUPPORT=$(SECCOMP) -DUTRACE_SUPPORT=$(SECCOMP)
  91. define Package/procd/install
  92. $(INSTALL_DIR) $(1)/sbin $(1)/etc $(1)/lib/functions
  93. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{init,procd,askfirst,udevtrigger,upgraded} $(1)/sbin/
  94. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libsetlbf.so $(1)/lib
  95. $(INSTALL_BIN) ./files/reload_config $(1)/sbin/
  96. $(INSTALL_CONF) ./files/hotplug*.json $(1)/etc/
  97. $(INSTALL_DATA) ./files/procd.sh $(1)/lib/functions/
  98. $(INSTALL_BIN) ./files/service $(1)/sbin/service
  99. endef
  100. Package/procd-selinux/install = $(Package/procd/install)
  101. define Package/procd-ujail/install
  102. $(INSTALL_DIR) $(1)/sbin
  103. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ujail $(1)/sbin/
  104. endef
  105. define Package/procd-seccomp/install
  106. $(INSTALL_DIR) $(1)/sbin $(1)/lib
  107. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libpreload-seccomp.so $(1)/lib
  108. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/utrace $(1)/sbin/
  109. $(LN) utrace $(1)/sbin/seccomp-trace
  110. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libpreload-trace.so $(1)/lib
  111. endef
  112. define Package/uxc/conffiles
  113. /etc/uxc
  114. endef
  115. define Package/uxc/install
  116. $(INSTALL_DIR) $(1)/sbin
  117. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/uxc $(1)/sbin/
  118. $(INSTALL_DIR) $(1)/etc/init.d
  119. $(INSTALL_BIN) ./files/uxc.init $(1)/etc/init.d/uxc
  120. endef
  121. $(eval $(call BuildPackage,procd))
  122. $(eval $(call BuildPackage,procd-selinux))
  123. $(eval $(call BuildPackage,procd-ujail))
  124. $(eval $(call BuildPackage,procd-seccomp))
  125. $(eval $(call BuildPackage,uxc))