[PATCH] Handle boot loader upgrades on s390 (#682783)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fix up the boot loader config reading and handling for upgrades on s390
so it works like x86 a little more.  We find an existing zipl
installation and ask the user what steps to take.  This results in the
boot loader configuration being updated correctly, reinstalled if
necessary, and the reIPL step succeeding.

Also fixed the missing 'rc' variable that was causing a traceback due to
the above code blocks missing.  So in instances where we cannot figure
out the boot loader configuration, do not traceback but just fall
through and complete the installation.  reIPL is extra stuff anyway.
---
 booty/checkbootloader.py |   15 +++++++++++++++
 iutil.py                 |    1 +
 upgrade.py               |    2 +-
 3 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/booty/checkbootloader.py b/booty/checkbootloader.py
index 1b1ca1d..d58df8e 100644
--- a/booty/checkbootloader.py
+++ b/booty/checkbootloader.py
@@ -25,6 +25,7 @@ grubConfigFile = "/etc/grub.conf"
 liloConfigFile = "/etc/lilo.conf"
 yabootConfigFile = "/etc/yaboot.conf"
 siloConfigFile = "/etc/silo.conf"
+ziplConfigFile = "/etc/zipl.conf"
 
 def getRaidDisks(raidDevice, storage, raidLevel=None, stripPart=1):
     rc = []
@@ -112,6 +113,7 @@ def getBootloaderTypeAndBoot(instRoot, storage):
     haveLiloConf = 1
     haveYabootConf = 1
     haveSiloConf = 1
+    haveZiplConf = 1
     
     bootDev = None
     
@@ -125,6 +127,8 @@ def getBootloaderTypeAndBoot(instRoot, storage):
         haveYabootConf = 0
     if not os.access(instRoot + siloConfigFile, os.R_OK):
         haveSiloConf = 0
+    if not os.access(instRoot + ziplConfigFile, os.R_OK):
+        haveZiplConf = 0
 
     if haveGrubConf:
         bootDev = None
@@ -204,4 +208,15 @@ def getBootloaderTypeAndBoot(instRoot, storage):
                 if block[24:28] == "SILO":
                     return ("SILO", bootDev)
 
+    if haveZiplConf:
+        bootDev = None
+        f = open(instRoot + ziplConfigFile, "r")
+        lines = f.readlines()
+        for line in lines:
+            if line[0:7] == "target=":
+                bootDev = getBootDevList(line)
+
+        if bootDev:
+            return ("ZIPL", bootDev)
+
     return (None, None)
diff --git a/iutil.py b/iutil.py
index f6f359f..ca20002 100644
--- a/iutil.py
+++ b/iutil.py
@@ -832,6 +832,7 @@ def reIPL(anaconda, loader_pid):
                               stdout = "/dev/tty5",
                               stderr = "/dev/tty5")
     except Exception, e:
+        rc = True
         log.info("Unable to set reIPL device to %s: %s",
                  ipldev, e.message)
 
diff --git a/upgrade.py b/upgrade.py
index 088dcdb..b9f77b3 100644
--- a/upgrade.py
+++ b/upgrade.py
@@ -295,7 +295,7 @@ def setSteps(anaconda):
                 "complete"
             )
 
-    if not iutil.isX86():
+    if not iutil.isX86() and not iutil.isS390():
         dispatch.skipStep("bootloader")
         dispatch.skipStep("upgbootloader")
 
-- 
1.7.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux