Makefile 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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-01-10
  10. PKG_RELEASE=$(PKG_SOURCE_VERSION)
  11. PKG_SOURCE_PROTO:=git
  12. PKG_SOURCE_URL=$(OPENWRT_GIT)/project/fstools.git
  13. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  14. PKG_SOURCE_VERSION:=96415afecef35766332067f4205ef3b2c7561d21
  15. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
  16. CMAKE_INSTALL:=1
  17. PKG_LICENSE:=GPL-2.0
  18. PKG_LICENSE_FILES:=
  19. PKG_USE_MIPS16:=0
  20. PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
  21. include $(INCLUDE_DIR)/package.mk
  22. include $(INCLUDE_DIR)/cmake.mk
  23. TARGET_LDFLAGS += $(if $(CONFIG_USE_GLIBC),-lrt)
  24. CMAKE_OPTIONS += $(if $(CONFIG_FSTOOLS_UBIFS_EXTROOT),-DCMAKE_UBIFS_EXTROOT=y)
  25. define Package/fstools
  26. SECTION:=base
  27. CATEGORY:=Base system
  28. DEPENDS:=+ubox +USE_GLIBC:librt +NAND_SUPPORT:ubi-utils
  29. TITLE:=OpenWrt filesystem tools
  30. MENU:=1
  31. endef
  32. define Package/fstools/config
  33. config FSTOOLS_UBIFS_EXTROOT
  34. depends on PACKAGE_fstools
  35. depends on NAND_SUPPORT
  36. bool "Support extroot functionality with UBIFS"
  37. default y
  38. help
  39. This option makes it possible to use extroot functionality if the root filesystem resides on an UBIFS partition
  40. endef
  41. define Package/block-mount
  42. SECTION:=base
  43. CATEGORY:=Base system
  44. TITLE:=Block device mounting and checking
  45. DEPENDS:=+ubox +libubox +libuci
  46. endef
  47. define Package/fstools/install
  48. $(INSTALL_DIR) $(1)/sbin $(1)/lib
  49. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{mount_root,jffs2reset,snapshot_tool} $(1)/sbin/
  50. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libfstools.so $(1)/lib/
  51. $(INSTALL_BIN) ./files/snapshot $(1)/sbin/
  52. $(LN) jffs2reset $(1)/sbin/jffs2mark
  53. endef
  54. define Package/block-mount/install
  55. $(INSTALL_DIR) $(1)/sbin $(1)/lib $(1)/usr/sbin $(1)/etc/hotplug.d/block $(1)/etc/init.d/ $(1)/etc/uci-defaults/
  56. $(INSTALL_BIN) ./files/fstab.init $(1)/etc/init.d/fstab
  57. $(INSTALL_DATA) ./files/fstab.default $(1)/etc/uci-defaults/10-fstab
  58. $(INSTALL_DATA) ./files/mount.hotplug $(1)/etc/hotplug.d/block/10-mount
  59. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/block $(1)/sbin/
  60. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libblkid-tiny.so $(1)/lib/
  61. $(LN) ../../sbin/block $(1)/usr/sbin/swapon
  62. $(LN) ../../sbin/block $(1)/usr/sbin/swapoff
  63. endef
  64. define Build/InstallDev
  65. $(INSTALL_DIR) $(1)/usr/include
  66. $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
  67. $(INSTALL_DIR) $(1)/usr/lib/
  68. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libubi-utils.a $(1)/usr/lib/
  69. endef
  70. $(eval $(call BuildPackage,fstools))
  71. $(eval $(call BuildPackage,block-mount))