network: don't use "ifup -m"
[dracut.git] / modules.d / 95cifs / parse-cifsroot.sh
blob977255785efead329f04f8b2a042ed43a6d9cd48
1 #!/bin/sh
3 # root=cifs://[user:pass@]<server>/<folder>
5 # This syntax can come from DHCP root-path as well.
7 # If a username or password are not specified as part of the root, then they
8 # will be pulled from cifsuser and cifspass on the kernel command line,
9 # respectively.
12 type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
13 . /lib/cifs-lib.sh
15 # This script is sourced, so root should be set. But let's be paranoid
16 [ -z "$root" ] && root=$(getarg root=)
18 if [ -z "$netroot" ]; then
19 for netroot in $(getargs netroot=); do
20 [ "${netroot%%:*}" = "cifs" ] && break
21 done
22 [ "${netroot%%:*}" = "cifs" ] || unset netroot
25 # Root takes precedence over netroot
26 if [ "${root%%:*}" = "cifs" ] ; then
27 if [ -n "$netroot" ] ; then
28 warn "root takes precedence over netroot. Ignoring netroot"
30 netroot=$root
31 unset root
34 # If it's not cifs we don't continue
35 [ "${netroot%%:*}" = "cifs" ] || return
37 # Check required arguments
38 cifs_to_var $netroot
40 # If we don't have a server, we need dhcp
41 if [ -z "$server" ] ; then
42 DHCPORSERVER="1"
43 fi;
45 # Done, all good!
46 rootok=1
48 echo '[ -e $NEWROOT/proc ]' > $hookdir/initqueue/finished/cifsroot.sh