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