1 Star 0 Fork 11

杰诺斯/grubby

forked from src-anolis-os/grubby 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0032-Track-configuration-modifications.patch 1.33 KB
一键复制 编辑 原始数据 按行查看 历史
张彬琛 提交于 2021-01-20 13:34 . import grubby-8.40-38.el8.src.rpm
From 12ae8096bd3099b81fded8c30be1a8050ed7e68c Mon Sep 17 00:00:00 2001
From: Robert Marshall <rmarshall@redhat.com>
Date: Thu, 8 Dec 2016 16:52:45 -0500
Subject: [PATCH 32/55] Track configuration modifications
The setDefaultImage function had a subtle dependency on being run before
addNewKernel is invoked. Added the ability to track invocation to
prevent them from being so tightly coupled.
Related: rhbz#1285601
---
grubby.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/grubby.c b/grubby.c
index a717c18999b..1f712ec1391 100644
--- a/grubby.c
+++ b/grubby.c
@@ -678,6 +678,8 @@ struct grubConfig {
int fallbackImage; /* just like defaultImage */
int flags;
struct configFileInfo *cfi;
+ int isModified; /* assumes only one entry added
+ per invocation of grubby */
};
blkid_cache blkid;
@@ -1297,6 +1299,7 @@ static struct grubConfig *readConfig(const char *inName,
cfg->theLines = NULL;
cfg->entries = NULL;
cfg->fallbackImage = 0;
+ cfg->isModified = 0;
/* copy everything we have */
while (*head) {
@@ -4726,8 +4729,10 @@ int addNewKernel(struct grubConfig *config, struct singleEntry *template,
}
if (updateImage(config, indexs, prefix, newKernelArgs, NULL,
- newMBKernelArgs, NULL))
+ newMBKernelArgs, NULL)) {
+ config->isModified = 1;
return 1;
+ }
return 0;
}
--
2.17.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ywyw22/grubby.git
git@gitee.com:ywyw22/grubby.git
ywyw22
grubby
grubby
a8

搜索帮助