fstools: update to the latest version, adds support for ext4/f2fs overlay via loopbac...
[openwrt/staging/dedeckeh.git] / package / system / fstools / Makefile
1 #
2 # Copyright (C) 2014-2015 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=fstools
11 PKG_VERSION:=2016-09-08
12
13 PKG_RELEASE=$(PKG_SOURCE_VERSION)
14
15 PKG_SOURCE_PROTO:=git
16 PKG_SOURCE_URL=$(LEDE_GIT)/project/fstools.git
17 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
18 PKG_SOURCE_VERSION:=fe514c9a20365ba00232c2c981463f43a4a41a7d
19 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
20 CMAKE_INSTALL:=1
21
22 PKG_LICENSE:=GPL-2.0
23 PKG_LICENSE_FILES:=
24
25 PKG_USE_MIPS16:=0
26
27 PKG_MAINTAINER:=John Crispin <john@phrozen.org>
28
29 include $(INCLUDE_DIR)/package.mk
30 include $(INCLUDE_DIR)/cmake.mk
31
32 TARGET_LDFLAGS += $(if $(CONFIG_USE_GLIBC),-lrt)
33 CMAKE_OPTIONS += $(if $(CONFIG_FSTOOLS_UBIFS_EXTROOT),-DCMAKE_UBIFS_EXTROOT=y)
34
35 define Package/fstools
36 SECTION:=base
37 CATEGORY:=Base system
38 DEPENDS:=+ubox +USE_GLIBC:librt +NAND_SUPPORT:ubi-utils
39 TITLE:=OpenWrt filesystem tools
40 MENU:=1
41 endef
42
43 define Package/fstools/config
44 config FSTOOLS_UBIFS_EXTROOT
45 depends on PACKAGE_fstools
46 depends on NAND_SUPPORT
47 bool "Support extroot functionality with UBIFS"
48 default y
49 help
50 This option makes it possible to use extroot functionality if the root filesystem resides on an UBIFS partition
51 endef
52
53 define Package/snapshot-tool
54 SECTION:=base
55 CATEGORY:=Base system
56 TITLE:=rootfs snapshoting tool
57 DEPENDS:=+libubox +fstools
58 endef
59
60 define Package/block-mount
61 SECTION:=base
62 CATEGORY:=Base system
63 TITLE:=Block device mounting and checking
64 DEPENDS:=+ubox +libubox +libuci
65 endef
66
67 define Package/fstools/install
68 $(INSTALL_DIR) $(1)/sbin $(1)/lib
69
70 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{mount_root,jffs2reset} $(1)/sbin/
71 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libfstools.so $(1)/lib/
72 $(LN) jffs2reset $(1)/sbin/jffs2mark
73 endef
74
75 define Package/snapshot-tool/install
76 $(INSTALL_DIR) $(1)/sbin
77
78 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/snapshot_tool $(1)/sbin/
79 $(INSTALL_BIN) ./files/snapshot $(1)/sbin/
80 endef
81
82 define Package/block-mount/install
83 $(INSTALL_DIR) $(1)/sbin $(1)/lib $(1)/usr/sbin $(1)/etc/hotplug.d/block $(1)/etc/init.d/ $(1)/etc/uci-defaults/
84
85 $(INSTALL_BIN) ./files/fstab.init $(1)/etc/init.d/fstab
86 $(INSTALL_DATA) ./files/fstab.default $(1)/etc/uci-defaults/10-fstab
87 $(INSTALL_DATA) ./files/mount.hotplug $(1)/etc/hotplug.d/block/10-mount
88
89 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/block $(1)/sbin/
90 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libblkid-tiny.so $(1)/lib/
91 $(LN) ../../sbin/block $(1)/usr/sbin/swapon
92 $(LN) ../../sbin/block $(1)/usr/sbin/swapoff
93
94 endef
95
96 define Build/InstallDev
97 $(INSTALL_DIR) $(1)/usr/include
98 $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
99 $(INSTALL_DIR) $(1)/usr/lib/
100 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libubi-utils.a $(1)/usr/lib/
101 endef
102
103 $(eval $(call BuildPackage,fstools))
104 $(eval $(call BuildPackage,snapshot-tool))
105 $(eval $(call BuildPackage,block-mount))