1 Star 0 Fork 97

王策/anaconda

forked from src-openEuler/anaconda 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
bugfix-Only-pass-one-initrd-image-to-kexec.patch 1.42 KB
一键复制 编辑 原始数据 按行查看 历史
xuxiaolong 提交于 2021-04-02 10:25 . sync 49 fixbug from github
From 4766a00a9d67bfe93573e1160ac05fe9c8883aa9 Mon Sep 17 00:00:00 2001
From: Javier Martinez Canillas <javierm@redhat.com>
Date: Thu, 9 Jul 2020 15:51:23 +0200
Subject: [PATCH] Only pass one initrd image to kexec
The kexec command line tool can only get a single initrd, but a boot entry
can have multiple ones. For example the tuned package adds a variable that
could be set to a second initrd image.
If that's the case, it will lead to the following error:
FileNotFoundError: [Errno 2] No such file or directory:
'/mnt/sysroot/boot/initramfs-4.18.0-223.el8.x86_64.img $tuned_initrd'
Resolves: rhbz#1855290
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
---
pyanaconda/kexec.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/pyanaconda/kexec.py b/pyanaconda/kexec.py
index 02033bb7e..37d2b4a14 100644
--- a/pyanaconda/kexec.py
+++ b/pyanaconda/kexec.py
@@ -72,6 +72,11 @@ def run_grubby(args=None):
if boot_info_fields:
raise GrubbyInfoError("Missing values: %s" % ", ".join(boot_info_fields))
+ # There could be multiple initrd images defined for a boot entry, but
+ # the kexec command line tool only supports passing a single initrd.
+ if "initrd" in boot_info_args:
+ boot_info_args["initrd"] = boot_info_args["initrd"].split(" ")[0]
+
boot_info = boot_info_class(**boot_info_args)
log.info("grubby boot info for (%s): %s", args, boot_info)
return boot_info
--
2.23.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wangce1988/anaconda.git
git@gitee.com:wangce1988/anaconda.git
wangce1988
anaconda
anaconda
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385