diff --git a/init.d/mount.in b/init.d/mount.in index f2fcd7539..a2805ebe0 100644 --- a/init.d/mount.in +++ b/init.d/mount.in @@ -103,8 +103,7 @@ generate() case "$fsopts" in *noauto*) ;; *) - local name="${fs#/}" - name="$(echo $name | sed 's#/#.#g')" + local name="$(_mountpoint_to_mountname $fs)" einfo ln -snf mount "${svcpath}/${name}" rc=$? [ $rc -ne 0 ] && break diff --git a/sh/functions.sh.in b/sh/functions.sh.in index e4e69eb7b..5d4b773fa 100644 --- a/sh/functions.sh.in +++ b/sh/functions.sh.in @@ -63,6 +63,11 @@ _sanitize_path() echo "$path" } +_mountpoint_to_mountname() +{ + echo ${*#/} | sed 's#/#.#g' +} + # Allow our scripts to support zsh if [ -n "$ZSH_VERSION" ]; then emulate sh diff --git a/sh/gendepends.sh.in b/sh/gendepends.sh.in index dfe7444b3..360a0688a 100644 --- a/sh/gendepends.sh.in +++ b/sh/gendepends.sh.in @@ -28,6 +28,19 @@ provide() { keyword() { [ -n "$*" ] && echo "$RC_SVCNAME keyword $*" >&3 } +path() { + # Resolve each entry into an ineed line on a mountpoint + [ -n "$*" ] || return + for PATHNAME in *; do + # We loop here because some systems (QNX) can have multiple fs's backing a mountpoint + # The sed line chops off the + df -P $PATHNAME | sed 1d | while read one two three four five six; do + # borrowed from mount's generate: should go somewhere higher up as a function + local name="$(_mountpoint_to_mountname $six)" + [ -n "$name" ] && echo "$RC_SVCNAME ineed mount.$name" >&3 + done + done # for PATHNAME +} depend() { : } diff --git a/sh/openrc-run.sh.in b/sh/openrc-run.sh.in index 33dc59c59..3b0c619d2 100644 --- a/sh/openrc-run.sh.in +++ b/sh/openrc-run.sh.in @@ -78,6 +78,9 @@ provide() { keyword() { [ -n "$*" ] && echo "keyword $*" } +path() { + [ -n "$*" ] && echo "path $*" +} # Describe the init script to the user describe() @@ -217,7 +220,7 @@ for _cmd; do break fi done - + # Load our script sourcex "$RC_SERVICE"