Makefile 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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:=3
  10. PKG_SOURCE_PROTO:=git
  11. PKG_SOURCE_URL=$(PROJECT_GIT)/project/fstools.git
  12. PKG_SOURCE_DATE:=2018-09-29
  13. PKG_SOURCE_VERSION:=29e53af0b91954ca6a13bdd1f0e67c939ccb8e6d
  14. PKG_MIRROR_HASH:=e90c60362dc3f304c9748b57a3e602f37fd758bf8134fbc3fbbda4300d4f46c7
  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
  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
  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_BIN) $(PKG_INSTALL_DIR)/usr/sbin/block $(1)/sbin/
  92. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libblkid-tiny.so $(1)/lib/
  93. $(LN) ../../sbin/block $(1)/usr/sbin/swapon
  94. $(LN) ../../sbin/block $(1)/usr/sbin/swapoff
  95. endef
  96. define Package/blockd/install
  97. $(INSTALL_DIR) $(1)/sbin $(1)/etc/init.d/
  98. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/blockd $(1)/sbin/
  99. $(INSTALL_BIN) ./files/blockd.init $(1)/etc/init.d/blockd
  100. endef
  101. define Build/InstallDev
  102. $(INSTALL_DIR) $(1)/usr/include
  103. $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
  104. $(INSTALL_DIR) $(1)/usr/lib/
  105. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libubi-utils.a $(1)/usr/lib/
  106. endef
  107. $(eval $(call BuildPackage,fstools))
  108. $(eval $(call BuildPackage,snapshot-tool))
  109. $(eval $(call BuildPackage,block-mount))
  110. $(eval $(call BuildPackage,blockd))