2 # Copyright (C) 2014 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
11 PKG_VERSION
:=2014-06-22
13 PKG_RELEASE
=$(PKG_SOURCE_VERSION
)
16 PKG_SOURCE_URL
:=git
://nbd.name
/fstools.git
17 PKG_SOURCE_SUBDIR
:=$(PKG_NAME
)-$(PKG_VERSION
)
18 PKG_SOURCE_VERSION
:=e0430f5c62f367e5a8e02755412977b02c3fc45e
19 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
)-$(PKG_SOURCE_VERSION
).
tar.gz
21 PKG_CHECK_FORMAT_SECURITY
:=0
26 PKG_MAINTAINER
:=John Crispin
<blogic@openwrt.org
>
28 include $(INCLUDE_DIR
)/package.mk
29 include $(INCLUDE_DIR
)/cmake.mk
31 TARGET_LDFLAGS
+= $(if
$(CONFIG_USE_EGLIBC
),-lrt
)
33 define Package
/fstools
36 DEPENDS
:=+ubox
+USE_EGLIBC
:librt
+NAND_SUPPORT
:ubi-utils
37 TITLE
:=OpenWrt filesystem tools
40 define Package
/block-mount
43 TITLE
:=Block device mounting and checking
44 DEPENDS
:=+ubox
+libubox
+libuci
47 define Package
/fstools
/install
48 $(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
-s
/sbin
/jffs2reset
$(1)/sbin
/jffs2mark
56 define Package
/block-mount
/install
57 $(INSTALL_DIR
) $(1)/sbin
$(1)/lib
$(1)/usr
/sbin
$(1)/etc
/hotplug.d
/block
$(1)/etc
/init.d
/ $(1)/etc
/uci-defaults
/
59 $(INSTALL_BIN
) .
/files
/fstab.init
$(1)/etc
/init.d
/fstab
60 $(INSTALL_DATA
) .
/files
/fstab.default
$(1)/etc
/uci-defaults
/10-fstab
61 $(INSTALL_DATA
) .
/files
/mount.hotplug
$(1)/etc
/hotplug.d
/block
/10-mount
63 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/block
$(1)/sbin
/
64 $(INSTALL_DATA
) $(PKG_INSTALL_DIR
)/usr
/lib
/libblkid-tiny.so
$(1)/lib
/
65 ln
-s
/sbin
/block
$(1)/usr
/sbin
/swapon
66 ln
-s
/sbin
/block
$(1)/usr
/sbin
/swapoff
70 define Build
/InstallDev
71 $(INSTALL_DIR
) $(1)/usr
/include
72 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/*.h
$(1)/usr
/include/
73 $(INSTALL_DIR
) $(1)/usr
/lib
/
74 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libubi-utils.a
$(1)/usr
/lib
/
77 $(eval
$(call BuildPackage
,fstools
))
78 $(eval
$(call BuildPackage
,block-mount
))