forked from pool/kdump
This is a fix to an urgent SLE bug spotted by the openQA automation. To alleviate the pressure, I'm submitting the fix in parallel to the upstream pull request at https://github.com/openSUSE/kdump/pull/24 . - kdump-0.9.2-mkdumprd-Properly-pass-compression-params.patch: Fix malformation in passing Dracut compression parameters in mkdumprd (bsc#1193765). - Refresh existing patches. OBS-URL: https://build.opensuse.org/request/show/943594 OBS-URL: https://build.opensuse.org/package/show/Kernel:kdump/kdump?expand=0&rev=217
97 lines
2.6 KiB
Diff
97 lines
2.6 KiB
Diff
Date: Mon Jul 2 18:12:34 2018 +0200
|
|
From: Michal Koutný <mkoutny@suse.com>
|
|
Subject: Replace obsolete perl-Bootloader library with a simpler script
|
|
References: bsc#1050349
|
|
Upstream: tbd
|
|
|
|
Signed-off-by: Michal Koutný <mkoutny@suse.com>
|
|
Acked-by: Petr Tesarik <ptesarik@suse.com>
|
|
|
|
---
|
|
init/CMakeLists.txt | 1
|
|
init/kdump-bootloader.pl | 48 -----------------------------------------------
|
|
init/load.sh | 14 ++-----------
|
|
3 files changed, 3 insertions(+), 60 deletions(-)
|
|
|
|
--- a/init/CMakeLists.txt
|
|
+++ b/init/CMakeLists.txt
|
|
@@ -51,7 +51,6 @@ INSTALL(
|
|
INSTALL(
|
|
FILES
|
|
${CMAKE_CURRENT_SOURCE_DIR}/mkdumprd
|
|
- ${CMAKE_CURRENT_SOURCE_DIR}/kdump-bootloader.pl
|
|
DESTINATION
|
|
/usr/sbin
|
|
PERMISSIONS
|
|
--- a/init/load.sh
|
|
+++ b/init/load.sh
|
|
@@ -255,14 +255,10 @@ function fadump_bootloader()
|
|
local newstate="$1"
|
|
|
|
# check if the old configuration is still valid
|
|
- boot_opts=$(kdump-bootloader.pl --get)
|
|
- nofadump_opts=$(echo "$boot_opts" | remove_from_commandline 'fadump')
|
|
if [ "$newstate" = on ] ; then
|
|
- if [ "$boot_opts" = "$nofadump_opts" ] ; then
|
|
- kdump-bootloader.pl --update fadump=on
|
|
- fi
|
|
- elif [ "$boot_opts" != "$nofadump_opts" ] ; then
|
|
- kdump-bootloader.pl --update
|
|
+ pbl --add-option fadump=on --config
|
|
+ else
|
|
+ pbl --del-option fadump=on --config
|
|
fi
|
|
}
|
|
|
|
--- a/init/kdump-bootloader.pl
|
|
+++ /dev/null
|
|
@@ -1,48 +0,0 @@
|
|
-#! /usr/bin/perl
|
|
-
|
|
-use Bootloader::Tools;
|
|
-
|
|
-Bootloader::Tools::InitLibrary();
|
|
-
|
|
-my $grub2;
|
|
-my $section;
|
|
-if (Bootloader::Tools::GetBootloader() =~ /^(grub2|grub2-efi)$/) {
|
|
- $grub2 = true;
|
|
- $section = Bootloader::Tools::GetGlobals();
|
|
-} else {
|
|
- $grub2 = false;
|
|
- $section = Bootloader::Tools::GetDefaultSection();
|
|
-}
|
|
-
|
|
-if ($ARGV[0] eq "--get") {
|
|
- print $section->{"append"};
|
|
-} elsif ($ARGV[0] eq "--update") {
|
|
- my $input = $section->{"append"};
|
|
- my $result;
|
|
- while (length($input)) {
|
|
- $input =~ s/^[[:space:]]+//;
|
|
- if ($input =~ s/^("[^"]*"?|[^"[:space:]]+)+//) {
|
|
- my $rawparam = $&;
|
|
- my $param = $rawparam;
|
|
- $param =~ s/"//g;
|
|
- $param =~ s/=(.*)//;
|
|
- if (! ($param =~ /^fadump$/)) {
|
|
- $result .= " " if length($result);
|
|
- $result .= $rawparam;
|
|
- }
|
|
- }
|
|
- }
|
|
-
|
|
- shift @ARGV;
|
|
- $result .= " " if length($result);
|
|
- $result .= join(" ", @ARGV);
|
|
- if ($grub2) {
|
|
- Bootloader::Tools::SetGlobals("append" => $result);
|
|
- } else {
|
|
- $section->{"append"} = $result;
|
|
- $section->{"__modified"} = 1;
|
|
- Bootloader::Tools::SetGlobals();
|
|
- }
|
|
-} else {
|
|
- die "Need an action (--get or --update)";
|
|
-}
|