Makefile 2.6 KB

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