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>
This commit is contained in:
parent
ce5755cc0b
commit
6772c0fe44
3 changed files with 5 additions and 4 deletions
|
@ -12,7 +12,7 @@ uvol_uci_add() {
|
||||||
local devname="$2"
|
local devname="$2"
|
||||||
local mode="$3"
|
local mode="$3"
|
||||||
local autofs=0
|
local autofs=0
|
||||||
local target="/var/run/uvol/$volname"
|
local target="/tmp/run/uvol/$volname"
|
||||||
local uuid uciname
|
local uuid uciname
|
||||||
|
|
||||||
[ "$mode" = "ro" ] && autofs=1
|
[ "$mode" = "ro" ] && autofs=1
|
||||||
|
@ -24,7 +24,7 @@ uvol_uci_add() {
|
||||||
|
|
||||||
case "$uciname" in
|
case "$uciname" in
|
||||||
"_meta")
|
"_meta")
|
||||||
target="/var/run/uvol/.meta"
|
target="/tmp/run/uvol/.meta"
|
||||||
;;
|
;;
|
||||||
"_"*)
|
"_"*)
|
||||||
return 1
|
return 1
|
||||||
|
|
|
@ -12,6 +12,8 @@ uvol_init() {
|
||||||
[ "$metasz" -gt "$freesz" ] && return
|
[ "$metasz" -gt "$freesz" ] && return
|
||||||
uvol create .meta "$metasz" rw
|
uvol create .meta "$metasz" rw
|
||||||
uvol up .meta
|
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
|
uci -q get fstab.@uvol[0].initialized >/dev/null || uvol_init
|
||||||
|
|
|
@ -13,8 +13,7 @@ start_service() {
|
||||||
}
|
}
|
||||||
|
|
||||||
boot() {
|
boot() {
|
||||||
__BOOT_UVOL=1
|
__BOOT_UVOL=1 start
|
||||||
start
|
|
||||||
}
|
}
|
||||||
|
|
||||||
service_triggers() {
|
service_triggers() {
|
||||||
|
|
Loading…
Reference in a new issue