]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
network: if rd.neednet=0 we don't need a bootdev
authorHarald Hoyer <harald@redhat.com>
Tue, 26 Jan 2016 11:26:03 +0000 (12:26 +0100)
committerHarald Hoyer <harald@redhat.com>
Tue, 26 Jan 2016 11:26:03 +0000 (12:26 +0100)
otherwise dracut would wait for the bootdev interface to appear and be
setup

modules.d/40network/parse-ip-opts.sh

index 12f476598c1fc9869fd99ea2921d7df296b672ad..5779ef88db29589ff140fd4690ffdf172a4b4b94 100755 (executable)
@@ -40,6 +40,8 @@ if [ -n "$NEEDBOOTDEV" ] && getargbool 1 rd.neednet; then
     #[ -z "$BOOTDEV" ] && warn "Please supply bootdev argument for multiple ip= lines"
     echo "rd.neednet=1" > /etc/cmdline.d/dracut-neednet.conf
     info "Multiple ip= arguments: assuming rd.neednet=1"
+else
+    unset NEEDBOOTDEV
 fi
 
 # Check ip= lines
@@ -48,17 +50,14 @@ for p in $(getargs ip=); do
     ip_to_var $p
 
     # make first device specified the BOOTDEV
-    if [ -z "$BOOTDEV" ] && [ -n "$dev" ]; then
+    if [ -n "$NEEDBOOTDEV" ] && [ -z "$BOOTDEV" ] && [ -n "$dev" ]; then
         BOOTDEV="$dev"
-        [ -n "$NEEDBOOTDEV" ] && info "Setting bootdev to '$BOOTDEV'"
+        info "Setting bootdev to '$BOOTDEV'"
     fi
 
     # skip ibft since we did it above
     [ "$autoconf" = "ibft" ] && continue
 
-    # We need to have an ip= line for the specified bootdev
-    [ -n "$NEEDBOOTDEV" ] && [ "$dev" = "$BOOTDEV" ] && BOOTDEVOK=1
-
     # Empty autoconf defaults to 'dhcp'
     if [ -z "$autoconf" ] ; then
         warn "Empty autoconf values default to dhcp"