[rhel7-branch 2/2] Don't set net.device to link if there is no ksdevice (#1085310)

bcl installerbot-noreply at redhat.com
Fri Aug 14 18:50:43 UTC 2015


From: "Brian C. Lane" <bcl at redhat.com>

If the kickstart was from local media and no link is up setting it to
link will always fail to bring up the network. Instead leave net.device
as None and ksnet_to_dracut will do the right thing to bring up the
network.

Resolves: rhbz#1085310
---
 dracut/parse-kickstart | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/dracut/parse-kickstart b/dracut/parse-kickstart
index 33eef25..f652f9e 100755
--- a/dracut/parse-kickstart
+++ b/dracut/parse-kickstart
@@ -176,12 +176,13 @@ class Network(commands.network.RHEL7_Network, DracutArgsMixin):
         # first 'network' line
         if len(self.network) == 1:
             net.activate = True
+            # Note that there may be no net.device and no ksdevice if inst.ks=file:/ks.cfg
+            # If that is the case, fall into ksnet_to_dracut with net.device=None and let
+            # it handle things.
             if not net.device:
                 if self.handler.ksdevice:
                     net.device = self.handler.ksdevice
                     log.info("Using ksdevice %s for missing --device in first kickstart network command", self.handler.ksdevice)
-                else:
-                    net.device = "link"
             if net.device == "link":
                 net.device = first_device_with_link()
                 if not net.device:


-- 
To view this commit on github, visit https://github.com/rhinstaller/anaconda/commit/09ae3c3285cffad052cca4ee4bbde372a97534a8


More information about the anaconda-patches mailing list