]> git.ipfire.org Git - thirdparty/dracut.git/blob - modules.d/95nfs/nfsroot.sh
TEST-30-ISCSI/test.sh: factor out client runs
[thirdparty/dracut.git] / modules.d / 95nfs / nfsroot.sh
1 #!/bin/sh
2 # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
3 # ex: ts=8 sw=4 sts=4 et filetype=sh
4
5 type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
6 . /lib/nfs-lib.sh
7
8 [ "$#" = 3 ] || exit 1
9
10 # root is in the form root=nfs[4]:[server:]path[:options], either from
11 # cmdline or dhcp root-path
12 netif="$1"
13 root="$2"
14 NEWROOT="$3"
15
16 nfs_to_var $root $netif
17 [ -z "$server" ] && die "Required parameter 'server' is missing"
18
19 mount_nfs $root $NEWROOT $netif && { [ -e /dev/root ] || >/dev/root ; }
20
21 # inject new exit_if_exists
22 echo 'settle_exit_if_exists="--exit-if-exists=/dev/root"; rm "$job"' > $hookdir/initqueue/nfs.sh
23 # force udevsettle to break
24 > $hookdir/initqueue/work
25
26 need_shutdown