Makefile 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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)/project/fstools.git
  12. PKG_SOURCE_DATE:=2018-02-11
  13. PKG_SOURCE_VERSION:=3d239815bb048041ec0d48cba273573d148ad7a9
  14. PKG_MIRROR_HASH:=28b7e9f6b8ba4ad3dcab44daa629df412af103bf31448177cffb0d176f0aacf1
  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. define Package/fstools
  28. SECTION:=base
  29. CATEGORY:=Base system
  30. DEPENDS:=+ubox +USE_GLIBC:librt +NAND_SUPPORT:ubi-utils
  31. TITLE:=OpenWrt filesystem tools
  32. MENU:=1
  33. endef
  34. define Package/fstools/config
  35. config FSTOOLS_UBIFS_EXTROOT
  36. depends on PACKAGE_fstools
  37. depends on NAND_SUPPORT
  38. bool "Support extroot functionality with UBIFS"
  39. default y
  40. help
  41. This option makes it possible to use extroot functionality if the root filesystem resides on an UBIFS partition
  42. endef
  43. define Package/snapshot-tool
  44. SECTION:=base
  45. CATEGORY:=Base system
  46. TITLE:=rootfs snapshoting tool
  47. DEPENDS:=+libubox +fstools
  48. endef
  49. define Package/block-mount
  50. SECTION:=base
  51. CATEGORY:=Base system
  52. TITLE:=Block device mounting and checking
  53. DEPENDS:=+ubox +libubox +libuci
  54. endef
  55. define Package/blockd
  56. SECTION:=base
  57. CATEGORY:=Base system
  58. TITLE:=Block device automounting
  59. DEPENDS:=+block-mount +fstools +libubus +kmod-fs-autofs4
  60. endef
  61. define Package/fstools/install
  62. $(INSTALL_DIR) $(1)/sbin $(1)/lib
  63. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{mount_root,jffs2reset} $(1)/sbin/
  64. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libfstools.so $(1)/lib/
  65. $(LN) jffs2reset $(1)/sbin/jffs2mark
  66. endef
  67. define Package/snapshot-tool/install
  68. $(INSTALL_DIR) $(1)/sbin
  69. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/snapshot_tool $(1)/sbin/
  70. $(INSTALL_BIN) ./files/snapshot $(1)/sbin/
  71. endef
  72. define Package/block-mount/install
  73. $(INSTALL_DIR) $(1)/sbin $(1)/lib $(1)/usr/sbin $(1)/etc/hotplug.d/block $(1)/etc/init.d/ $(1)/etc/uci-defaults/
  74. $(INSTALL_BIN) ./files/fstab.init $(1)/etc/init.d/fstab
  75. $(INSTALL_DATA) ./files/fstab.default $(1)/etc/uci-defaults/10-fstab
  76. $(INSTALL_DATA) ./files/mount.hotplug $(1)/etc/hotplug.d/block/10-mount
  77. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/block $(1)/sbin/
  78. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libblkid-tiny.so $(1)/lib/
  79. $(LN) ../../sbin/block $(1)/usr/sbin/swapon
  80. $(LN) ../../sbin/block $(1)/usr/sbin/swapoff
  81. endef
  82. define Package/blockd/install
  83. $(INSTALL_DIR) $(1)/sbin $(1)/etc/init.d/
  84. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/blockd $(1)/sbin/
  85. $(INSTALL_BIN) ./files/blockd.init $(1)/etc/init.d/blockd
  86. endef
  87. define Build/InstallDev
  88. $(INSTALL_DIR) $(1)/usr/include
  89. $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
  90. $(INSTALL_DIR) $(1)/usr/lib/
  91. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libubi-utils.a $(1)/usr/lib/
  92. endef
  93. $(eval $(call BuildPackage,fstools))
  94. $(eval $(call BuildPackage,snapshot-tool))
  95. $(eval $(call BuildPackage,block-mount))
  96. $(eval $(call BuildPackage,blockd))