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

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