Makefile 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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)/procd.git
  12. PKG_MIRROR_HASH:=3c818904c62261f973a016397d0eb9f11bf8d01f7ceddb48fcb0e1d59a139d52
  13. PKG_SOURCE_DATE:=2020-03-07
  14. PKG_SOURCE_VERSION:=09b9bd828981a4f9271f8906f7b6f5af04e1a6f9
  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. 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 +libblobmsg-json +libjson-c
  36. TITLE:=libreCMC system process manager
  37. USERID:=:dialout=20 :audio=29
  38. endef
  39. define Package/procd-ujail
  40. SECTION:=base
  41. CATEGORY:=Base system
  42. DEPENDS:=@KERNEL_NAMESPACES +@KERNEL_UTS_NS +@KERNEL_IPC_NS +@KERNEL_PID_NS +libubox +libblobmsg-json
  43. TITLE:=libreCMC process jail helper
  44. endef
  45. define Package/procd-seccomp
  46. SECTION:=base
  47. CATEGORY:=Base system
  48. DEPENDS:=@(arm||armeb||mips||mipsel||i386||powerpc||x86_64) @!TARGET_uml @KERNEL_SECCOMP +libubox +libblobmsg-json
  49. TITLE:=libreCMC process seccomp helper + utrace
  50. endef
  51. define Package/procd/config
  52. menu "Configuration"
  53. depends on PACKAGE_procd
  54. config PROCD_SHOW_BOOT
  55. bool
  56. default n
  57. prompt "Print the shutdown to the console as well as logging it to syslog"
  58. config PROCD_ZRAM_TMPFS
  59. bool
  60. default n
  61. prompt "Mount /tmp using zram."
  62. endmenu
  63. endef
  64. ifeq ($(CONFIG_PROCD_SHOW_BOOT),y)
  65. CMAKE_OPTIONS += -DSHOW_BOOT_ON_CONSOLE=1
  66. endif
  67. ifeq ($(CONFIG_PROCD_ZRAM_TMPFS),y)
  68. CMAKE_OPTIONS += -DZRAM_TMPFS=1
  69. endif
  70. ifdef CONFIG_PACKAGE_procd-ujail
  71. CMAKE_OPTIONS += -DJAIL_SUPPORT=1
  72. endif
  73. SECCOMP=$(if $(CONFIG_PACKAGE_procd-seccomp),1,0)
  74. CMAKE_OPTIONS += -DSECCOMP_SUPPORT=$(SECCOMP) -DUTRACE_SUPPORT=$(SECCOMP)
  75. define Package/procd/install
  76. $(INSTALL_DIR) $(1)/sbin $(1)/etc $(1)/lib/functions
  77. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{init,procd,askfirst,udevtrigger,upgraded} $(1)/sbin/
  78. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libsetlbf.so $(1)/lib
  79. $(INSTALL_BIN) ./files/reload_config $(1)/sbin/
  80. $(INSTALL_CONF) ./files/hotplug*.json $(1)/etc/
  81. $(INSTALL_DATA) ./files/procd.sh $(1)/lib/functions/
  82. endef
  83. define Package/procd-ujail/install
  84. $(INSTALL_DIR) $(1)/sbin
  85. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ujail $(1)/sbin/
  86. endef
  87. define Package/procd-seccomp/install
  88. $(INSTALL_DIR) $(1)/sbin $(1)/lib
  89. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libpreload-seccomp.so $(1)/lib
  90. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/utrace $(1)/sbin/
  91. $(LN) utrace $(1)/sbin/seccomp-trace
  92. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libpreload-trace.so $(1)/lib
  93. endef
  94. $(eval $(call BuildPackage,procd))
  95. $(eval $(call BuildPackage,procd-ujail))
  96. $(eval $(call BuildPackage,procd-seccomp))