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-02-11
16 PKG_SOURCE_VERSION
:=7d78836dac9e0ece57c51ab06589efa524276b9d
17 PKG_MIRROR_HASH
:=261d8e6d0faa18b3c87cd6089b9110d655da133e478033e454c749ac43d3bc15
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
69 define Package
/fstools
/install
70 $(INSTALL_DIR
) $(1)/sbin
$(1)/lib
72 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/{mount_root
,jffs2reset
} $(1)/sbin
/
73 $(INSTALL_DATA
) $(PKG_INSTALL_DIR
)/usr
/lib
/libfstools.so
$(1)/lib
/
74 $(LN
) jffs2reset
$(1)/sbin
/jffs2mark
77 define Package
/snapshot-tool
/install
78 $(INSTALL_DIR
) $(1)/sbin
80 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/snapshot_tool
$(1)/sbin
/
81 $(INSTALL_BIN
) .
/files
/snapshot
$(1)/sbin
/
84 define Package
/block-mount
/install
85 $(INSTALL_DIR
) $(1)/sbin
$(1)/lib
$(1)/usr
/sbin
$(1)/etc
/hotplug.d
/block
$(1)/etc
/init.d
/ $(1)/etc
/uci-defaults
/
87 $(INSTALL_BIN
) .
/files
/fstab.init
$(1)/etc
/init.d
/fstab
88 $(INSTALL_DATA
) .
/files
/fstab.default
$(1)/etc
/uci-defaults
/10-fstab
89 $(INSTALL_DATA
) .
/files
/mount.hotplug
$(1)/etc
/hotplug.d
/block
/10-mount
91 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/block
$(1)/sbin
/
92 $(INSTALL_DATA
) $(PKG_INSTALL_DIR
)/usr
/lib
/libblkid-tiny.so
$(1)/lib
/
93 $(LN
) ..
/..
/sbin
/block
$(1)/usr
/sbin
/swapon
94 $(LN
) ..
/..
/sbin
/block
$(1)/usr
/sbin
/swapoff
98 define Build
/InstallDev
99 $(INSTALL_DIR
) $(1)/usr
/include
100 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/*.h
$(1)/usr
/include/
101 $(INSTALL_DIR
) $(1)/usr
/lib
/
102 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libubi-utils.a
$(1)/usr
/lib
/
105 $(eval
$(call BuildPackage
,fstools
))
106 $(eval
$(call BuildPackage
,snapshot-tool
))
107 $(eval
$(call BuildPackage
,block-mount
))