Makefile 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  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:=1b875efd7d675d74a56602f57dd27093e2feef8761ba28b567e2d2f43db14b48
  13. PKG_SOURCE_DATE:=2020-05-12
  14. PKG_SOURCE_VERSION:=84269037b75de93bdd4ea75b7f50ba77ba976377
  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 <john@phrozen.org>
  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:=libreCMC 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
  64. SECTION:=base
  65. CATEGORY:=Base system
  66. TITLE:=Block device mounting and checking
  67. DEPENDS:=+ubox +libubox +libuci +libblobmsg-json +libjson-c
  68. endef
  69. define Package/blockd
  70. SECTION:=base
  71. CATEGORY:=Base system
  72. TITLE:=Block device automounting
  73. DEPENDS:=+block-mount +fstools +libubus +kmod-fs-autofs4 +libblobmsg-json +libjson-c
  74. endef
  75. define Package/fstools/install
  76. $(INSTALL_DIR) $(1)/sbin $(1)/lib
  77. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{mount_root,jffs2reset} $(1)/sbin/
  78. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libfstools.so $(1)/lib/
  79. $(LN) jffs2reset $(1)/sbin/jffs2mark
  80. endef
  81. define Package/snapshot-tool/install
  82. $(INSTALL_DIR) $(1)/sbin
  83. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/snapshot_tool $(1)/sbin/
  84. $(INSTALL_BIN) ./files/snapshot $(1)/sbin/
  85. endef
  86. define Package/block-mount/install
  87. $(INSTALL_DIR) $(1)/sbin $(1)/lib $(1)/usr/sbin $(1)/etc/hotplug.d/block $(1)/etc/init.d/ $(1)/etc/uci-defaults/
  88. $(INSTALL_BIN) ./files/fstab.init $(1)/etc/init.d/fstab
  89. $(INSTALL_CONF) ./files/fstab.default $(1)/etc/uci-defaults/10-fstab
  90. $(INSTALL_CONF) ./files/mount.hotplug $(1)/etc/hotplug.d/block/10-mount
  91. $(INSTALL_CONF) ./files/media-change.hotplug $(1)/etc/hotplug.d/block/00-media-change
  92. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/block $(1)/sbin/
  93. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libblkid-tiny.so $(1)/lib/
  94. $(LN) ../../sbin/block $(1)/usr/sbin/swapon
  95. $(LN) ../../sbin/block $(1)/usr/sbin/swapoff
  96. endef
  97. define Package/blockd/install
  98. $(INSTALL_DIR) $(1)/sbin $(1)/etc/init.d/
  99. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/blockd $(1)/sbin/
  100. $(INSTALL_BIN) ./files/blockd.init $(1)/etc/init.d/blockd
  101. endef
  102. define Build/InstallDev
  103. $(INSTALL_DIR) $(1)/usr/include
  104. $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
  105. $(INSTALL_DIR) $(1)/usr/lib/
  106. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libubi-utils.a $(1)/usr/lib/
  107. endef
  108. $(eval $(call BuildPackage,fstools))
  109. $(eval $(call BuildPackage,snapshot-tool))
  110. $(eval $(call BuildPackage,block-mount))
  111. $(eval $(call BuildPackage,blockd))