fstools: switch to ulog api
[openwrt/svn-archive/archive.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:=2015-02-26
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:=1c1bfa053103f7783167d2ab272fb11331f87681
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 CMAKE_OPTIONS += $(if $(CONFIG_FSTOOLS_UBIFS_EXTROOT),-DCMAKE_UBIFS_EXTROOT=y)
35
36 define Package/fstools
37 SECTION:=base
38 CATEGORY:=Base system
39 DEPENDS:=+ubox +USE_EGLIBC:librt +NAND_SUPPORT:ubi-utils
40 TITLE:=OpenWrt filesystem tools
41 MENU:=1
42 endef
43
44 define Package/fstools/config
45 config FSTOOLS_UBIFS_EXTROOT
46 depends on PACKAGE_fstools
47 depends on NAND_SUPPORT
48 bool "Support extroot functionality with UBIFS"
49 default y
50 help
51 This option makes it possible to use extroot functionality if the root filesystem resides on an UBIFS partition
52 endef
53
54 define Package/block-mount
55 SECTION:=base
56 CATEGORY:=Base system
57 TITLE:=Block device mounting and checking
58 DEPENDS:=+ubox +libubox +libuci
59 endef
60
61 define Package/fstools/install
62 $(INSTALL_DIR) $(1)/sbin $(1)/lib
63
64 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{mount_root,jffs2reset,snapshot_tool} $(1)/sbin/
65 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libfstools.so $(1)/lib/
66 $(INSTALL_BIN) ./files/snapshot $(1)/sbin/
67 ln -s /sbin/jffs2reset $(1)/sbin/jffs2mark
68 endef
69
70 define Package/block-mount/install
71 $(INSTALL_DIR) $(1)/sbin $(1)/lib $(1)/usr/sbin $(1)/etc/hotplug.d/block $(1)/etc/init.d/ $(1)/etc/uci-defaults/
72
73 $(INSTALL_BIN) ./files/fstab.init $(1)/etc/init.d/fstab
74 $(INSTALL_DATA) ./files/fstab.default $(1)/etc/uci-defaults/10-fstab
75 $(INSTALL_DATA) ./files/mount.hotplug $(1)/etc/hotplug.d/block/10-mount
76
77 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/block $(1)/sbin/
78 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libblkid-tiny.so $(1)/lib/
79 ln -s /sbin/block $(1)/usr/sbin/swapon
80 ln -s /sbin/block $(1)/usr/sbin/swapoff
81
82 endef
83
84 define Build/InstallDev
85 $(INSTALL_DIR) $(1)/usr/include
86 $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
87 $(INSTALL_DIR) $(1)/usr/lib/
88 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libubi-utils.a $(1)/usr/lib/
89 endef
90
91 $(eval $(call BuildPackage,fstools))
92 $(eval $(call BuildPackage,block-mount))