Makefile 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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:=1
  10. PKG_SOURCE_PROTO:=git
  11. PKG_SOURCE_URL=$(PROJECT_GIT)/project/procd.git
  12. PKG_SOURCE_DATE:=2019-04-07
  13. PKG_SOURCE_VERSION:=baaf38c5e540b23ba086d94743de860b60c37161
  14. PKG_MIRROR_HASH:=315f50294fbc745fbbd909317948544ad78071f15622995d4f508c692a3d0bc3
  15. CMAKE_INSTALL:=1
  16. PKG_LICENSE:=GPL-2.0
  17. PKG_LICENSE_FILES:=
  18. PKG_MAINTAINER:=John Crispin <[email protected]>
  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. TARGET_CFLAGS += -flto
  31. TARGET_LDFLAGS += -flto
  32. define Package/procd
  33. SECTION:=base
  34. CATEGORY:=Base system
  35. DEPENDS:=+ubusd +ubus +libjson-script +ubox +USE_GLIBC:librt +libubox +libubus
  36. TITLE:=OpenWrt system process manager
  37. endef
  38. define Package/procd-ujail
  39. SECTION:=base
  40. CATEGORY:=Base system
  41. DEPENDS:=@KERNEL_NAMESPACES +@KERNEL_UTS_NS +@KERNEL_IPC_NS +@KERNEL_PID_NS +libubox +libblobmsg-json
  42. TITLE:=OpenWrt process jail helper
  43. endef
  44. define Package/procd-seccomp
  45. SECTION:=base
  46. CATEGORY:=Base system
  47. DEPENDS:=@arm||@armeb||@mips||@mipsel||@i386||@powerpc||@x86_64 @!TARGET_uml @KERNEL_SECCOMP +libubox +libblobmsg-json
  48. TITLE:=OpenWrt process seccomp helper + utrace
  49. endef
  50. define Package/procd/config
  51. menu "Configuration"
  52. depends on PACKAGE_procd
  53. config PROCD_SHOW_BOOT
  54. bool
  55. default n
  56. prompt "Print the shutdown to the console as well as logging it to syslog"
  57. config PROCD_ZRAM_TMPFS
  58. bool
  59. default n
  60. prompt "Mount /tmp using zram."
  61. endmenu
  62. endef
  63. ifeq ($(CONFIG_PROCD_SHOW_BOOT),y)
  64. CMAKE_OPTIONS += -DSHOW_BOOT_ON_CONSOLE=1
  65. endif
  66. ifeq ($(CONFIG_PROCD_ZRAM_TMPFS),y)
  67. CMAKE_OPTIONS += -DZRAM_TMPFS=1
  68. endif
  69. ifdef CONFIG_PACKAGE_procd-ujail
  70. CMAKE_OPTIONS += -DJAIL_SUPPORT=1
  71. endif
  72. SECCOMP=$(if $(CONFIG_PACKAGE_procd-seccomp),1,0)
  73. CMAKE_OPTIONS += -DSECCOMP_SUPPORT=$(SECCOMP) -DUTRACE_SUPPORT=$(SECCOMP)
  74. define Package/procd/install
  75. $(INSTALL_DIR) $(1)/sbin $(1)/etc $(1)/lib/functions
  76. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{init,procd,askfirst,udevtrigger,upgraded} $(1)/sbin/
  77. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libsetlbf.so $(1)/lib
  78. $(INSTALL_BIN) ./files/reload_config $(1)/sbin/
  79. $(INSTALL_CONF) ./files/hotplug*.json $(1)/etc/
  80. $(INSTALL_DATA) ./files/procd.sh $(1)/lib/functions/
  81. endef
  82. define Package/procd-ujail/install
  83. $(INSTALL_DIR) $(1)/sbin
  84. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ujail $(1)/sbin/
  85. endef
  86. define Package/procd-seccomp/install
  87. $(INSTALL_DIR) $(1)/sbin $(1)/lib
  88. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libpreload-seccomp.so $(1)/lib
  89. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/utrace $(1)/sbin/
  90. $(LN) utrace $(1)/sbin/seccomp-trace
  91. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libpreload-trace.so $(1)/lib
  92. endef
  93. $(eval $(call BuildPackage,procd))
  94. $(eval $(call BuildPackage,procd-ujail))
  95. $(eval $(call BuildPackage,procd-seccomp))