Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package kdump for openSUSE:Factory checked in at 2023-01-11 17:14:18 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kdump (Old) and /work/SRC/openSUSE:Factory/.kdump.new.32243 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kdump" Wed Jan 11 17:14:18 2023 rev:131 rq:1057680 version:1.0.2+git39.g8c819fe Changes: -------- --- /work/SRC/openSUSE:Factory/kdump/kdump.changes 2022-12-14 14:11:09.455542419 +0100 +++ /work/SRC/openSUSE:Factory/.kdump.new.32243/kdump.changes 2023-01-11 17:14:21.755585335 +0100 @@ -1,0 +2,17 @@ +Tue Jan 10 17:13:22 UTC 2023 - Jiri Bohac <jbo...@suse.com> + +- improve the generation of calibrate.conf + * print the qemu messages and trackrss log during calibrate + * use static IP address for calibration + * all calibrate.conf variants now stored in a single file + * added a README and a helper script for updating calibrate.conf + * prevent dracut from running emergency shell + * fix s390x build dependencies + +- fix deleting of a temporary file in dracut/module-setup.sh +- look for nsswitch.conf in /etc and /usr/etc +- never run a debugging shell when KDUMP_CONTINUE_ON_ERROR is set +- remove build dependency for wicked +- fix package summary in the spec file + +------------------------------------------------------------------- Old: ---- kdump-1.0.2+git27.gb9718ae.tar.xz kdump-calibrate.tar.bz2 New: ---- calibrate.conf.all kdump-1.0.2+git39.g8c819fe.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kdump.spec ++++++ --- /var/tmp/diff_new_pack.tP48FB/_old 2023-01-11 17:14:22.519589780 +0100 +++ /var/tmp/diff_new_pack.tP48FB/_new 2023-01-11 17:14:22.523589803 +0100 @@ -1,7 +1,7 @@ # # spec file for package kdump # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -20,12 +20,12 @@ %if 0%{?is_opensuse} %if 0%{suse_version} > 1500 -%define distro_suffix tumbleweed.%{_arch} +%define distro_prefix tumbleweed.%{_arch} %else -%define distro_suffix leap%{sle_version}.%{_arch} +%define distro_prefix leap%{sle_version}.%{_arch} %endif %else -%define distro_suffix sle%{sle_version}.%{_arch} +%define distro_prefix sle%{sle_version}.%{_arch} %endif %ifarch aarch64 @@ -49,14 +49,14 @@ %define dracutlibdir %{_prefix}/lib/dracut Name: kdump -Version: 1.0.2+git27.gb9718ae +Version: 1.0.2+git39.g8c819fe Release: 0 -Summary: Script for kdump +Summary: Kernel crash dump scripts and utilities License: GPL-2.0-or-later Group: System/Kernel URL: https://github.com/openSUSE/kdump Source: %{name}-%{version}.tar.xz -Source1: %{name}-calibrate.tar.bz2 +Source1: calibrate.conf.all Source2: %{name}-rpmlintrc BuildRequires: asciidoc BuildRequires: cmake >= 3.7 @@ -70,7 +70,6 @@ BuildRequires: pkgconfig BuildRequires: systemd-sysvinit BuildRequires: util-linux-systemd -BuildRequires: wicked BuildRequires: zlib-devel BuildRequires: pkgconfig(systemd) BuildRequires: pkgconfig(udev) @@ -84,11 +83,12 @@ BuildRequires: makedumpfile BuildRequires: procps BuildRequires: python3 +%ifnarch s390x BuildRequires: qemu-ipxe BuildRequires: qemu-vgabios +%endif BuildRequires: systemd-sysvinit BuildRequires: util-linux-systemd -BuildRequires: wicked %endif Requires: /usr/bin/sed Requires: curl @@ -135,7 +135,7 @@ %prep %setup -q -%setup -q -D -T -a 1 +cp %{SOURCE1} calibrate.conf.all %build export CXXFLAGS="%{optflags} -std=c++11" @@ -146,7 +146,10 @@ -DCALIBRATE=OFF %endif -%cmake_build +# run make directly instead of cmake_build, which would run make in parallel +# and try to group output, preventing any debugging output from qemu if it +# fails to exit +make VERBOSE=1 %check %ctest @@ -156,9 +159,18 @@ # 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 +# get distro_prefix-prefixed lines from calibrate.conf.all +grep "^%distro_prefix:" calibrate.conf.all | cut -f 2- -d: > %{buildroot}/usr/lib/kdump/calibrate.conf +if ! test -s %{buildroot}/usr/lib/kdump/calibrate.conf; then +echo "no calibration data for %distro_prefix in calibrate.conf.all, see packaging/suse/calibrate/README" +false +fi +%else +# save the distro_prefix +echo "GENERATED_ON=%{distro_prefix}" >> %{buildroot}/usr/lib/kdump/calibrate.conf +echo "generated calibrate.conf:" +cat %{buildroot}/usr/lib/kdump/calibrate.conf %endif # symlink for init script ++++++ calibrate.conf.all ++++++ leap150300.aarch64:INIT_CACHED=34920 leap150300.aarch64:INIT_CACHED_NET=9524 leap150300.aarch64:INIT_NET=3340 leap150300.aarch64:KERNEL_BASE=58128 leap150300.aarch64:KERNEL_INIT=17380 leap150300.aarch64:PAGESIZE=4096 leap150300.aarch64:PERCPU=140 leap150300.aarch64:SIZEOFPAGE=64 leap150300.aarch64:USER_BASE=15840 leap150300.aarch64:USER_NET=9160 leap150300.ppc64le:INIT_CACHED=73984 leap150300.ppc64le:INIT_CACHED_NET=15488 leap150300.ppc64le:INIT_NET=3904 leap150300.ppc64le:KERNEL_BASE=77120 leap150300.ppc64le:KERNEL_INIT=18240 leap150300.ppc64le:PAGESIZE=65536 leap150300.ppc64le:PERCPU=896 leap150300.ppc64le:SIZEOFPAGE=64 leap150300.ppc64le:USER_BASE=66304 leap150300.ppc64le:USER_NET=0 leap150300.s390x:INIT_CACHED=31132 leap150300.s390x:INIT_CACHED_NET=8876 leap150300.s390x:INIT_NET=2992 leap150300.s390x:KERNEL_BASE=43404 leap150300.s390x:KERNEL_INIT=12964 leap150300.s390x:PAGESIZE=4096 leap150300.s390x:PERCPU=144 leap150300.s390x:SIZEOFPAGE=64 leap150300.s390x:USER_BASE=13688 leap150300.s390x:USER_NET=7172 leap150300.x86_64:INIT_CACHED=32628 leap150300.x86_64:INIT_CACHED_NET=8992 leap150300.x86_64:INIT_NET=3428 leap150300.x86_64:KERNEL_BASE=56404 leap150300.x86_64:KERNEL_INIT=20292 leap150300.x86_64:PAGESIZE=4096 leap150300.x86_64:PERCPU=236 leap150300.x86_64:SIZEOFPAGE=64 leap150300.x86_64:USER_BASE=17076 leap150300.x86_64:USER_NET=4420 sle150200.aarch64:INIT_CACHED=39152 sle150200.aarch64:INIT_CACHED_NET=5088 sle150200.aarch64:INIT_NET=1652 sle150200.aarch64:KERNEL_BASE=58776 sle150200.aarch64:KERNEL_INIT=16884 sle150200.aarch64:PAGESIZE=4096 sle150200.aarch64:PERCPU=140 sle150200.aarch64:SIZEOFPAGE=64 sle150200.aarch64:USER_BASE=9476 sle150200.aarch64:USER_NET=416 sle150200.ppc64le:INIT_CACHED=77184 sle150200.ppc64le:INIT_CACHED_NET=8768 sle150200.ppc64le:INIT_NET=1920 sle150200.ppc64le:KERNEL_BASE=76352 sle150200.ppc64le:KERNEL_INIT=17280 sle150200.ppc64le:PAGESIZE=65536 sle150200.ppc64le:PERCPU=896 sle150200.ppc64le:SIZEOFPAGE=64 sle150200.ppc64le:USER_BASE=39552 sle150200.ppc64le:USER_NET=2880 sle150200.x86_64:INIT_CACHED=38860 sle150200.x86_64:INIT_CACHED_NET=4536 sle150200.x86_64:INIT_NET=1640 sle150200.x86_64:KERNEL_BASE=57052 sle150200.x86_64:KERNEL_INIT=20232 sle150200.x86_64:PAGESIZE=4096 sle150200.x86_64:PERCPU=236 sle150200.x86_64:SIZEOFPAGE=64 sle150200.x86_64:USER_BASE=5368 sle150200.x86_64:USER_NET=9352 sle150300.aarch64:INIT_CACHED=35248 sle150300.aarch64:INIT_CACHED_NET=4368 sle150300.aarch64:INIT_NET=1640 sle150300.aarch64:KERNEL_BASE=58104 sle150300.aarch64:KERNEL_INIT=17500 sle150300.aarch64:PAGESIZE=4096 sle150300.aarch64:PERCPU=140 sle150300.aarch64:SIZEOFPAGE=64 sle150300.aarch64:USER_BASE=15240 sle150300.aarch64:USER_NET=7732 sle150300.ppc64le:INIT_CACHED=74496 sle150300.ppc64le:INIT_CACHED_NET=7808 sle150300.ppc64le:INIT_NET=1920 sle150300.ppc64le:KERNEL_BASE=77248 sle150300.ppc64le:KERNEL_INIT=18368 sle150300.ppc64le:PAGESIZE=65536 sle150300.ppc64le:PERCPU=896 sle150300.ppc64le:SIZEOFPAGE=64 sle150300.ppc64le:USER_BASE=65024 sle150300.ppc64le:USER_NET=3136 sle150300.s390x:INIT_CACHED=31520 sle150300.s390x:INIT_CACHED_NET=3852 sle150300.s390x:INIT_NET=1360 sle150300.s390x:KERNEL_BASE=43436 sle150300.s390x:KERNEL_INIT=13116 sle150300.s390x:PAGESIZE=4096 sle150300.s390x:PERCPU=144 sle150300.s390x:SIZEOFPAGE=64 sle150300.s390x:USER_BASE=6208 sle150300.s390x:USER_NET=2408 sle150300.x86_64:INIT_CACHED=32308 sle150300.x86_64:INIT_CACHED_NET=3948 sle150300.x86_64:INIT_NET=1628 sle150300.x86_64:KERNEL_BASE=58304 sle150300.x86_64:KERNEL_INIT=20188 sle150300.x86_64:PAGESIZE=4096 sle150300.x86_64:PERCPU=236 sle150300.x86_64:SIZEOFPAGE=64 sle150300.x86_64:USER_BASE=8840 sle150300.x86_64:USER_NET=14524 sle150400.aarch64:INIT_CACHED=38100 sle150400.aarch64:INIT_CACHED_NET=4072 sle150400.aarch64:INIT_NET=1560 sle150400.aarch64:KERNEL_BASE=83148 sle150400.aarch64:KERNEL_INIT=18992 sle150400.aarch64:PAGESIZE=4096 sle150400.aarch64:PERCPU=144 sle150400.aarch64:SIZEOFPAGE=64 sle150400.aarch64:USER_BASE=14212 sle150400.aarch64:USER_NET=7892 sle150400.ppc64le:INIT_CACHED=82752 sle150400.ppc64le:INIT_CACHED_NET=8064 sle150400.ppc64le:INIT_NET=1856 sle150400.ppc64le:KERNEL_BASE=191680 sle150400.ppc64le:KERNEL_INIT=18880 sle150400.ppc64le:PAGESIZE=65536 sle150400.ppc64le:PERCPU=896 sle150400.ppc64le:SIZEOFPAGE=64 sle150400.ppc64le:USER_BASE=62528 sle150400.ppc64le:USER_NET=0 sle150400.s390x:INIT_CACHED=34244 sle150400.s390x:INIT_CACHED_NET=3492 sle150400.s390x:INIT_NET=1284 sle150400.s390x:KERNEL_BASE=51752 sle150400.s390x:KERNEL_INIT=14428 sle150400.s390x:PAGESIZE=4096 sle150400.s390x:PERCPU=140 sle150400.s390x:SIZEOFPAGE=64 sle150400.s390x:USER_BASE=5716 sle150400.s390x:USER_NET=2608 sle150400.x86_64:INIT_CACHED=36604 sle150400.x86_64:INIT_CACHED_NET=3844 sle150400.x86_64:INIT_NET=1736 sle150400.x86_64:KERNEL_BASE=91072 sle150400.x86_64:KERNEL_INIT=21544 sle150400.x86_64:PAGESIZE=4096 sle150400.x86_64:PERCPU=264 sle150400.x86_64:SIZEOFPAGE=64 sle150400.x86_64:USER_BASE=15616 sle150400.x86_64:USER_NET=8684 sle150500.aarch64:INIT_CACHED=38380 sle150500.aarch64:INIT_CACHED_NET=4112 sle150500.aarch64:INIT_NET=1588 sle150500.aarch64:KERNEL_BASE=84440 sle150500.aarch64:KERNEL_INIT=19356 sle150500.aarch64:PAGESIZE=4096 sle150500.aarch64:PERCPU=144 sle150500.aarch64:SIZEOFPAGE=64 sle150500.aarch64:USER_BASE=14308 sle150500.aarch64:USER_NET=6500 sle150500.ppc64le:INIT_CACHED=83328 sle150500.ppc64le:INIT_CACHED_NET=8064 sle150500.ppc64le:INIT_NET=1920 sle150500.ppc64le:KERNEL_BASE=186560 sle150500.ppc64le:KERNEL_INIT=19200 sle150500.ppc64le:PAGESIZE=65536 sle150500.ppc64le:PERCPU=896 sle150500.ppc64le:SIZEOFPAGE=64 sle150500.ppc64le:USER_BASE=65088 sle150500.ppc64le:USER_NET=3008 sle150500.s390x:INIT_CACHED=34540 sle150500.s390x:INIT_CACHED_NET=3520 sle150500.s390x:INIT_NET=1300 sle150500.s390x:KERNEL_BASE=45720 sle150500.s390x:KERNEL_INIT=14648 sle150500.s390x:PAGESIZE=4096 sle150500.s390x:PERCPU=140 sle150500.s390x:SIZEOFPAGE=64 sle150500.s390x:USER_BASE=6356 sle150500.s390x:USER_NET=2092 sle150500.x86_64:INIT_CACHED=37136 sle150500.x86_64:INIT_CACHED_NET=3904 sle150500.x86_64:INIT_NET=1784 sle150500.x86_64:KERNEL_BASE=89648 sle150500.x86_64:KERNEL_INIT=22108 sle150500.x86_64:PAGESIZE=4096 sle150500.x86_64:PERCPU=264 sle150500.x86_64:SIZEOFPAGE=64 sle150500.x86_64:USER_BASE=14628 sle150500.x86_64:USER_NET=7900 tumbleweed.aarch64:INIT_CACHED=40164 tumbleweed.aarch64:INIT_CACHED_NET=7004 tumbleweed.aarch64:INIT_NET=2616 tumbleweed.aarch64:KERNEL_BASE=94536 tumbleweed.aarch64:KERNEL_INIT=24380 tumbleweed.aarch64:PAGESIZE=4096 tumbleweed.aarch64:PERCPU=136 tumbleweed.aarch64:SIZEOFPAGE=64 tumbleweed.aarch64:USER_BASE=10708 tumbleweed.aarch64:USER_NET=864 tumbleweed.i386:INIT_CACHED=49072 tumbleweed.i386:INIT_CACHED_NET=8676 tumbleweed.i386:INIT_NET=3136 tumbleweed.i386:KERNEL_BASE=58996 tumbleweed.i386:KERNEL_INIT=16608 tumbleweed.i386:PAGESIZE=4096 tumbleweed.i386:PERCPU=132 tumbleweed.i386:SIZEOFPAGE=40 tumbleweed.i386:USER_BASE=14148 tumbleweed.i386:USER_NET=1732 tumbleweed.ppc64:INIT_CACHED=91264 tumbleweed.ppc64:INIT_CACHED_NET=11712 tumbleweed.ppc64:INIT_NET=3136 tumbleweed.ppc64:KERNEL_BASE=141632 tumbleweed.ppc64:KERNEL_INIT=24128 tumbleweed.ppc64:PAGESIZE=65536 tumbleweed.ppc64:PERCPU=896 tumbleweed.ppc64:SIZEOFPAGE=64 tumbleweed.ppc64:USER_BASE=51648 tumbleweed.ppc64:USER_NET=0 tumbleweed.ppc64le:INIT_CACHED=90304 tumbleweed.ppc64le:INIT_CACHED_NET=11456 tumbleweed.ppc64le:INIT_NET=3136 tumbleweed.ppc64le:KERNEL_BASE=144192 tumbleweed.ppc64le:KERNEL_INIT=22144 tumbleweed.ppc64le:PAGESIZE=65536 tumbleweed.ppc64le:PERCPU=896 tumbleweed.ppc64le:SIZEOFPAGE=64 tumbleweed.ppc64le:USER_BASE=45440 tumbleweed.ppc64le:USER_NET=0 tumbleweed.s390x:INIT_CACHED=34540 tumbleweed.s390x:INIT_CACHED_NET=3520 tumbleweed.s390x:INIT_NET=1300 tumbleweed.s390x:KERNEL_BASE=45720 tumbleweed.s390x:KERNEL_INIT=14648 tumbleweed.s390x:PAGESIZE=4096 tumbleweed.s390x:PERCPU=140 tumbleweed.s390x:SIZEOFPAGE=64 tumbleweed.s390x:USER_BASE=6356 tumbleweed.s390x:USER_NET=2092 tumbleweed.x86_64:INIT_CACHED=42480 tumbleweed.x86_64:INIT_CACHED_NET=7296 tumbleweed.x86_64:INIT_NET=3308 tumbleweed.x86_64:KERNEL_BASE=93152 tumbleweed.x86_64:KERNEL_INIT=25320 tumbleweed.x86_64:PAGESIZE=4096 tumbleweed.x86_64:PERCPU=268 tumbleweed.x86_64:SIZEOFPAGE=64 tumbleweed.x86_64:USER_BASE=22504 tumbleweed.x86_64:USER_NET=2484 ++++++ kdump-1.0.2+git27.gb9718ae.tar.xz -> kdump-1.0.2+git39.g8c819fe.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdump-1.0.2+git27.gb9718ae/calibrate/run-qemu.py new/kdump-1.0.2+git39.g8c819fe/calibrate/run-qemu.py --- old/kdump-1.0.2+git27.gb9718ae/calibrate/run-qemu.py 2022-12-06 15:44:22.000000000 +0100 +++ new/kdump-1.0.2+git39.g8c819fe/calibrate/run-qemu.py 2023-01-10 18:00:51.000000000 +0100 @@ -224,7 +224,7 @@ extra_kernel_args.extend(( 'ifname=kdump0:{}'.format(mac), 'bootdev=kdump0', - 'ip=kdump0:dhcp' + 'ip=192.168.0.2::192.168.0.1:255.255.255.0::kdump0:none' )) # Other arch-specific arguments @@ -240,6 +240,8 @@ 'console={}'.format(console), 'root=kdump', 'rootflags=bind', + 'rd.shell=0', + 'rd.emergency=poweroff', *extra_kernel_args, '--', 'trackrss={}'.format(logdev), @@ -258,8 +260,24 @@ elfcorehdr.path, elfcorehdr.address), *extra_qemu_args, ) + + # create the log files and monitor them with tail -f + # (redirected to stderr) + # for debugging possible problems inside the VM + f = open(params['MESSAGES_LOG'], "w") + f.close() + tail_messages = subprocess.Popen(["tail", "-f", params['MESSAGES_LOG']], stdout=2) + + f = open(params['TRACKRSS_LOG'], "w") + f.close() + tail_trackrss = subprocess.Popen(["tail", "-f", params['TRACKRSS_LOG']], stdout=2) + + subprocess.call(qemu_args) + tail_messages.kill() + tail_trackrss.kill() + results = dict() # Get kernel-space requirements diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdump-1.0.2+git27.gb9718ae/dracut/kdump-save.cc new/kdump-1.0.2+git39.g8c819fe/dracut/kdump-save.cc --- old/kdump-1.0.2+git27.gb9718ae/dracut/kdump-save.cc 2022-12-06 15:44:22.000000000 +0100 +++ new/kdump-1.0.2+git39.g8c819fe/dracut/kdump-save.cc 2023-01-10 18:00:51.000000000 +0100 @@ -436,6 +436,7 @@ int main(int argc, char **argv) { + bool continue_on_error = true; try { // sanity check if (!FilePath(DEFAULT_DUMP).exists()) @@ -449,13 +450,18 @@ Configuration *config = Configuration::config(); config->readFile(CONFIG_FILE); + continue_on_error = config->KDUMP_CONTINUE_ON_ERROR.value(); execute(); } catch(std::exception &e) { cerr << "Cannot save dump!" << endl << endl - << " " << e.what() << "." << endl - << endl + << " " << e.what() << "." << endl; + + if (continue_on_error) + return 1; + + cerr << endl << "Something failed. You can try to debug it here." << endl; runShell(); return 1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdump-1.0.2+git27.gb9718ae/dracut/module-setup.sh new/kdump-1.0.2+git39.g8c819fe/dracut/module-setup.sh --- old/kdump-1.0.2+git27.gb9718ae/dracut/module-setup.sh 2022-12-06 15:44:22.000000000 +0100 +++ new/kdump-1.0.2+git39.g8c819fe/dracut/module-setup.sh 2023-01-10 18:00:51.000000000 +0100 @@ -275,7 +275,7 @@ _cmdline_f=$(mktemp) || return 1 cmdline_net > $_cmdline_f _cmdline=$(< $_cmdline_f) - rm _cmdline_f + rm $_cmdline_f [ -n "$_cmdline" ] && printf "%s\n" "$_cmdline" >> "${initdir}/etc/cmdline.d/99kdump-net.conf" fi diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdump-1.0.2+git27.gb9718ae/dracut/setup-kdump.functions new/kdump-1.0.2+git39.g8c819fe/dracut/setup-kdump.functions --- old/kdump-1.0.2+git27.gb9718ae/dracut/setup-kdump.functions 2022-12-06 15:44:22.000000000 +0100 +++ new/kdump-1.0.2+git39.g8c819fe/dracut/setup-kdump.functions 2023-01-10 18:00:51.000000000 +0100 @@ -1017,7 +1017,8 @@ shadow: files group: files EOF - grep '^[[:space:]]*hosts:' /etc/nsswitch.conf \ + grep -s '^[[:space:]]*hosts:' /etc/nsswitch.conf \ + || grep '^[[:space:]]*hosts:' /usr/etc/nsswitch.conf \ || echo 'hosts: dns [!UNAVAIL=return] files' } > "${dest}/etc/nsswitch.conf" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdump-1.0.2+git27.gb9718ae/packaging/suse/calibrate/README new/kdump-1.0.2+git39.g8c819fe/packaging/suse/calibrate/README --- old/kdump-1.0.2+git27.gb9718ae/packaging/suse/calibrate/README 1970-01-01 01:00:00.000000000 +0100 +++ new/kdump-1.0.2+git39.g8c819fe/packaging/suse/calibrate/README 2023-01-10 18:00:51.000000000 +0100 @@ -0,0 +1,55 @@ +On maintaining calibrate.conf +----------------------------- + +kdumptool calibrate needs a config file populated with measured +memory values: /usr/lib/kdump/calibrate.conf + +These values are determined by building the package with the +with_calibrate macro defined. This causes the build to run +an instrumented kdump environment in a qemu VM, tracking memory +consumption during the boot and execution of kdump. +All the values are recorded in calibrate.conf + +Because SUSE needs stable builds and these values are not stable, +the package is normally not built with the with_calibrate macro. +Instead, pre-generated values are used in calibrate.conf. + +The values in calibrate.conf are different for different distributions and +architectures. The package sources include a file calibrate.conf.all +with all possible distribution/architecture combinations. Every line is prefixed +with the distribution and architecture, following a ':'. The build +"greps" and "cuts" the appropriate set of values from this file into +/usr/lib/kdump/calibrate.conf + +The values in calibrate.conf.all should be re-generated after major changes to +the distribution or when a new distribution/architecture is introduced. To do +this, the maintainer needs to: + +1) build the package with with_calibrate + + One way to do this is to branch the package. In OBS, in the branched + projects's "Project Config" tab, enter: + Macros: + %_with_calibrate 1 + :Macros + + The package build will run qemu and generate a fresh calibrate.conf + file, not using the pre-built values from calibrate.conf.all + The generated calibrate.conf will contain one extra line, not normally present: + GENERATED_ON=distro.arch + This is the prefix that should be used in calibrate.conf.all + +2) extract calibrate.conf from the built RPMs for all the architectures and + distributions that you want to update the values for, prefix the lines with the + value of GENERATED_ON and update calibrate.conf.all with those lines + + To make this task easier, you can use the update_calibrate.py script. + Run it in the directory with your branched osc package working copy. + + It will extract calibrate.conf from all the built kdump binaries in the project + and update calibrate.conf.all with the extracted values. + + The old calibrate.conf.all is saved in calibrate.conf.all.old + +3) make sure the changed values make sense by comparing calibrate.conf.all and + calibrate.conf.all.old and commit the new calibrate.conf.all diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdump-1.0.2+git27.gb9718ae/packaging/suse/calibrate/update_calibrate.py new/kdump-1.0.2+git39.g8c819fe/packaging/suse/calibrate/update_calibrate.py --- old/kdump-1.0.2+git27.gb9718ae/packaging/suse/calibrate/update_calibrate.py 1970-01-01 01:00:00.000000000 +0100 +++ new/kdump-1.0.2+git39.g8c819fe/packaging/suse/calibrate/update_calibrate.py 2023-01-10 18:00:51.000000000 +0100 @@ -0,0 +1,126 @@ +#! /usr/bin/python3 + +import sys +import os +import subprocess +from pathlib import Path +import shutil +import tempfile + +subdir = 'calibrate' + + +class PipeSource: + def __init__(self, *args, **kwargs): + r, w = os.pipe() + self.out = os.fdopen(r, 'r') + sink = os.fdopen(w, 'w') + kwargs['stdout'] = sink + self.process = subprocess.Popen(*args, **kwargs) + sink.close() + +project = Path('.osc/_project').read_text().strip() +package = Path('.osc/_package').read_text().strip() + +def extract(repo, repoarch, name): + outfile = tempfile.TemporaryFile("w+t") + args = ( + 'osc', 'api', + '/'.join(('', 'build', project, repo, repoarch, + package, name)) + ) + oscpipe = PipeSource(args) + + args = ('rpm2cpio', '-') + rpmpipe = PipeSource(args, stdin=oscpipe.out) + + args = ( + 'cpio', + '-i', + '--to-stdout', + './usr/lib/kdump/calibrate.conf', + ) + cpio = subprocess.Popen(args, stdin=rpmpipe.out, stdout=outfile) + + oscpipe.process.wait() + rpmpipe.process.wait() + cpio.wait() + + outfile.seek(0) + lines = outfile.readlines() + # if 'GENERATED_ON' value is present, use it as a prefix; + prefix=None + for line in lines: + var = line.split('=')[0] + value = line.split('=')[1].rstrip() + if var == "GENERATED_ON": + prefix = value + break + + # not a generated calibrate.conf file, ignore + if not prefix: + return + + # filter out lines with prefix from calibrate.conf.all + calibrate = open("calibrate.conf.all", mode="r") + oldlines = calibrate.readlines() + calibrate.close() + + newlines=list() + for oldline in oldlines: + oldprefix = oldline.split(":")[0] + if oldprefix != prefix: + newlines.append(oldline) + + + + # append lines to calibrate.conf.all + for line in lines: + var = line.split('=')[0] + value = line.split('=')[1].rstrip() + if var == 'GENERATED_ON': + continue + newlines.append("{}:{}".format(prefix, line)) + print("updating {}:{}".format(prefix, line.rstrip()), file=sys.stderr) + + newlines.sort() + + calibrate = open("calibrate.conf.all", mode="w") + calibrate.writelines(newlines) + calibrate.close() + + +def list_rpms(): + files = list() + args = ( + 'osc', 'ls', + '-b', # Binaries + ) + oscpipe = PipeSource(args) + repoarch = None + for line in oscpipe.out: + if not line.startswith(' '): + repoarch = line.split('/')[1].rstrip() + repo = line.split('/')[0].rstrip() + else: + filename = line.strip() + try: + nvr, arch, line = filename.rsplit('.', 2) + name, ver, rel = filename.rsplit('-', 2) + except ValueError: + name = None + if name == 'kdump' and arch != 'src': + files.append((repo, repoarch, filename)) + return files + + +shutil.copyfile("calibrate.conf.all", "calibrate.conf.all.old") +print("calibrate.conf.all saved as calibrate.conf.all.old") + +for repo, arch, name in list_rpms(): + print('extractng calibrate.conf from {}'.format(name), file=sys.stderr) + extract(repo, arch, name) + print(file=sys.stderr) + + +print('calibrate.conf.all updated', file=sys.stderr) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdump-1.0.2+git27.gb9718ae/packaging/suse/kdump.spec new/kdump-1.0.2+git39.g8c819fe/packaging/suse/kdump.spec --- old/kdump-1.0.2+git27.gb9718ae/packaging/suse/kdump.spec 2022-12-06 15:44:22.000000000 +0100 +++ new/kdump-1.0.2+git39.g8c819fe/packaging/suse/kdump.spec 2023-01-10 18:00:51.000000000 +0100 @@ -19,12 +19,12 @@ %if 0%{?is_opensuse} %if 0%{suse_version} > 1500 -%define distro_suffix tumbleweed.%{_arch} +%define distro_prefix tumbleweed.%{_arch} %else -%define distro_suffix leap%{sle_version}.%{_arch} +%define distro_prefix leap%{sle_version}.%{_arch} %endif %else -%define distro_suffix sle%{sle_version}.%{_arch} +%define distro_prefix sle%{sle_version}.%{_arch} %endif %ifarch aarch64 @@ -50,12 +50,12 @@ Name: kdump Version: 1.0.2+git26.gc6fab38 Release: 0 -Summary: Script for kdump +Summary: Kernel crash dump scripts and utilities License: GPL-2.0-or-later Group: System/Kernel URL: https://github.com/openSUSE/kdump Source: %{name}-%{version}.tar.xz -Source1: %{name}-calibrate.tar.bz2 +Source1: calibrate.conf.all Source2: %{name}-rpmlintrc BuildRequires: asciidoc BuildRequires: cmake >= 3.7 @@ -69,7 +69,6 @@ BuildRequires: pkgconfig BuildRequires: systemd-sysvinit BuildRequires: util-linux-systemd -BuildRequires: wicked BuildRequires: zlib-devel BuildRequires: pkgconfig(systemd) BuildRequires: pkgconfig(udev) @@ -83,11 +82,12 @@ BuildRequires: makedumpfile BuildRequires: procps BuildRequires: python3 +%ifnarch s390x BuildRequires: qemu-ipxe BuildRequires: qemu-vgabios +%endif BuildRequires: systemd-sysvinit BuildRequires: util-linux-systemd -BuildRequires: wicked %endif Requires: /usr/bin/sed Requires: curl @@ -134,7 +134,7 @@ %prep %setup -q -%setup -q -D -T -a 1 +cp %{SOURCE1} calibrate.conf.all %build export CXXFLAGS="%{optflags} -std=c++11" @@ -145,7 +145,11 @@ -DCALIBRATE=OFF %endif -%cmake_build +# run make directly instead of cmake_build, which would run make in parallel +# and try to group output, preventing any debugging output from qemu if it +# fails to exit +make VERBOSE=1 + %check %ctest @@ -155,9 +159,18 @@ # 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 +# get distro_prefix-prefixed lines from calibrate.conf.all +grep "^%distro_prefix:" calibrate.conf.all | cut -f 2- -d: > %{buildroot}/usr/lib/kdump/calibrate.conf +if ! test -s %{buildroot}/usr/lib/kdump/calibrate.conf; then +echo "no calibration data for %distro_prefix in calibrate.conf.all, see packaging/suse/calibrate/README" +false +fi +%else +# save the distro_prefix +echo "GENERATED_ON=%{distro_prefix}" >> %{buildroot}/usr/lib/kdump/calibrate.conf +echo "generated calibrate.conf:" +cat %{buildroot}/usr/lib/kdump/calibrate.conf %endif # symlink for init script