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