1
0

Makefile 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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:=2017-06-30
  13. PKG_SOURCE_VERSION:=bdcb075fafdac0bfe3207c23f64acd58432bad86
  14. PKG_MIRROR_HASH:=760a1fdbd379f1191947ac6ba9881a85a9b8c43f4a96d49db18d4654b0c312c4
  15. PKG_RELEASE:=1
  16. CMAKE_INSTALL:=1
  17. PKG_LICENSE:=GPL-2.0
  18. PKG_LICENSE_FILES:=
  19. PKG_USE_MIPS16:=0
  20. PKG_FLAGS:=nonshared
  21. PKG_BUILD_DEPENDS := util-linux
  22. PKG_CONFIG_DEPENDS := CONFIG_NAND_SUPPORT CONFIG_FSTOOLS_UBIFS_EXTROOT
  23. PKG_MAINTAINER:=John Crispin <john@phrozen.org>
  24. include $(INCLUDE_DIR)/package.mk
  25. include $(INCLUDE_DIR)/cmake.mk
  26. TARGET_LDFLAGS += $(if $(CONFIG_USE_GLIBC),-lrt)
  27. CMAKE_OPTIONS += $(if $(CONFIG_FSTOOLS_UBIFS_EXTROOT),-DCMAKE_UBIFS_EXTROOT=y)
  28. define Package/fstools
  29. SECTION:=base
  30. CATEGORY:=Base system
  31. DEPENDS:=+ubox +USE_GLIBC:librt +NAND_SUPPORT:ubi-utils
  32. TITLE:=OpenWrt filesystem tools
  33. MENU:=1
  34. endef
  35. define Package/fstools/config
  36. config FSTOOLS_UBIFS_EXTROOT
  37. depends on PACKAGE_fstools
  38. depends on NAND_SUPPORT
  39. bool "Support extroot functionality with UBIFS"
  40. default y
  41. help
  42. This option makes it possible to use extroot functionality if the root filesystem resides on an UBIFS partition
  43. endef
  44. define Package/snapshot-tool
  45. SECTION:=base
  46. CATEGORY:=Base system
  47. TITLE:=rootfs snapshoting tool
  48. DEPENDS:=+libubox +fstools
  49. endef
  50. define Package/block-mount
  51. SECTION:=base
  52. CATEGORY:=Base system
  53. TITLE:=Block device mounting and checking
  54. DEPENDS:=+ubox +libubox +libuci
  55. endef
  56. define Package/fstools/install
  57. $(INSTALL_DIR) $(1)/sbin $(1)/lib
  58. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{mount_root,jffs2reset} $(1)/sbin/
  59. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libfstools.so $(1)/lib/
  60. $(LN) jffs2reset $(1)/sbin/jffs2mark
  61. endef
  62. define Package/snapshot-tool/install
  63. $(INSTALL_DIR) $(1)/sbin
  64. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/snapshot_tool $(1)/sbin/
  65. $(INSTALL_BIN) ./files/snapshot $(1)/sbin/
  66. endef
  67. define Package/block-mount/install
  68. $(INSTALL_DIR) $(1)/sbin $(1)/lib $(1)/usr/sbin $(1)/etc/hotplug.d/block $(1)/etc/init.d/ $(1)/etc/uci-defaults/
  69. $(INSTALL_BIN) ./files/fstab.init $(1)/etc/init.d/fstab
  70. $(INSTALL_DATA) ./files/fstab.default $(1)/etc/uci-defaults/10-fstab
  71. $(INSTALL_DATA) ./files/mount.hotplug $(1)/etc/hotplug.d/block/10-mount
  72. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/block $(1)/sbin/
  73. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libblkid-tiny.so $(1)/lib/
  74. $(LN) ../../sbin/block $(1)/usr/sbin/swapon
  75. $(LN) ../../sbin/block $(1)/usr/sbin/swapoff
  76. endef
  77. define Build/InstallDev
  78. $(INSTALL_DIR) $(1)/usr/include
  79. $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
  80. $(INSTALL_DIR) $(1)/usr/lib/
  81. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libubi-utils.a $(1)/usr/lib/
  82. endef
  83. $(eval $(call BuildPackage,fstools))
  84. $(eval $(call BuildPackage,snapshot-tool))
  85. $(eval $(call BuildPackage,block-mount))