1
0

Makefile 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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=$(LEDE_GIT)/project/fstools.git
  12. PKG_SOURCE_DATE:=2016-12-04
  13. PKG_SOURCE_VERSION:=84b530a732b12cca1cd5ee9ba163b7ead7a83de3
  14. PKG_MIRROR_HASH:=b607138de1adbb7f49e53daebe28ac1352910fa2b29278365edeabafc5b46a91
  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/fstools/install
  56. $(INSTALL_DIR) $(1)/sbin $(1)/lib
  57. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{mount_root,jffs2reset} $(1)/sbin/
  58. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libfstools.so $(1)/lib/
  59. $(LN) jffs2reset $(1)/sbin/jffs2mark
  60. endef
  61. define Package/snapshot-tool/install
  62. $(INSTALL_DIR) $(1)/sbin
  63. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/snapshot_tool $(1)/sbin/
  64. $(INSTALL_BIN) ./files/snapshot $(1)/sbin/
  65. endef
  66. define Package/block-mount/install
  67. $(INSTALL_DIR) $(1)/sbin $(1)/lib $(1)/usr/sbin $(1)/etc/hotplug.d/block $(1)/etc/init.d/ $(1)/etc/uci-defaults/
  68. $(INSTALL_BIN) ./files/fstab.init $(1)/etc/init.d/fstab
  69. $(INSTALL_DATA) ./files/fstab.default $(1)/etc/uci-defaults/10-fstab
  70. $(INSTALL_DATA) ./files/mount.hotplug $(1)/etc/hotplug.d/block/10-mount
  71. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/block $(1)/sbin/
  72. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libblkid-tiny.so $(1)/lib/
  73. $(LN) ../../sbin/block $(1)/usr/sbin/swapon
  74. $(LN) ../../sbin/block $(1)/usr/sbin/swapoff
  75. endef
  76. define Build/InstallDev
  77. $(INSTALL_DIR) $(1)/usr/include
  78. $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
  79. $(INSTALL_DIR) $(1)/usr/lib/
  80. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libubi-utils.a $(1)/usr/lib/
  81. endef
  82. $(eval $(call BuildPackage,fstools))
  83. $(eval $(call BuildPackage,snapshot-tool))
  84. $(eval $(call BuildPackage,block-mount))