summaryrefslogtreecommitdiffstats
path: root/modules.d/95cifs/cifsroot.sh
blob: 83539d40da9c975b26f1fdc83b23c21d072b6beb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh

type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
. /lib/cifs-lib.sh

[ "$#" = 3 ] || exit 1

# root is in the form root=cifs://user:pass@[server]/[folder] either from
# cmdline or dhcp root-path
#netif="$1"
root="$2"
NEWROOT="$3"

cifs_to_var "$root"

mount.cifs "//$server/$path" "$NEWROOT" -o "$options" && { [ -e /dev/root ] || ln -s null /dev/root; }

# inject new exit_if_exists
# shellcheck disable=SC2016
echo 'settle_exit_if_exists="--exit-if-exists=/dev/root"; rm -f -- "$job"' > "$hookdir"/initqueue/cifs.sh
# force udevsettle to break
: > "$hookdir"/initqueue/work