Makefile 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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_VERSION:=2016-09-31
  10. PKG_RELEASE=$(PKG_SOURCE_VERSION)
  11. PKG_SOURCE_PROTO:=git
  12. PKG_SOURCE_URL=$(LEDE_GIT)/project/fstools.git
  13. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  14. PKG_SOURCE_VERSION:=94a5b0ad8d53f024f036c3526b48c34ebbd66a2f
  15. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
  16. PKG_MIRROR_MD5SUM:=f9fca74463187f2ef07c45154ae5dea296bd7e6fcb734bdc5f8d452e8d6b9fa2
  17. CMAKE_INSTALL:=1
  18. PKG_LICENSE:=GPL-2.0
  19. PKG_LICENSE_FILES:=
  20. PKG_USE_MIPS16:=0
  21. PKG_FLAGS:=nonshared
  22. PKG_BUILD_DEPENDS := util-linux
  23. PKG_CONFIG_DEPENDS := CONFIG_NAND_SUPPORT CONFIG_FSTOOLS_UBIFS_EXTROOT
  24. PKG_MAINTAINER:=John Crispin <[email protected]>
  25. include $(INCLUDE_DIR)/package.mk
  26. include $(INCLUDE_DIR)/cmake.mk
  27. TARGET_LDFLAGS += $(if $(CONFIG_USE_GLIBC),-lrt)
  28. CMAKE_OPTIONS += $(if $(CONFIG_FSTOOLS_UBIFS_EXTROOT),-DCMAKE_UBIFS_EXTROOT=y)
  29. define Package/fstools
  30. SECTION:=base
  31. CATEGORY:=Base system
  32. DEPENDS:=+ubox +USE_GLIBC:librt +NAND_SUPPORT:ubi-utils
  33. TITLE:=OpenWrt 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. endef
  45. define Package/snapshot-tool
  46. SECTION:=base
  47. CATEGORY:=Base system
  48. TITLE:=rootfs snapshoting tool
  49. DEPENDS:=+libubox +fstools
  50. endef
  51. define Package/block-mount
  52. SECTION:=base
  53. CATEGORY:=Base system
  54. TITLE:=Block device mounting and checking
  55. DEPENDS:=+ubox +libubox +libuci
  56. endef
  57. define Package/fstools/install
  58. $(INSTALL_DIR) $(1)/sbin $(1)/lib
  59. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{mount_root,jffs2reset} $(1)/sbin/
  60. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libfstools.so $(1)/lib/
  61. $(LN) jffs2reset $(1)/sbin/jffs2mark
  62. endef
  63. define Package/snapshot-tool/install
  64. $(INSTALL_DIR) $(1)/sbin
  65. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/snapshot_tool $(1)/sbin/
  66. $(INSTALL_BIN) ./files/snapshot $(1)/sbin/
  67. endef
  68. define Package/block-mount/install
  69. $(INSTALL_DIR) $(1)/sbin $(1)/lib $(1)/usr/sbin $(1)/etc/hotplug.d/block $(1)/etc/init.d/ $(1)/etc/uci-defaults/
  70. $(INSTALL_BIN) ./files/fstab.init $(1)/etc/init.d/fstab
  71. $(INSTALL_DATA) ./files/fstab.default $(1)/etc/uci-defaults/10-fstab
  72. $(INSTALL_DATA) ./files/mount.hotplug $(1)/etc/hotplug.d/block/10-mount
  73. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/block $(1)/sbin/
  74. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libblkid-tiny.so $(1)/lib/
  75. $(LN) ../../sbin/block $(1)/usr/sbin/swapon
  76. $(LN) ../../sbin/block $(1)/usr/sbin/swapoff
  77. endef
  78. define Build/InstallDev
  79. $(INSTALL_DIR) $(1)/usr/include
  80. $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
  81. $(INSTALL_DIR) $(1)/usr/lib/
  82. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libubi-utils.a $(1)/usr/lib/
  83. endef
  84. $(eval $(call BuildPackage,fstools))
  85. $(eval $(call BuildPackage,snapshot-tool))
  86. $(eval $(call BuildPackage,block-mount))