]> git.ipfire.org Git - thirdparty/dracut.git/blame - modules.d/95cifs/cifsroot.sh
chore: remove unnecessary shellcheck disable for SC2154
[thirdparty/dracut.git] / modules.d / 95cifs / cifsroot.sh
CommitLineData
d580636e 1#!/bin/sh
d580636e 2
9a52c3fd 3type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
d580636e
MG
4. /lib/cifs-lib.sh
5
6[ "$#" = 3 ] || exit 1
7
8# root is in the form root=cifs://user:pass@[server]/[folder] either from
9# cmdline or dhcp root-path
760a4370 10#netif="$1"
d580636e
MG
11root="$2"
12NEWROOT="$3"
13
760a4370 14cifs_to_var "$root"
d580636e 15
9a52c3fd 16mount.cifs "//$server/$path" "$NEWROOT" -o "$options" && { [ -e /dev/root ] || ln -s null /dev/root; }
d580636e
MG
17
18# inject new exit_if_exists
760a4370 19# shellcheck disable=SC2016
760a4370 20echo 'settle_exit_if_exists="--exit-if-exists=/dev/root"; rm -f -- "$job"' > "$hookdir"/initqueue/cifs.sh
d580636e 21# force udevsettle to break
760a4370 22: > "$hookdir"/initqueue/work