Accepting request 950669 from home:ptesarik:branches:Kernel:kdump

- Resize crash reservation at boot (jsc#SLE-18441)
- Fix reproducible builds

OBS-URL: https://build.opensuse.org/request/show/950669
OBS-URL: https://build.opensuse.org/package/show/Kernel:kdump/kdump?expand=0&rev=220
This commit is contained in:
Petr Tesařík 2022-02-02 07:58:48 +00:00 committed by Git OBS Bridge
parent 481d61aebc
commit eb19f65b9d
11 changed files with 166 additions and 177 deletions

3
kdump-1.0.2.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8fd7176be438b9c98b34f47ad9d8c8056d0050903b0f758675e3ba60d7aaf31a
size 3368675

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:67c4b4025357052aeb5eb06de9ee9591e16e9c126c917dff9d54f549069afa41
size 3367553

View File

@ -1,38 +0,0 @@
From 34584498323ae95b1107fb260db876e56d81e3a1 Mon Sep 17 00:00:00 2001
From: Petr Tesarik <ptesarik@suse.com>
Date: Fri, 21 Jan 2022 15:59:37 +0100
Subject: calibrate: Ignore malformed VMCOREINFO lines
Patch-mainline: merged
Git-commit: 34584498323ae95b1107fb260db876e56d81e3a1
The vmcoreinfo content is sometimes not terminated properly,
producing one or more invalid lines at the end (i.e. without an
equal sign). They should be silently ignored.
Signed-off-by: Petr Tesarik <ptesarik@suse.com>
---
calibrate/maxrss.py | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
--- a/calibrate/maxrss.py
+++ b/calibrate/maxrss.py
@@ -61,11 +61,14 @@ try:
percpu = int(value.split()[0])
elif category == 'vmcoreinfo':
- (key, value) = data.split('=')
- if key == 'PAGESIZE':
- pagesize = int(value)
- elif key == 'SIZE(page)':
- sizeofpage = int(value)
+ try:
+ (key, value) = data.split('=')
+ if key == 'PAGESIZE':
+ pagesize = int(value)
+ elif key == 'SIZE(page)':
+ sizeofpage = int(value)
+ except ValueError:
+ pass
else:
if cmdline.debug:

View File

@ -0,0 +1,36 @@
From: Petr Tesarik <ptesarik@suse.com>
Date: Tue Feb 1 22:25:59 2022 +0100
Subject: calibrate: Fix network interface naming
Upstream: merged
Git-commit: 75a44901b54ba853497d63c01bef77b251436e0a
The init scripts may rename the network interface unless it is
given an explicit name by MAC address. If that happens, network
initialization fails, because the "eth0" interface is missing.
Signed-off-by: Petr Tesarik <ptesarik@suse.com>
---
calibrate/run-qemu.py | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
--- a/calibrate/run-qemu.py
+++ b/calibrate/run-qemu.py
@@ -217,8 +217,15 @@ def run_qemu(bindir, params, initrd, elf
model = 'virtio'
else:
model = 'e1000e'
- extra_qemu_args.extend(('-nic', 'user,model={}'.format(model)))
- extra_kernel_args.extend(('bootdev=eth0', 'ip=eth0:dhcp'))
+ mac = '12:34:56:78:9A:BC'
+ extra_qemu_args.extend((
+ '-nic', 'user,mac={},model={}'.format(mac, model)
+ ))
+ extra_kernel_args.extend((
+ 'ifname=kdump0:{}'.format(mac),
+ 'bootdev=kdump0',
+ 'ip=kdump0:dhcp'
+ ))
# Other arch-specific arguments
if arch == 'aarch64':

View File

@ -0,0 +1,37 @@
From: Petr Tesarik <ptesarik@suse.com>
Date: Tue Feb 1 18:47:25 2022 +0100
Subject: calibrate: Explicitly include af_packet in the test initrd
Upstream: merged
Git-commit: 00edd1457aa19eebe78c8c36ef013f72af262584
DHCP clients need protocol family PF_PACKET. If it is built as a
module, then the dependency is not automatically added by dracut's
kernel-network-modules unless af_packet is loaded in the host.
This breaks OBS build, because that is done inside a VM with no
network.
Signed-off-by: Petr Tesarik <ptesarik@suse.com>
---
calibrate/run-qemu.py | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
--- a/calibrate/run-qemu.py
+++ b/calibrate/run-qemu.py
@@ -82,11 +82,12 @@ class build_initrd(object):
'/usr/bin'))
if params['NET']:
+ netdrivers = [ 'af_packet' ]
if params['ARCH'].startswith('s390'):
- net_driver = 'virtio-net'
+ netdrivers.append('virtio-net')
else:
- net_driver = 'e1000e'
- extra_args = ('--add-drivers', net_driver)
+ netdrivers.append('e1000e')
+ extra_args = ('--add-drivers', ' '.join(netdrivers))
else:
extra_args = ()
args = (

View File

@ -0,0 +1,23 @@
From: Petr Tesarik <ptesarik@suse.com>
Date: Tue Feb 1 23:14:01 2022 +0100
Subject: calibrate.conf: Add dependency on kdumptool
Upstream: merged
Git-commit: 4641d2bc0468fe733c18b6f9c81f1bb6402c520e
The run-qemu.py script invokes kdumptool to find a suitable kernel,
so kdumptool must be built before this script runs.
Signed-off-by: Petr Tesarik <ptesarik@suse.com>
diff --git a/calibrate/CMakeLists.txt b/calibrate/CMakeLists.txt
index 7d8b4fc..57344ae 100644
--- a/calibrate/CMakeLists.txt
+++ b/calibrate/CMakeLists.txt
@@ -38,6 +38,7 @@ ADD_CUSTOM_COMMAND(
VERBATIM
DEPENDS
${dracut_targets}
+ kdumptool
dummy.conf
dummy-net.conf
trackrss

3
kdump-calibrate.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1d2f6cdfaa66fcd295e8f416db62c0cea11085343e01030d7721c18553cedc1e
size 1905

View File

@ -1,11 +0,0 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -172,7 +172,7 @@ ADD_CUSTOM_TARGET(
INSTALL(FILES
${CMAKE_CURRENT_BINARY_DIR}/sysconfig.kdump
DESTINATION
- /var/adm/fillup-templates/
+ /usr/share/fillup-templates/
)
ADD_CUSTOM_COMMAND(

View File

@ -1,96 +0,0 @@
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)";
-}

View File

@ -1,3 +1,23 @@
-------------------------------------------------------------------
Tue Feb 1 22:16:36 UTC 2022 - Petr Tesařík <ptesarik@suse.com>
- kdump-calibrate.conf-depends-on-kdumptool.patch: calibrate.conf:
Add dependency on kdumptool.
- kdump-calibrate-fix-nic-naming.patch: calibrate: Fix network
interface naming.
- kdump-calibrate-include-af_packet.patch: calibrate: Explicitly
include af_packet in the test initrd.
-------------------------------------------------------------------
Tue Feb 1 12:52:56 UTC 2022 - Petr Tesařík <ptesarik@suse.com>
- Update to 1.0.2
* Adjust crash kernel reservation at boot time (jsc#SLE-18441).
- All remaining patches have been upstreamed:
* kdump-fillupdir-fixes.patch
* kdump-use-pbl.patch
* kdump-calibrate-Ignore-malformed-VMCOREINFO.patch
-------------------------------------------------------------------
Fri Jan 21 15:03:29 UTC 2022 - Petr Tesařík <ptesarik@suse.com>

View File

@ -16,9 +16,16 @@
#
#Compat macro for new _fillupdir macro introduced in Nov 2017
%if ! %{defined _fillupdir}
%define _fillupdir %{_localstatedir}/adm/fillup-templates
%bcond_with calibrate
%if 0%{?is_opensuse}
%if 0%{suse_version} > 1500
%define distro_suffix tumbleweed.%{_arch}
%else
%define distro_suffix leap%{sle_version}.%{_arch}
%endif
%else
%define distro_suffix sle%{sle_version}.%{_arch}
%endif
%ifarch aarch64
@ -42,37 +49,28 @@
%define dracutlibdir %{_prefix}/lib/dracut
Name: kdump
Version: 1.0
Version: 1.0.2
Release: 0
Summary: Script for kdump
License: GPL-2.0-or-later
Group: System/Kernel
URL: https://github.com/openSUSE/kdump
Source: %{name}-%{version}.tar.bz2
Source1: %{name}-calibrate.tar.bz2
Source2: %{name}-rpmlintrc
Patch1: %{name}-fillupdir-fixes.patch
Patch9: %{name}-use-pbl.patch
Patch10: %{name}-calibrate-Ignore-malformed-VMCOREINFO.patch
BuildRequires: %qemu
Patch1: %{name}-calibrate-include-af_packet.patch
Patch2: %{name}-calibrate-fix-nic-naming.patch
Patch3: %{name}-calibrate.conf-depends-on-kdumptool.patch
BuildRequires: asciidoc
BuildRequires: cmake >= 3.7
BuildRequires: dhcp-client
BuildRequires: dracut
BuildRequires: gcc-c++
BuildRequires: iputils
BuildRequires: kernel-default
BuildRequires: libblkid-devel
BuildRequires: libcurl-devel
BuildRequires: libelf-devel
BuildRequires: libesmtp-devel
BuildRequires: libmount-devel
BuildRequires: libxslt
BuildRequires: makedumpfile
BuildRequires: pkgconfig
BuildRequires: procps
BuildRequires: python3
BuildRequires: qemu-ipxe
BuildRequires: qemu-vgabios
BuildRequires: systemd-sysvinit
BuildRequires: util-linux-systemd
BuildRequires: wicked
@ -80,9 +78,24 @@ BuildRequires: zlib-devel
BuildRequires: pkgconfig(systemd)
BuildRequires: pkgconfig(udev)
#!BuildIgnore: fop
%if %{with calibrate}
BuildRequires: %qemu
BuildRequires: dhcp-client
BuildRequires: dracut >= 047
BuildRequires: iputils
BuildRequires: kernel-default
BuildRequires: makedumpfile
BuildRequires: procps
BuildRequires: python3
BuildRequires: qemu-ipxe
BuildRequires: qemu-vgabios
BuildRequires: systemd-sysvinit
BuildRequires: util-linux-systemd
BuildRequires: wicked
%endif
Requires: /usr/bin/sed
Requires: curl
Requires: dracut
Requires: dracut >= 047
Requires: kexec-tools
Requires: makedumpfile
Requires: openssh
@ -117,21 +130,18 @@ after a crash dump has occured.
%prep
%setup -q
%if 0%{?suse_version} >= 1330
%patch1 -p1
%endif
%patch9 -p1
%patch10 -p1
%patch2 -p1
%patch3 -p1
%setup -q -D -T -a 1
%build
export CXXFLAGS="%{optflags} -std=c++11"
%cmake
# for SLE_15
%if %{undefined cmake_build}
%define cmake_build make %{?_smp_mflags}
%define ctest cd build; ctest --output-on-failure --force-new-ctest-process %{?_smp_mflags}
%define cmake_install DESTDIR=%{buildroot} make -C build %{?_smp_mflags} install
%cmake \
%if %{with calibrate}
-DCALIBRATE=ON
%else
-DCALIBRATE=OFF
%endif
%cmake_build
@ -144,6 +154,11 @@ export CXXFLAGS="%{optflags} -std=c++11"
# empty directory
mkdir -p %{buildroot}%{_localstatedir}/crash
# Install pre-built calibrate.conf
%if !%{with calibrate}
cp calibrate/calibrate.conf.%{distro_suffix} %{buildroot}/usr/lib/kdump/calibrate.conf
%endif
# symlink for init script
rm %{buildroot}%{_initddir}/boot.kdump
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rckdump