Makefile 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. #
  2. # Copyright (C) 2014-2015 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:=fstools
  9. PKG_RELEASE:=1
  10. PKG_SOURCE_PROTO:=git
  11. PKG_SOURCE_URL=$(PROJECT_GIT)/fstools.git
  12. PKG_MIRROR_HASH:=4ec370a1cdc9fa69131f1403b064d2e05d54ee865411917410d7540454265319
  13. PKG_SOURCE_DATE:=2023-02-28
  14. PKG_SOURCE_VERSION:=bfe882d5ff4eeebb8f57c8a0f9b9e767a57870d8
  15. CMAKE_INSTALL:=1
  16. PKG_LICENSE:=GPL-2.0
  17. PKG_LICENSE_FILES:=
  18. PKG_BUILD_FLAGS:=no-mips16
  19. PKG_FLAGS:=nonshared
  20. PKG_BUILD_DEPENDS := util-linux
  21. PKG_CONFIG_DEPENDS := CONFIG_NAND_SUPPORT CONFIG_FSTOOLS_UBIFS_EXTROOT
  22. PKG_MAINTAINER:=John Crispin <john@phrozen.org>
  23. include $(INCLUDE_DIR)/package.mk
  24. include $(INCLUDE_DIR)/cmake.mk
  25. CMAKE_OPTIONS += $(if $(CONFIG_FSTOOLS_UBIFS_EXTROOT),-DCMAKE_UBIFS_EXTROOT=y)
  26. CMAKE_OPTIONS += $(if $(CONFIG_FSTOOLS_OVL_MOUNT_FULL_ACCESS_TIME),-DCMAKE_OVL_MOUNT_FULL_ACCESS_TIME=y)
  27. CMAKE_OPTIONS += $(if $(CONFIG_FSTOOLS_OVL_MOUNT_COMPRESS_ZLIB),-DCMAKE_OVL_MOUNT_COMPRESS_ZLIB=y)
  28. define Package/fstools
  29. SECTION:=base
  30. CATEGORY:=Base system
  31. DEPENDS:=+ubox +NAND_SUPPORT:ubi-utils
  32. TITLE:=libreCMC filesystem tools
  33. MENU:=1
  34. endef
  35. define Package/fstools/config
  36. config FSTOOLS_UBIFS_EXTROOT
  37. depends on PACKAGE_fstools
  38. depends on NAND_SUPPORT
  39. bool "Support extroot functionality with UBIFS"
  40. default y
  41. help
  42. This option makes it possible to use extroot functionality if the root filesystem resides on an UBIFS partition
  43. config FSTOOLS_OVL_MOUNT_FULL_ACCESS_TIME
  44. depends on PACKAGE_fstools
  45. bool "Full access time accounting"
  46. default n
  47. help
  48. This option enables the full access time accounting (warning: it will increase the flash writes).
  49. config FSTOOLS_OVL_MOUNT_COMPRESS_ZLIB
  50. depends on PACKAGE_fstools
  51. bool "Compress using zlib"
  52. default n
  53. help
  54. This option enables the compression using zlib on the storage device.
  55. endef
  56. define Package/snapshot-tool
  57. SECTION:=base
  58. CATEGORY:=Base system
  59. TITLE:=rootfs snapshoting tool
  60. DEPENDS:=+libubox +fstools
  61. endef
  62. define Package/block-mount/conffiles
  63. /etc/config/fstab
  64. endef
  65. define Package/block-mount
  66. SECTION:=base
  67. CATEGORY:=Base system
  68. TITLE:=Block device mounting and checking
  69. DEPENDS:=+ubox +libubox +libuci +libblobmsg-json +libjson-c
  70. endef
  71. define Package/blockd
  72. SECTION:=base
  73. CATEGORY:=Base system
  74. TITLE:=Block device automounting
  75. DEPENDS:=+block-mount +fstools +libubus +kmod-fs-autofs4 +libblobmsg-json +libjson-c
  76. endef
  77. define Package/fstools/install
  78. $(INSTALL_DIR) $(1)/sbin $(1)/lib
  79. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{mount_root,jffs2reset} $(1)/sbin/
  80. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libfstools.so $(1)/lib/
  81. $(LN) jffs2reset $(1)/sbin/jffs2mark
  82. endef
  83. define Package/snapshot-tool/install
  84. $(INSTALL_DIR) $(1)/sbin
  85. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/snapshot_tool $(1)/sbin/
  86. $(INSTALL_BIN) ./files/snapshot $(1)/sbin/
  87. endef
  88. define Package/block-mount/install
  89. $(INSTALL_DIR) $(1)/sbin $(1)/lib $(1)/usr/sbin $(1)/etc/hotplug.d/block $(1)/etc/init.d/ $(1)/etc/uci-defaults/
  90. $(INSTALL_BIN) ./files/fstab.init $(1)/etc/init.d/fstab
  91. $(INSTALL_CONF) ./files/fstab.default $(1)/etc/uci-defaults/10-fstab
  92. $(INSTALL_CONF) ./files/mount.hotplug $(1)/etc/hotplug.d/block/10-mount
  93. $(INSTALL_CONF) ./files/media-change.hotplug $(1)/etc/hotplug.d/block/00-media-change
  94. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/block $(1)/sbin/
  95. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libblkid-tiny.so $(1)/lib/
  96. $(LN) ../../sbin/block $(1)/usr/sbin/swapon
  97. $(LN) ../../sbin/block $(1)/usr/sbin/swapoff
  98. endef
  99. define Package/blockd/install
  100. $(INSTALL_DIR) $(1)/sbin $(1)/etc/init.d/
  101. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/blockd $(1)/sbin/
  102. $(INSTALL_BIN) ./files/blockd.init $(1)/etc/init.d/blockd
  103. endef
  104. define Build/InstallDev
  105. $(INSTALL_DIR) $(1)/usr/include
  106. $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
  107. $(INSTALL_DIR) $(1)/usr/lib/
  108. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libubi-utils.a $(1)/usr/lib/
  109. endef
  110. $(eval $(call BuildPackage,fstools))
  111. $(eval $(call BuildPackage,snapshot-tool))
  112. $(eval $(call BuildPackage,block-mount))
  113. $(eval $(call BuildPackage,blockd))