加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0012-ppc64le-sync-grub.cfg-changes-to-disk-1212114.patch 1.36 KB
一键复制 编辑 原始数据 按行查看 历史
张彬琛 提交于 2021-01-20 13:34 . import grubby-8.40-38.el8.src.rpm
From 3a0171fd435765161406238c8df6f66e859ddd93 Mon Sep 17 00:00:00 2001
From: Don Zickus <dzickus@redhat.com>
Date: Wed, 22 Jul 2015 13:58:53 -0400
Subject: [PATCH 12/55] ppc64le sync grub.cfg changes to disk (#1212114)
After installing a new kernel, if a panic is induced, not all the kernel
pieces are on the disk (most importantly the grub.cfg changes). This can
lead to a hung system on a reboot because the older kernel can not be found.
Address this by forcing all the changes (mainly the fs meta data) to disk
before finishing the kernel package installation.
Tested by 'yum install kernel-...; echo c > /proc/sysrq-trigger'.
Before, the machine would panic and on reboot be stuck without a grub.cfg
to read. After, works as expected.
Resolves: rhbz#1212114
---
new-kernel-pkg | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/new-kernel-pkg b/new-kernel-pkg
index 1f6ab39499f..90652da06b7 100755
--- a/new-kernel-pkg
+++ b/new-kernel-pkg
@@ -927,4 +927,12 @@ fi
# if we mounted the U-Boot directory, unmount it.
[ -n "$mounted" ] && umount $ubootDir
+# make sure changes make it to the disk.
+# if /boot is a mountpoint, force the meta data on disk
+# to by-pass writeback delay.
+# PPC64LE-only to deal with Petitboot issues
+if [ "$ARCH" = "ppc64le" ]; then
+ sync && mountpoint -q /boot &&fsfreeze -f /boot && fsfreeze -u /boot
+fi
+
exit 0
--
2.17.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化