fstools: scripts should propagate the cmdline
[openwrt/svn-archive/archive.git] / package / system / fstools / Makefile
1 include $(TOPDIR)/rules.mk
2
3 PKG_NAME:=fstools
4 PKG_VERSION:=2014-04-01
5
6 PKG_RELEASE=$(PKG_SOURCE_VERSION)
7
8 PKG_SOURCE_PROTO:=git
9 PKG_SOURCE_URL:=git://nbd.name/fstools.git
10 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
11 PKG_SOURCE_VERSION:=4e3268f90ae97ccb047c47a78b83bcebeb9593cd
12 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
13 CMAKE_INSTALL:=1
14
15 PKG_LICENSE:=GPLv2
16 PKG_LICENSE_FILES:=
17
18 PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
19
20 include $(INCLUDE_DIR)/package.mk
21 include $(INCLUDE_DIR)/cmake.mk
22
23 TARGET_LDFLAGS += $(if $(CONFIG_USE_EGLIBC),-lrt)
24
25 define Package/fstools
26 SECTION:=base
27 CATEGORY:=Base system
28 DEPENDS:=+ubox +USE_EGLIBC:librt
29 TITLE:=OpenWrt filesystem tools
30 endef
31
32 define Package/block-mount
33 SECTION:=base
34 CATEGORY:=Base system
35 TITLE:=Block device mounting and checking
36 DEPENDS:=+ubox +libubox +libuci
37 endef
38
39 define Package/fstools/install
40 $(INSTALL_DIR) $(1)/sbin
41
42 $(INSTALL_BIN) ./files/{jffs2reset,jffs2mark,mount_root} $(1)/sbin/
43 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/fs-state $(1)/sbin/
44 $(INSTALL_BIN) ./files/snapshot $(1)/sbin/
45 endef
46
47 define Package/block-mount/install
48 $(INSTALL_DIR) $(1)/sbin $(1)/usr/sbin $(1)/etc/hotplug.d/block $(1)/etc/init.d/ $(1)/etc/uci-defaults/
49
50 $(INSTALL_BIN) ./files/fstab.init $(1)/etc/init.d/fstab
51 $(INSTALL_DATA) ./files/fstab.default $(1)/etc/uci-defaults/10-fstab
52 $(INSTALL_DATA) ./files/mount.hotplug $(1)/etc/hotplug.d/block/10-mount
53
54 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/block $(1)/sbin/
55 ln -s /sbin/block $(1)/usr/sbin/swapon
56 ln -s /sbin/block $(1)/usr/sbin/swapoff
57
58 endef
59
60 $(eval $(call BuildPackage,fstools))
61 $(eval $(call BuildPackage,block-mount))