summaryrefslogtreecommitdiffstats
path: root/loader2/linuxrc.s390
diff options
context:
space:
mode:
authorDavid Cantrell <dcantrell@redhat.com>2007-11-05 11:16:23 -0500
committerDavid Cantrell <dcantrell@redhat.com>2007-11-05 11:20:18 -0500
commit1e60912f04cc8add2723c9b94f5195110971635f (patch)
treeca8c1f8b2581953528e433321c9e8dbec5cc3be6 /loader2/linuxrc.s390
parent3ece62c81763baddc3499d14d63c1323d9b71fea (diff)
downloadanaconda-1e60912f04cc8add2723c9b94f5195110971635f.tar.gz
anaconda-1e60912f04cc8add2723c9b94f5195110971635f.tar.xz
anaconda-1e60912f04cc8add2723c9b94f5195110971635f.zip
Set re-IPL device before reboot on s390x
At the end of installation, set the re-ipl device if the user installed to a DASD device. Determine where /boot lives and set the re-ipl device to that, then run shutdown -r. On s390x, this means that clicking the Reboot button at the end of installation means you will reboot the VM. It only works for DASD targets right now and not zFCP. Patch from Brad Hinson <bhinson AT redhat DOT com> and Jan Glauber <jang AT de DOT ibm DOT com>
Diffstat (limited to 'loader2/linuxrc.s390')
-rw-r--r--loader2/linuxrc.s39029
1 files changed, 26 insertions, 3 deletions
diff --git a/loader2/linuxrc.s390 b/loader2/linuxrc.s390
index 6cd93beca..65db702a8 100644
--- a/loader2/linuxrc.s390
+++ b/loader2/linuxrc.s390
@@ -46,8 +46,31 @@ doshutdown()
doreboot()
{
- exec /sbin/shutdown -r
- exit 0
+ # find out the location of /boot and use it to re-ipl
+ boot=`cat /proc/mounts | grep " /mnt/sysimage/boot " | awk -F" " '{print $1}'`
+ if [ -z $boot ]; then
+ # use root if /boot not used
+ boot=`cat /proc/mounts | grep " /mnt/sysimage " | awk -F" " '{print $1}'`
+ fi
+ # lookup dasd disk
+ echo $boot | grep "dasd" > /dev/null
+ if [ $? -eq 0 ]; then
+ type="ccw"
+ boot=`basename $boot`
+ # strip partition number from dasd device
+ boot=$(echo ${boot%[0-9]})
+ id=`basename $(readlink /sys/block/$boot/device)`
+ echo $type > /sys/firmware/reipl/reipl_type
+ echo $id > /sys/firmware/reipl/$type/device
+ else
+ # scsi re-ipl only supported on newer machines
+ doshutdown
+ exit 0
+ fi
+
+ echo $"about to exec shutdown -r"
+ exec /sbin/shutdown -r
+ exit 0
}
sysecho () {
@@ -582,7 +605,7 @@ if [ -n "$RUNKS" ]; then
/sbin/loader
fi
-doshutdown
+doreboot
# ;;; Local Variables: ***
# ;;; mode: sh ***