2 # Copyright (C) 2014-2015 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
14 PKG_SOURCE_URL
=$(LEDE_GIT
)/project
/fstools.git
15 PKG_SOURCE_DATE
:=2017-07-31
16 PKG_SOURCE_VERSION
:=8ab4fda66a136f5b0f1e5dff9d3649961ffc9158
17 PKG_MIRROR_HASH
:=f04712fbefbcc2af1da9364310ac6dd771322c3ce2d920d2c003aaea97dbe4b4
26 PKG_BUILD_DEPENDS
:= util-linux
27 PKG_CONFIG_DEPENDS
:= CONFIG_NAND_SUPPORT CONFIG_FSTOOLS_UBIFS_EXTROOT
29 PKG_MAINTAINER
:=John Crispin
<john@phrozen.org
>
31 include $(INCLUDE_DIR
)/package.mk
32 include $(INCLUDE_DIR
)/cmake.mk
34 TARGET_LDFLAGS
+= $(if
$(CONFIG_USE_GLIBC
),-lrt
)
35 CMAKE_OPTIONS
+= $(if
$(CONFIG_FSTOOLS_UBIFS_EXTROOT
),-DCMAKE_UBIFS_EXTROOT
=y
)
37 define Package
/fstools
40 DEPENDS
:=+ubox
+USE_GLIBC
:librt
+NAND_SUPPORT
:ubi-utils
41 TITLE
:=OpenWrt filesystem tools
45 define Package
/fstools
/config
46 config FSTOOLS_UBIFS_EXTROOT
47 depends on PACKAGE_fstools
48 depends on NAND_SUPPORT
49 bool
"Support extroot functionality with UBIFS"
52 This option makes it possible to use extroot functionality if the root filesystem resides on an UBIFS partition
55 define Package
/snapshot-tool
58 TITLE
:=rootfs snapshoting tool
59 DEPENDS
:=+libubox
+fstools
62 define Package
/block-mount
65 TITLE
:=Block device mounting and checking
66 DEPENDS
:=+ubox
+libubox
+libuci
72 TITLE
:=Block device automounting
73 DEPENDS
:=+block-mount
+fstools
+libubus
+kmod-fs-autofs4
76 define Package
/fstools
/install
77 $(INSTALL_DIR
) $(1)/sbin
$(1)/lib
79 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/{mount_root
,jffs2reset
} $(1)/sbin
/
80 $(INSTALL_DATA
) $(PKG_INSTALL_DIR
)/usr
/lib
/libfstools.so
$(1)/lib
/
81 $(LN
) jffs2reset
$(1)/sbin
/jffs2mark
84 define Package
/snapshot-tool
/install
85 $(INSTALL_DIR
) $(1)/sbin
87 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/snapshot_tool
$(1)/sbin
/
88 $(INSTALL_BIN
) .
/files
/snapshot
$(1)/sbin
/
91 define Package
/block-mount
/install
92 $(INSTALL_DIR
) $(1)/sbin
$(1)/lib
$(1)/usr
/sbin
$(1)/etc
/hotplug.d
/block
$(1)/etc
/init.d
/ $(1)/etc
/uci-defaults
/
94 $(INSTALL_BIN
) .
/files
/fstab.init
$(1)/etc
/init.d
/fstab
95 $(INSTALL_DATA
) .
/files
/fstab.default
$(1)/etc
/uci-defaults
/10-fstab
96 $(INSTALL_DATA
) .
/files
/mount.hotplug
$(1)/etc
/hotplug.d
/block
/10-mount
98 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/block
$(1)/sbin
/
99 $(INSTALL_DATA
) $(PKG_INSTALL_DIR
)/usr
/lib
/libblkid-tiny.so
$(1)/lib
/
100 $(LN
) ..
/..
/sbin
/block
$(1)/usr
/sbin
/swapon
101 $(LN
) ..
/..
/sbin
/block
$(1)/usr
/sbin
/swapoff
105 define Package
/blockd
/install
106 $(INSTALL_DIR
) $(1)/sbin
$(1)/etc
/init.d
/
107 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/blockd
$(1)/sbin
/
108 $(INSTALL_BIN
) .
/files
/blockd.init
$(1)/etc
/init.d
/blockd
111 define Build
/InstallDev
112 $(INSTALL_DIR
) $(1)/usr
/include
113 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/*.h
$(1)/usr
/include/
114 $(INSTALL_DIR
) $(1)/usr
/lib
/
115 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libubi-utils.a
$(1)/usr
/lib
/
118 $(eval
$(call BuildPackage
,fstools
))
119 $(eval
$(call BuildPackage
,snapshot-tool
))
120 $(eval
$(call BuildPackage
,block-mount
))
121 $(eval
$(call BuildPackage
,blockd
))