From cbdcc22cccde436452f84b20ebe7bf49f0f87fb1 Mon Sep 17 00:00:00 2001 From: David Cantrell Date: Mar 08 2011 19:00:52 +0000 Subject: Handle boot loader upgrades on s390 (#682783) 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. --- diff --git a/pyanaconda/booty/checkbootloader.py b/pyanaconda/booty/checkbootloader.py index 182e6c1..3cf8dc3 100644 --- a/pyanaconda/booty/checkbootloader.py +++ b/pyanaconda/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 getBootBlock(bootDev, instRoot, seekBlocks=0): """Get the boot block from bootDev. Return a 512 byte string.""" @@ -65,6 +66,7 @@ def getBootloaderTypeAndBoot(instRoot, storage): haveLiloConf = 1 haveYabootConf = 1 haveSiloConf = 1 + haveZiplConf = 1 bootDev = None @@ -78,6 +80,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 @@ -158,4 +162,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/pyanaconda/iutil.py b/pyanaconda/iutil.py index fc751b5..6495993 100644 --- a/pyanaconda/iutil.py +++ b/pyanaconda/iutil.py @@ -844,6 +844,7 @@ def reIPL(anaconda, loader_pid): stdout = "/dev/tty5", stderr = "/dev/tty5") except RuntimeError as e: + rc = True log.info("Unable to set reIPL device to %s: %s", ipldev, e) diff --git a/pyanaconda/upgrade.py b/pyanaconda/upgrade.py index 2402365..b3560dd 100644 --- a/pyanaconda/upgrade.py +++ b/pyanaconda/upgrade.py @@ -345,7 +345,7 @@ def setSteps(anaconda): "complete" ) - if not iutil.isX86(): + if not iutil.isX86() and not iutil.isS390(): dispatch.skipStep("bootloader") if not iutil.isX86():