From ccdf9cd298e14926c636b6afc3a02ce8713cb34a Mon Sep 17 00:00:00 2001 From: Josef Reidinger Date: Sun, 21 Jan 2024 21:41:15 +0100 Subject: [PATCH 1/4] modify behavior of Kernel to works better in agama without install.inf --- library/system/src/modules/Kernel.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/library/system/src/modules/Kernel.rb b/library/system/src/modules/Kernel.rb index a25339290..12060b606 100644 --- a/library/system/src/modules/Kernel.rb +++ b/library/system/src/modules/Kernel.rb @@ -169,13 +169,13 @@ def ParseInstallationKernelCmdline @cmdline_parsed = true return if !(Stage.initial || Stage.cont) - # live installation does not create /etc/install.inf (bsc#793065) - tmp = if Mode.live_installation + # Check if /etc/install.inf exists + tmp = if SCR.Dir(path(".etc.install_inf")).empty? # not using dedicated agent in order to use the same parser for cmdline # independently on whether it comes from /proc/cmdline or /etc/install.inf - Convert.to_string(SCR.Read(path(".target.string"), "/proc/cmdline")) + SCR.Read(path(".target.string"), "/proc/cmdline").to_s else - Convert.to_string(SCR.Read(path(".etc.install_inf.Cmdline"))) + SCR.Read(path(".etc.install_inf.Cmdline")).to_s end Builtins.y2milestone( From 0c3977ea716a039491e9ea8262268c3fdc3ccc71 Mon Sep 17 00:00:00 2001 From: Josef Reidinger Date: Tue, 23 Jan 2024 13:51:49 +0100 Subject: [PATCH 2/4] use local read for kernel cmdline --- library/system/src/modules/Kernel.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/library/system/src/modules/Kernel.rb b/library/system/src/modules/Kernel.rb index 12060b606..6c4347804 100644 --- a/library/system/src/modules/Kernel.rb +++ b/library/system/src/modules/Kernel.rb @@ -173,7 +173,8 @@ def ParseInstallationKernelCmdline tmp = if SCR.Dir(path(".etc.install_inf")).empty? # not using dedicated agent in order to use the same parser for cmdline # independently on whether it comes from /proc/cmdline or /etc/install.inf - SCR.Read(path(".target.string"), "/proc/cmdline").to_s + # use local read as it does not make sense to depend on binding it to chroot + WFM.Read(path(".local.string"), "/proc/cmdline").to_s else SCR.Read(path(".etc.install_inf.Cmdline")).to_s end From e221e10f4ccbb7210ff03f25ab93b400ce2af7e4 Mon Sep 17 00:00:00 2001 From: Josef Reidinger Date: Tue, 23 Jan 2024 14:00:09 +0100 Subject: [PATCH 3/4] changes --- package/yast2.changes | 7 +++++++ package/yast2.spec | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/package/yast2.changes b/package/yast2.changes index 11abc67b3..dfb433979 100644 --- a/package/yast2.changes +++ b/package/yast2.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Jan 23 12:52:08 UTC 2024 - Josef Reidinger + +- Reading Kernel Params: Use kernel cmdline when install.inf is not + available (bsc#1216408) +- 5.0.4 + ------------------------------------------------------------------- Wed Nov 1 08:35:38 UTC 2023 - Ladislav Slezák diff --git a/package/yast2.spec b/package/yast2.spec index 89e252684..93c5b2d74 100644 --- a/package/yast2.spec +++ b/package/yast2.spec @@ -17,7 +17,7 @@ Name: yast2 -Version: 5.0.3 +Version: 5.0.4 Release: 0 Summary: YaST2 Main Package From 560184ffc05804fc70d54d8601d14ed94e2845bf Mon Sep 17 00:00:00 2001 From: Josef Reidinger Date: Tue, 23 Jan 2024 14:22:40 +0100 Subject: [PATCH 4/4] fix test --- library/system/test/kernel_test.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/library/system/test/kernel_test.rb b/library/system/test/kernel_test.rb index 618a3875d..8bba6f3c4 100755 --- a/library/system/test/kernel_test.rb +++ b/library/system/test/kernel_test.rb @@ -150,6 +150,7 @@ describe ".ParseInstallationKernelCmdline" do before do + allow(Yast::SCR).to receive(:Dir).with(path(".etc.install_inf")).and_return(["CmdLine"]) allow(Yast::SCR).to receive(:Read).with(path(".etc.install_inf.Cmdline")).and_return(cmdline) allow(Yast::Stage).to receive(:initial).and_return(true) allow(Yast::Arch).to receive(:architecture).and_return("x86_64")