From 6772c0fe443fb78713074f333460cf40ce6d58ff Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Fri, 18 Feb 2022 03:05:25 +0000 Subject: [PATCH] uvol: clean up paths and fix delayed startup * Winchester discs can take a long time to spin up which results in blockd also taking a while to complete to start. * Make sure uvol only gets started once blockd is ready. * Clean up paths (use '/tmp/run/uvol' everywhere instead of relying on the '/var' -> '/tmp' symlink) * Create 'apk' folder when initializing .meta volume. Signed-off-by: Daniel Golle --- utils/uvol/files/common.sh | 4 ++-- utils/uvol/files/uvol.defaults | 2 ++ utils/uvol/files/uvol.init | 3 +-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/utils/uvol/files/common.sh b/utils/uvol/files/common.sh index 830647772..eee486c53 100644 --- a/utils/uvol/files/common.sh +++ b/utils/uvol/files/common.sh @@ -12,7 +12,7 @@ uvol_uci_add() { local devname="$2" local mode="$3" local autofs=0 - local target="/var/run/uvol/$volname" + local target="/tmp/run/uvol/$volname" local uuid uciname [ "$mode" = "ro" ] && autofs=1 @@ -24,7 +24,7 @@ uvol_uci_add() { case "$uciname" in "_meta") - target="/var/run/uvol/.meta" + target="/tmp/run/uvol/.meta" ;; "_"*) return 1 diff --git a/utils/uvol/files/uvol.defaults b/utils/uvol/files/uvol.defaults index e71135f7a..43c971154 100644 --- a/utils/uvol/files/uvol.defaults +++ b/utils/uvol/files/uvol.defaults @@ -12,6 +12,8 @@ uvol_init() { [ "$metasz" -gt "$freesz" ] && return uvol create .meta "$metasz" rw uvol up .meta + grep -q "uvol/.meta" /proc/mounts || return + mkdir -p "/var/run/uvol/.meta/apk" } uci -q get fstab.@uvol[0].initialized >/dev/null || uvol_init diff --git a/utils/uvol/files/uvol.init b/utils/uvol/files/uvol.init index 1f6e2aac0..98216214f 100644 --- a/utils/uvol/files/uvol.init +++ b/utils/uvol/files/uvol.init @@ -13,8 +13,7 @@ start_service() { } boot() { - __BOOT_UVOL=1 - start + __BOOT_UVOL=1 start } service_triggers() {