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
11 PKG_RELEASE
:=$(AUTORELEASE
)
14 PKG_SOURCE_URL
=$(PROJECT_GIT
)/project
/fstools.git
15 PKG_MIRROR_HASH
:=dd8467092b30ea15a3568fea567e34f7d0b60d5c6ee0d1353e93a4df110ab1ab
16 PKG_SOURCE_DATE
:=2022-10-18
17 PKG_SOURCE_VERSION
:=ee54c6bce17c48a725eadcc313b6ca8445f9ec8c
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
)
36 CMAKE_OPTIONS
+= $(if
$(CONFIG_FSTOOLS_OVL_MOUNT_FULL_ACCESS_TIME
),-DCMAKE_OVL_MOUNT_FULL_ACCESS_TIME
=y
)
37 CMAKE_OPTIONS
+= $(if
$(CONFIG_FSTOOLS_OVL_MOUNT_COMPRESS_ZLIB
),-DCMAKE_OVL_MOUNT_COMPRESS_ZLIB
=y
)
39 define Package
/fstools
42 DEPENDS
:=+ubox
+USE_GLIBC
:librt
+NAND_SUPPORT
:ubi-utils
43 TITLE
:=OpenWrt filesystem tools
47 define Package
/fstools
/config
48 config FSTOOLS_UBIFS_EXTROOT
49 depends on PACKAGE_fstools
50 depends on NAND_SUPPORT
51 bool
"Support extroot functionality with UBIFS"
54 This option makes it possible to use extroot functionality if the root filesystem resides on an UBIFS partition
56 config FSTOOLS_OVL_MOUNT_FULL_ACCESS_TIME
57 depends on PACKAGE_fstools
58 bool
"Full access time accounting"
61 This option enables the full access time accounting
(warning
: it will increase the flash writes
).
63 config FSTOOLS_OVL_MOUNT_COMPRESS_ZLIB
64 depends on PACKAGE_fstools
65 bool
"Compress using zlib"
68 This option enables the compression using zlib on the storage device.
71 define Package
/snapshot-tool
74 TITLE
:=rootfs snapshoting tool
75 DEPENDS
:=+libubox
+fstools
78 define Package
/block-mount
/conffiles
82 define Package
/block-mount
85 TITLE
:=Block device mounting and checking
86 DEPENDS
:=+ubox
+libubox
+libuci
+libblobmsg-json
+libjson-c
92 TITLE
:=Block device automounting
93 DEPENDS
:=+block-mount
+fstools
+libubus
+kmod-fs-autofs4
+libblobmsg-json
+libjson-c
96 define Package
/fstools
/install
97 $(INSTALL_DIR
) $(1)/sbin
$(1)/lib
99 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/{mount_root
,jffs2reset
} $(1)/sbin
/
100 $(INSTALL_DATA
) $(PKG_INSTALL_DIR
)/usr
/lib
/libfstools.so
$(1)/lib
/
101 $(LN
) jffs2reset
$(1)/sbin
/jffs2mark
104 define Package
/snapshot-tool
/install
105 $(INSTALL_DIR
) $(1)/sbin
107 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/snapshot_tool
$(1)/sbin
/
108 $(INSTALL_BIN
) .
/files
/snapshot
$(1)/sbin
/
111 define Package
/block-mount
/install
112 $(INSTALL_DIR
) $(1)/sbin
$(1)/lib
$(1)/usr
/sbin
$(1)/etc
/hotplug.d
/block
$(1)/etc
/init.d
/ $(1)/etc
/uci-defaults
/
114 $(INSTALL_BIN
) .
/files
/fstab.init
$(1)/etc
/init.d
/fstab
115 $(INSTALL_CONF
) .
/files
/fstab.default
$(1)/etc
/uci-defaults
/10-fstab
116 $(INSTALL_CONF
) .
/files
/mount.hotplug
$(1)/etc
/hotplug.d
/block
/10-mount
117 $(INSTALL_CONF
) .
/files
/media-change.hotplug
$(1)/etc
/hotplug.d
/block
/00-media-change
119 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/block
$(1)/sbin
/
120 $(INSTALL_DATA
) $(PKG_INSTALL_DIR
)/usr
/lib
/libblkid-tiny.so
$(1)/lib
/
121 $(LN
) ..
/..
/sbin
/block
$(1)/usr
/sbin
/swapon
122 $(LN
) ..
/..
/sbin
/block
$(1)/usr
/sbin
/swapoff
126 define Package
/blockd
/install
127 $(INSTALL_DIR
) $(1)/sbin
$(1)/etc
/init.d
/
128 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/blockd
$(1)/sbin
/
129 $(INSTALL_BIN
) .
/files
/blockd.init
$(1)/etc
/init.d
/blockd
132 define Build
/InstallDev
133 $(INSTALL_DIR
) $(1)/usr
/include
134 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/*.h
$(1)/usr
/include/
135 $(INSTALL_DIR
) $(1)/usr
/lib
/
136 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libubi-utils.a
$(1)/usr
/lib
/
139 $(eval
$(call BuildPackage
,fstools
))
140 $(eval
$(call BuildPackage
,snapshot-tool
))
141 $(eval
$(call BuildPackage
,block-mount
))
142 $(eval
$(call BuildPackage
,blockd
))