Blame SOURCES/0042-ppc64le-sync-grub.cfg-changes-to-disk-1212114.patch

56d25d
From 8f0ef3e08aaef134ec4acfe87a6628b3fda2243c Mon Sep 17 00:00:00 2001
56d25d
From: Don Zickus <dzickus@redhat.com>
56d25d
Date: Wed, 22 Jul 2015 13:58:53 -0400
56d25d
Subject: [PATCH] ppc64le sync grub.cfg changes to disk (#1212114)
56d25d
56d25d
After installing a new kernel, if a panic is induced, not all the kernel
56d25d
pieces are on the disk (most importantly the grub.cfg changes).  This can
56d25d
lead to a hung system on a reboot because the older kernel can not be found.
56d25d
56d25d
Address this by forcing all the changes (mainly the fs meta data) to disk
56d25d
before finishing the kernel package installation.
56d25d
56d25d
Tested by 'yum install kernel-...; echo c > /proc/sysrq-trigger'.
56d25d
56d25d
Before, the machine would panic and on reboot be stuck without a grub.cfg
56d25d
to read.  After, works as expected.
56d25d
56d25d
Related: rhbz#1212114
56d25d
---
56d25d
 new-kernel-pkg | 8 ++++++++
56d25d
 1 file changed, 8 insertions(+)
56d25d
56d25d
diff --git a/new-kernel-pkg b/new-kernel-pkg
56d25d
index 1f6ab39..90652da 100755
56d25d
--- a/new-kernel-pkg
56d25d
+++ b/new-kernel-pkg
56d25d
@@ -927,4 +927,12 @@ fi
56d25d
 # if we mounted the U-Boot directory, unmount it.
56d25d
 [ -n "$mounted" ] && umount $ubootDir
56d25d
 
56d25d
+# make sure changes make it to the disk.
56d25d
+# if /boot is a mountpoint, force the meta data on disk
56d25d
+# to by-pass writeback delay.
56d25d
+# PPC64LE-only to deal with Petitboot issues
56d25d
+if [ "$ARCH" = "ppc64le" ]; then
56d25d
+    sync && mountpoint -q /boot &&fsfreeze -f /boot && fsfreeze -u /boot
56d25d
+fi
56d25d
+
56d25d
 exit 0
56d25d
-- 
56d25d
1.8.3.1
56d25d