diff options
author | Karel Kočí <cynerd@email.cz> | 2020-08-12 16:19:39 +0200 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2020-08-12 16:19:39 +0200 |
commit | bf24e13ee81a77aa39e2af11f4a778c7bef39f0b (patch) | |
tree | fc0c00a1ba6f7c179999acdc6c325f3a0b9e4075 | |
parent | b2f7f1e3f09d532f55fc3e215a81cdd007b634dd (diff) | |
download | openwrt-personal-pkgs-bf24e13ee81a77aa39e2af11f4a778c7bef39f0b.tar.gz openwrt-personal-pkgs-bf24e13ee81a77aa39e2af11f4a778c7bef39f0b.tar.bz2 openwrt-personal-pkgs-bf24e13ee81a77aa39e2af11f4a778c7bef39f0b.zip |
mount-data: create package
-rw-r--r-- | mount-data/Makefile | 36 | ||||
-rwxr-xr-x | mount-data/files/init | 24 | ||||
-rw-r--r-- | updater.lua | 1 |
3 files changed, 61 insertions, 0 deletions
diff --git a/mount-data/Makefile b/mount-data/Makefile new file mode 100644 index 0000000..3af25b5 --- /dev/null +++ b/mount-data/Makefile @@ -0,0 +1,36 @@ +# +## Copyright (C) 2020 Karel Kočí +# +## This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# # +# +include $(TOPDIR)/rules.mk + +PKG_NAME:=mount-data +PKG_VERSION:=1.0.0 +PKG_MAINTAINER:=Karel Kočí <cynerd@email.cz> +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) + +include $(INCLUDE_DIR)/package.mk + +define Package/mount-data + TITLE:=Mount filesystem to /data directory +endef + +define Package/mount-data/install + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_DATA) ./files/init $(1)/etc/init.d/data +endef + +Build/Compile:=: + +define Package/mount-data/postinst +[ -n "$$IPKG_INSTROOT" ] || /etc/init.d/data enable +endef + +define Package/mount-data/prerm +[ -n "$$IPKG_INSTROOT" ] || /etc/init.d/data disable +endef + +$(eval $(call BuildPackage,mount-data)) diff --git a/mount-data/files/init b/mount-data/files/init new file mode 100755 index 0000000..d1362e2 --- /dev/null +++ b/mount-data/files/init @@ -0,0 +1,24 @@ +#!/bin/sh /etc/rc.common + +START=36 +STOP=90 + +status() { + findmnt >/dev/null /data +} + +start() { + status || mount -o subvol=@data UUID=7dc606e7-39e0-4320-9ff6-83a10f163e54 /data +} + +stop() { + umount -fl /data +} + +restart() { + : +} + +reload() { + : +} diff --git a/updater.lua b/updater.lua index e64908e..9811682 100644 --- a/updater.lua +++ b/updater.lua @@ -47,6 +47,7 @@ elseif hostname == "turris-home" then vpn = true sentinel = true Install("transmission-daemon-openssl") + Install("mount-data") elseif hostname:match("-home$") then tools = true elseif hostname:match("^work-") then |