Makefile 4.2 KB

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