aboutsummaryrefslogtreecommitdiffstats
path: root/deploy/adapters/cobbler/snippets/post_s390_reboot
diff options
context:
space:
mode:
authorbaigk <baiguoku@huawei.com>2015-08-04 22:21:43 -0400
committerbaigk <baiguoku@huawei.com>2015-08-05 01:01:22 -0400
commitd05b5f04c92034eae1675dc8102247a3cc3315f7 (patch)
tree9721a1cfddc4b234ff302922da01cc3da0eb0fb9 /deploy/adapters/cobbler/snippets/post_s390_reboot
parent79b571dae951ba9bfe36440750c1a1408b19cd69 (diff)
delete the windows newline character
JIRA: COMPASS-7 Change-Id: Iffd549877b8cc50a995bdc59adf1f05c0fcb1d5e Signed-off-by: baigk <baiguoku@huawei.com>
Diffstat (limited to 'deploy/adapters/cobbler/snippets/post_s390_reboot')
-rw-r--r--deploy/adapters/cobbler/snippets/post_s390_reboot134
1 files changed, 67 insertions, 67 deletions
diff --git a/deploy/adapters/cobbler/snippets/post_s390_reboot b/deploy/adapters/cobbler/snippets/post_s390_reboot
index be99664f..fa33f06c 100644
--- a/deploy/adapters/cobbler/snippets/post_s390_reboot
+++ b/deploy/adapters/cobbler/snippets/post_s390_reboot
@@ -1,67 +1,67 @@
-## RHEL zVM installs do not properly reboot into the installed system. This
-## issue has been resolved in RHEL-5 Update3. To get a consistent reboot
-## behavior for s390* installs on all distros, this snippet can be used. The
-## snippet will attempt to discover the IPL volume zipl is being installed
-## to and will attempt a reipl. Be sure to set this snippet as the *last*
-## snippet your kickstart template.
-
-#if $arch.startswith("s390"):
-%post --nochroot
-
-# Does the kickstart file request a reboot?
-grep -q "^reboot" /tmp/ks.cfg /ks.cfg 2>/dev/null
-if [ \$? -ne 0 ]; then
- exit 0
-fi
-
-# find out the location of /boot and use it to re-ipl
-boot_dev=""
-for mountpt in /mnt/sysimage/boot /mnt/sysimage;
-do
- set -- \$(grep " \$mountpt " /proc/mounts)
- if [ -b "\$1" ]; then
- boot_dev=\$1
- break
- fi
-done
-
-# lookup dasd disk
-if [[ \$boot_dev == *dasd* ]]; then
- # remove the '/dev/' (aka basename)
- boot_dev=\${boot_dev\#\#/[^/]*/}
- # strip partition number from dasd device
- boot_dev=\${boot_dev%%[0-9]}
- type="ccw"
- id=`basename \$(readlink /sys/block/\$boot_dev/device)`
-
- # HACK - In RHEL4 and RHEL3 ... we do it the hard way
- grep -q "^[34]\$" /.buildstamp 2>/dev/null
- if [ \$? -eq 0 ]; then
- cat <<EOF> /mnt/sysimage/tmp/zeboot.sh
-\#!/bin/bash
-/sbin/modprobe -r vmcp
-rm -f "/dev/vmcp"
-sleep 2
-[ -b "/dev/vmcp" ] || /bin/mknod /dev/vmcp c 10 61
-/sbin/modprobe -a vmcp
-sync
-# Force a boot (e.g. IPL 0100)
-/sbin/vmcp ipl \${id\#\#*.}
-EOF
- /bin/chmod +x /mnt/sysimage/tmp/zeboot.sh
- /bin/chroot /mnt/sysimage /tmp/zeboot.sh
- # In RHEL5 ... lets cleanly shutdown (Update 3 and newer)
- else
- echo \$type > /sys/firmware/reipl/reipl_type
- echo \$id > /sys/firmware/reipl/\$type/device
-
- # Force a reboot
- pid=\$(cat /var/run/init.pid)
- [ -z "\$pid" ] && pid=\$(pidof init)
- kill -12 \$pid
- pid=\$(cat /var/run/loader.run)
- [ -z "\$pid" ] && pid=\$(pidof loader)
- kill \$pid
- fi
-fi
-#end if
+## RHEL zVM installs do not properly reboot into the installed system. This
+## issue has been resolved in RHEL-5 Update3. To get a consistent reboot
+## behavior for s390* installs on all distros, this snippet can be used. The
+## snippet will attempt to discover the IPL volume zipl is being installed
+## to and will attempt a reipl. Be sure to set this snippet as the *last*
+## snippet your kickstart template.
+
+#if $arch.startswith("s390"):
+%post --nochroot
+
+# Does the kickstart file request a reboot?
+grep -q "^reboot" /tmp/ks.cfg /ks.cfg 2>/dev/null
+if [ \$? -ne 0 ]; then
+ exit 0
+fi
+
+# find out the location of /boot and use it to re-ipl
+boot_dev=""
+for mountpt in /mnt/sysimage/boot /mnt/sysimage;
+do
+ set -- \$(grep " \$mountpt " /proc/mounts)
+ if [ -b "\$1" ]; then
+ boot_dev=\$1
+ break
+ fi
+done
+
+# lookup dasd disk
+if [[ \$boot_dev == *dasd* ]]; then
+ # remove the '/dev/' (aka basename)
+ boot_dev=\${boot_dev\#\#/[^/]*/}
+ # strip partition number from dasd device
+ boot_dev=\${boot_dev%%[0-9]}
+ type="ccw"
+ id=`basename \$(readlink /sys/block/\$boot_dev/device)`
+
+ # HACK - In RHEL4 and RHEL3 ... we do it the hard way
+ grep -q "^[34]\$" /.buildstamp 2>/dev/null
+ if [ \$? -eq 0 ]; then
+ cat <<EOF> /mnt/sysimage/tmp/zeboot.sh
+\#!/bin/bash
+/sbin/modprobe -r vmcp
+rm -f "/dev/vmcp"
+sleep 2
+[ -b "/dev/vmcp" ] || /bin/mknod /dev/vmcp c 10 61
+/sbin/modprobe -a vmcp
+sync
+# Force a boot (e.g. IPL 0100)
+/sbin/vmcp ipl \${id\#\#*.}
+EOF
+ /bin/chmod +x /mnt/sysimage/tmp/zeboot.sh
+ /bin/chroot /mnt/sysimage /tmp/zeboot.sh
+ # In RHEL5 ... lets cleanly shutdown (Update 3 and newer)
+ else
+ echo \$type > /sys/firmware/reipl/reipl_type
+ echo \$id > /sys/firmware/reipl/\$type/device
+
+ # Force a reboot
+ pid=\$(cat /var/run/init.pid)
+ [ -z "\$pid" ] && pid=\$(pidof init)
+ kill -12 \$pid
+ pid=\$(cat /var/run/loader.run)
+ [ -z "\$pid" ] && pid=\$(pidof loader)
+ kill \$pid
+ fi
+fi
+#end if