Browse Source

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 <daniel@makrotopia.org>
lilik-openwrt-22.03
Daniel Golle 2 years ago
parent
commit
6772c0fe44
No known key found for this signature in database GPG Key ID: 5A8F39C31C3217CA
3 changed files with 5 additions and 4 deletions
  1. +2
    -2
      utils/uvol/files/common.sh
  2. +2
    -0
      utils/uvol/files/uvol.defaults
  3. +1
    -2
      utils/uvol/files/uvol.init

+ 2
- 2
utils/uvol/files/common.sh View File

@ -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


+ 2
- 0
utils/uvol/files/uvol.defaults View File

@ -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

+ 1
- 2
utils/uvol/files/uvol.init View File

@ -13,8 +13,7 @@ start_service() {
}
boot() {
__BOOT_UVOL=1
start
__BOOT_UVOL=1 start
}
service_triggers() {


Loading…
Cancel
Save