Makefile 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #
  2. # Copyright (C) 2014 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:=2014-06-22
  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:=e0430f5c62f367e5a8e02755412977b02c3fc45e
  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:=GPLv2
  19. PKG_LICENSE_FILES:=
  20. PKG_MAINTAINER:=John Crispin <[email protected]>
  21. include $(INCLUDE_DIR)/package.mk
  22. include $(INCLUDE_DIR)/cmake.mk
  23. TARGET_LDFLAGS += $(if $(CONFIG_USE_EGLIBC),-lrt)
  24. define Package/fstools
  25. SECTION:=base
  26. CATEGORY:=Base system
  27. DEPENDS:=+ubox +USE_EGLIBC:librt +NAND_SUPPORT:ubi-utils
  28. TITLE:=OpenWrt filesystem tools
  29. endef
  30. define Package/block-mount
  31. SECTION:=base
  32. CATEGORY:=Base system
  33. TITLE:=Block device mounting and checking
  34. DEPENDS:=+ubox +libubox +libuci
  35. endef
  36. define Package/fstools/install
  37. $(INSTALL_DIR) $(1)/sbin $(1)/lib
  38. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{mount_root,jffs2reset,snapshot_tool} $(1)/sbin/
  39. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libfstools.so $(1)/lib/
  40. $(INSTALL_BIN) ./files/snapshot $(1)/sbin/
  41. ln -s /sbin/jffs2reset $(1)/sbin/jffs2mark
  42. endef
  43. define Package/block-mount/install
  44. $(INSTALL_DIR) $(1)/sbin $(1)/lib $(1)/usr/sbin $(1)/etc/hotplug.d/block $(1)/etc/init.d/ $(1)/etc/uci-defaults/
  45. $(INSTALL_BIN) ./files/fstab.init $(1)/etc/init.d/fstab
  46. $(INSTALL_DATA) ./files/fstab.default $(1)/etc/uci-defaults/10-fstab
  47. $(INSTALL_DATA) ./files/mount.hotplug $(1)/etc/hotplug.d/block/10-mount
  48. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/block $(1)/sbin/
  49. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libblkid-tiny.so $(1)/lib/
  50. ln -s /sbin/block $(1)/usr/sbin/swapon
  51. ln -s /sbin/block $(1)/usr/sbin/swapoff
  52. endef
  53. define Build/InstallDev
  54. $(INSTALL_DIR) $(1)/usr/include
  55. $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
  56. $(INSTALL_DIR) $(1)/usr/lib/
  57. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libubi-utils.a $(1)/usr/lib/
  58. endef
  59. $(eval $(call BuildPackage,fstools))
  60. $(eval $(call BuildPackage,block-mount))