diff options
author | David Cantrell <dcantrell@redhat.com> | 2008-06-26 03:26:27 -1000 |
---|---|---|
committer | David Cantrell <dcantrell@redhat.com> | 2008-06-26 03:26:27 -1000 |
commit | 8fb9fc4b6b5b64cf5c8ec05df4c0b96a8cf12111 (patch) | |
tree | c548325f133f6e1e0fe788fde51aa3f76247314a | |
parent | 0d8c1954a947e6865b215249766f192234aeb32b (diff) | |
download | anaconda-8fb9fc4b6b5b64cf5c8ec05df4c0b96a8cf12111.tar.gz anaconda-8fb9fc4b6b5b64cf5c8ec05df4c0b96a8cf12111.tar.xz anaconda-8fb9fc4b6b5b64cf5c8ec05df4c0b96a8cf12111.zip |
Enable re-IPL on s390x after installation (#432416)
On s390x, to support rebooting the VM guest, we have to
write the device name and type to a special /sys path in
order to completely re-IPL the guest.
This is limited to guests booting from DASD. zFCP re-IPL
is not currently supported.
-rw-r--r-- | loader2/linuxrc.s390 | 30 | ||||
-rw-r--r-- | loader2/loader.c | 2 |
2 files changed, 28 insertions, 4 deletions
diff --git a/loader2/linuxrc.s390 b/loader2/linuxrc.s390 index 881f29ed7..95f0d0228 100644 --- a/loader2/linuxrc.s390 +++ b/loader2/linuxrc.s390 @@ -67,8 +67,32 @@ 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 () { @@ -606,7 +630,7 @@ if [ -n "$RUNKS" ]; then /sbin/loader fi -doshutdown +doreboot # ;;; Local Variables: *** # ;;; mode: sh *** diff --git a/loader2/loader.c b/loader2/loader.c index 905177e1c..84e189759 100644 --- a/loader2/loader.c +++ b/loader2/loader.c @@ -1883,7 +1883,7 @@ int main(int argc, char ** argv) { ret = fgets(buf, 256, f); pid = atoi(buf); } - kill(pid, SIGUSR1); + kill(pid, SIGUSR2); #endif stop_fw_loader(&loaderData); return rc; |