fstools: update to the latest version, fixes sysupgrade on linux 3.18
[openwrt.git] / package / system / fstools / Makefile
1 #
2 # Copyright (C) 2014 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:=2014-12-01
12
13 PKG_RELEASE=$(PKG_SOURCE_VERSION)
14
15 PKG_SOURCE_PROTO:=git
16 PKG_SOURCE_URL:=git://nbd.name/fstools.git
17 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
18 PKG_SOURCE_VERSION:=e65232440111b8f6654218033431e5bdd20525c2
19 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
20 CMAKE_INSTALL:=1
21 PKG_CHECK_FORMAT_SECURITY:=0
22
23 PKG_LICENSE:=GPL-2.0
24 PKG_LICENSE_FILES:=
25
26 PKG_USE_MIPS16:=0
27
28 PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
29
30 include $(INCLUDE_DIR)/package.mk
31 include $(INCLUDE_DIR)/cmake.mk
32
33 TARGET_LDFLAGS += $(if $(CONFIG_USE_EGLIBC),-lrt)
34
35 define Package/fstools
36   SECTION:=base
37   CATEGORY:=Base system
38   DEPENDS:=+ubox +USE_EGLIBC:librt +NAND_SUPPORT:ubi-utils
39   TITLE:=OpenWrt filesystem tools
40 endef
41
42 define Package/block-mount
43   SECTION:=base
44   CATEGORY:=Base system
45   TITLE:=Block device mounting and checking
46   DEPENDS:=+ubox +libubox +libuci
47 endef
48
49 define Package/fstools/install
50         $(INSTALL_DIR) $(1)/sbin $(1)/lib
51
52         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{mount_root,jffs2reset,snapshot_tool} $(1)/sbin/
53         $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libfstools.so $(1)/lib/
54         $(INSTALL_BIN) ./files/snapshot $(1)/sbin/
55         ln -s /sbin/jffs2reset $(1)/sbin/jffs2mark
56 endef
57
58 define Package/block-mount/install
59         $(INSTALL_DIR) $(1)/sbin $(1)/lib $(1)/usr/sbin $(1)/etc/hotplug.d/block $(1)/etc/init.d/ $(1)/etc/uci-defaults/
60
61         $(INSTALL_BIN) ./files/fstab.init $(1)/etc/init.d/fstab
62         $(INSTALL_DATA) ./files/fstab.default $(1)/etc/uci-defaults/10-fstab
63         $(INSTALL_DATA) ./files/mount.hotplug $(1)/etc/hotplug.d/block/10-mount
64
65         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/block $(1)/sbin/
66         $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libblkid-tiny.so $(1)/lib/
67         ln -s /sbin/block $(1)/usr/sbin/swapon
68         ln -s /sbin/block $(1)/usr/sbin/swapoff
69
70 endef
71
72 define Build/InstallDev
73         $(INSTALL_DIR) $(1)/usr/include
74         $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
75         $(INSTALL_DIR) $(1)/usr/lib/
76         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libubi-utils.a $(1)/usr/lib/
77 endef
78
79 $(eval $(call BuildPackage,fstools))
80 $(eval $(call BuildPackage,block-mount))