Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package kdump for openSUSE:Factory checked in at 2025-07-23 16:32:53 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kdump (Old) and /work/SRC/openSUSE:Factory/.kdump.new.8875 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kdump" Wed Jul 23 16:32:53 2025 rev:160 rq:1295067 version:2.1.4 Changes: -------- --- /work/SRC/openSUSE:Factory/kdump/kdump.changes 2025-07-02 12:08:19.987789812 +0200 +++ /work/SRC/openSUSE:Factory/.kdump.new.8875/kdump.changes 2025-07-23 16:33:49.840658065 +0200 @@ -1,0 +2,23 @@ +Thu Jul 18 14:42:52 UTC 2025 - Jiri Bohac <jbo...@suse.com> + +- upgrade to version 2.1.4 + * work around failing calibration on aarch64 + * support for kernel flavour-specific calibration + * specific calibration for aarch64 -64kb kernels (jsc#PED-12971) + * use KDUMP_NET_TIMEOUT as sftp/ftp timeout +- update calibrate values + +------------------------------------------------------------------- +Wed Jul 9 12:38:39 UTC 2025 - Jiri Bohac <jbo...@suse.com> + +- upgrade to version 2.1.1 + * check for reserved memory on load for better error reporting + * update man page + * set KDUMP_CPUS to 1 on XEN (bsc#1244289) + * load.sh clean up + * use eval for PRESCRIPT, POSTSCRIPT and TRANSFER + * sftp: fix key-based authentication + * fix and improve calibrate build +- update calibrate values + +------------------------------------------------------------------- Old: ---- kdump-2.1.0.tar.xz New: ---- kdump-2.1.4.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kdump.spec ++++++ --- /var/tmp/diff_new_pack.6wgyQV/_old 2025-07-23 16:33:51.944746070 +0200 +++ /var/tmp/diff_new_pack.6wgyQV/_new 2025-07-23 16:33:51.964746907 +0200 @@ -14,7 +14,7 @@ # Please submit bugfixes or comments via https://bugs.opensuse.org/ # - +#needsrootforbuild %bcond_with calibrate @@ -57,7 +57,7 @@ %define dracutlibdir %{_prefix}/lib/dracut Name: kdump -Version: 2.1.0 +Version: 2.1.4 Release: 0 Summary: Kernel crash dump scripts and utilities License: GPL-2.0-or-later @@ -78,16 +78,26 @@ # so turn them on unconditionally # %if %{with calibrate} BuildRequires: %qemu -BuildRequires: dhcp-client +BuildRequires: udev +BuildRequires: systemd +BuildRequires: NetworkManager +BuildRequires: iproute2 +BuildRequires: dbus-1 +BuildRequires: hostname BuildRequires: dracut >= 047 BuildRequires: iputils BuildRequires: kernel-default +%ifarch aarch64 +BuildRequires: kernel-64kb +%endif BuildRequires: lftp BuildRequires: makedumpfile BuildRequires: openssh-clients +BuildRequires: openssh-server BuildRequires: pciutils BuildRequires: procps BuildRequires: python3 +BuildRequires: e2fsprogs %ifnarch s390x BuildRequires: qemu-ipxe BuildRequires: qemu-vgabios ++++++ _scmsync.obsinfo ++++++ --- /var/tmp/diff_new_pack.6wgyQV/_old 2025-07-23 16:33:52.076751592 +0200 +++ /var/tmp/diff_new_pack.6wgyQV/_new 2025-07-23 16:33:52.080751759 +0200 @@ -1,6 +1,6 @@ -mtime: 1747904428 -commit: 8814cedcaffb2f9ec6525bbc0e4d52cdd1d49fc4069880ead04e80185d20d0a9 +mtime: 1752850341 +commit: a952b4f357cefa734b8b8079c0941489daf54ec7cdd0bd25bb53699e65133feb url: https://src.opensuse.org/kernel-kdump/kdump.git -revision: 8814cedcaffb2f9ec6525bbc0e4d52cdd1d49fc4069880ead04e80185d20d0a9 +revision: a952b4f357cefa734b8b8079c0941489daf54ec7cdd0bd25bb53699e65133feb projectscmsync: https://src.opensuse.org/kernel-kdump/_ObsPrj ++++++ build.specials.obscpio ++++++ ++++++ calibrate.conf.all ++++++ ++++ 670 lines (skipped) ++++ between /work/SRC/openSUSE:Factory/kdump/calibrate.conf.all ++++ and /work/SRC/openSUSE:Factory/.kdump.new.8875/calibrate.conf.all ++++++ kdump-2.1.0.tar.xz -> kdump-2.1.4.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdump-2.1.0/NEWS new/kdump-2.1.4/NEWS --- old/kdump-2.1.0/NEWS 2025-05-22 10:28:40.000000000 +0200 +++ new/kdump-2.1.4/NEWS 2025-07-18 13:52:43.000000000 +0200 @@ -1,4 +1,28 @@ -2.0.20 +2.1.4 +----- +* use KDUMP_NET_TIMEOUT as sftp/ftp timeout + +2.1.3 +----- +* increase calibration disk space + +2.1.2 +----- +* work around failing calibration on aarch64 +* support for kernel flavour-specific calibration +* specific calibration for aarch64 -64kb kernels (jsc#PED-12971) + +2.1.1 +----- +* check for reserved memory on load for better error reporting +* update man page +* set KDUMP_CPUS to 1 on XEN (bsc#1244289) +* load.sh clean up +* use eval for PRESCRIPT, POSTSCRIPT and TRANSFER +* sftp: fix key-based authentication +* fix and improve calibrate build + +2.1.0 ------ * fix calibrate (no run-time changes) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdump-2.1.0/calibrate/dummy-net.conf new/kdump-2.1.4/calibrate/dummy-net.conf --- old/kdump-2.1.0/calibrate/dummy-net.conf 2025-05-22 10:28:40.000000000 +0200 +++ new/kdump-2.1.4/calibrate/dummy-net.conf 2025-07-18 13:52:43.000000000 +0200 @@ -1,6 +1,9 @@ KDUMP_VERBOSE=11 -KDUMP_SAVEDIR="sftp://user:password@localhost/" -KDUMP_POSTSCRIPT="poweroff" -KDUMP_COMMANDLINE_APPEND="ip=eth0:dhcp" -KDUMP_NET_TIMEOUT=1 +KDUMP_SAVEDIR="sftp://root@10.0.2.2:40022/tmp/netdump" +MAKEDUMPFILE_OPTIONS="/proc/kcore > /tmp/fifo #" +KDUMP_NET_TIMEOUT=120 +# this is an ugly hack, relies on the exact way save-dump expands MAKEDUMPFILE_OPTIONS +# substitue /proc/vmcore with /proc/kcore and hide the default /proc/vmcore in a comment +KDUMP_COMMANDLINE_APPEND="ip=" KDUMP_HOST_KEY="*" + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdump-2.1.0/calibrate/dummy.conf new/kdump-2.1.4/calibrate/dummy.conf --- old/kdump-2.1.0/calibrate/dummy.conf 2025-05-22 10:28:40.000000000 +0200 +++ new/kdump-2.1.4/calibrate/dummy.conf 2025-07-18 13:52:43.000000000 +0200 @@ -1,4 +1,6 @@ KDUMP_VERBOSE=11 -KDUMP_SAVEDIR="/tmp" -KDUMP_POSTSCRIPT="poweroff" -KDUMP_NETCONFIG="" +KDUMP_PRESCRIPT="cat /proc/mounts" +KDUMP_FREE_DISK_SIZE=0 +# this is an ugly hack, relies on the exact way save-dump expands MAKEDUMPFILE_OPTIONS +# substitue /proc/vmcore with /proc/kcore and hide the default /proc/vmcore in a comment +MAKEDUMPFILE_OPTIONS="/proc/kcore > /tmp/fifo #" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdump-2.1.0/calibrate/kernel.py new/kdump-2.1.4/calibrate/kernel.py --- old/kdump-2.1.0/calibrate/kernel.py 2025-05-22 10:28:40.000000000 +0200 +++ new/kdump-2.1.4/calibrate/kernel.py 2025-07-18 13:52:43.000000000 +0200 @@ -9,8 +9,8 @@ help='print debugging messages on stderr') cmdline = parser.parse_args() -re_memory = re.compile('Memory: (\d+)K/(\d+)K available') -re_freeing = re.compile('Freeing (.*) memory: (\d+)K$') +re_memory = re.compile('Memory: (\\d+)K/(\\d+)K available') +re_freeing = re.compile('Freeing (.*) memory: (\\d+)K$') available = 0 freed = 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdump-2.1.0/calibrate/run-qemu.py new/kdump-2.1.4/calibrate/run-qemu.py --- old/kdump-2.1.0/calibrate/run-qemu.py 2025-05-22 10:28:40.000000000 +0200 +++ new/kdump-2.1.4/calibrate/run-qemu.py 2025-07-18 13:52:43.000000000 +0200 @@ -5,59 +5,10 @@ import subprocess import tempfile import shutil +import glob params = dict() -# Directory with scripts and other data -params['SCRIPTDIR'] = os.path.abspath(os.path.dirname(sys.argv[0])) - -# System dracut base directory -params['DRACUTDIR'] = '/usr/lib/dracut' - -# Total VM memory in KiB: -params['TOTAL_RAM'] = 1024 * 1024 - -# Number of CPUs for the VM -params['NUMCPUS'] = 2 - -# Where kernel messages should go -params['MESSAGES_LOG'] = 'messages.log' - -# Where trackrss log should go -params['TRACKRSS_LOG'] = 'trackrss.log' - -# Store the system architecture for convenience -arch = os.uname()[4] -params['ARCH'] = os.uname()[4] - -if arch == "i386" or arch == "i586" or arch == "i686" or arch == "x86_64": - image="vmlinuz" -elif arch.startswith("s390"): - image="image" -elif arch == "aarch64" or arch == "riscv64": - image="Image" -else: - image="vmlinux" - -params['KERNEL'] = "/boot/" + image - -# Physical address where elfcorehdr should be loaded. -# This is tricky. The elfcorehdr memory range is removed from the kernel -# memory map with a command line option, but the kernel boot code runs -# before the command line is parsed, and it may overwrite the data. -if params['ARCH'] == 'aarch64': - # QEMU defines all RAM at 1G physical for AArch64 - ADDR_ELFCOREHDR = (1024 * 1024 * 1024) + (256 * 1024 * 1024) -elif params['ARCH'] == 'riscv64': - # QEMU defines all RAM at 2G physical for RISC-V - ADDR_ELFCOREHDR = 0x80000000 + (256 * 1024 * 1024) -else: - # For other platforms, the region at 768M should be reasonably safe, - # because it is high enough to avoid conflicts with special-purpose - # regions and low enough to avoid conflicts with allocations at the - # end of RAM. - ADDR_ELFCOREHDR = 768 * 1024 * 1024 - def install_kdump_init(bindir): env = os.environ.copy() env['DESTDIR'] = os.path.abspath('.') @@ -83,8 +34,7 @@ else: os.symlink(os.path.join(basedir, name), name) -class build_initrd(object): - def __init__(self, bindir, params, config, path='test-initrd'): +def build_initrd(bindir, params, config, path): # First, create the base initrd using dracut: env = os.environ.copy() env['KDUMP_LIBDIR'] = os.path.abspath(params['SCRIPTDIR'] + "/..") @@ -95,15 +45,19 @@ '/usr/sbin', '/usr/bin')) + drivers = [] if params['NET']: - netdrivers = [ 'af_packet' ] + drivers.append('af_packet') if params['ARCH'].startswith('s390'): - netdrivers.append('virtio-net') + drivers.append('virtio-net') else: - netdrivers.append('e1000e') - extra_args = ('--add-drivers', ' '.join(netdrivers)) + drivers.append('e1000e') + extra_args = [] else: - extra_args = () + drivers.append('sd_mod') + drivers.append('virtio_blk') + drivers.append('ext4') + extra_args = ('--mount', '/dev/disk/by-label/calib-disk /kdump/mnt ext3') args = ( os.path.abspath('dracut'), '--local', @@ -117,7 +71,7 @@ # Create a simple uncompressed CPIO archive: '--no-compress', '--no-early-microcode', - + '--add-drivers', ' '+' '.join(drivers), # Additional options: *extra_args, @@ -140,7 +94,7 @@ # Compress the result: subprocess.call(('xz', '-f', '-0', '--check=crc32', path)) - self.path = path + os.path.extsep + 'xz' + return path + os.path.extsep + 'xz' class build_elfcorehdr(object): def __init__(self, bindir, addr, path='elfcorehdr.bin'): @@ -221,8 +175,11 @@ if arch.startswith('s390'): S390_OLDMEM_BASE = 0x10418 # cf. struct parmarea oldmem = 'oldmem.bin' - oldmem_size = 0 - oldmem_base = 0 + # memory size for the crash kernel is defined by oldmem_size; + # put it in the middle of a doubled qemu memory + oldmem_size = qemu_ram * 1024; + oldmem_base = int(qemu_ram * 1024 / 2) + qemu_ram *= 2 with open(oldmem, 'wb') as f: f.write(oldmem_base.to_bytes(8, 'big')) f.write(oldmem_size.to_bytes(8, 'big')) @@ -247,15 +204,19 @@ )) extra_kernel_args.extend(( 'ifname=kdump0:{}'.format(mac), - 'bootdev=kdump0', - 'ip=192.168.0.2::192.168.0.1:255.255.255.0::kdump0:none' + 'ip=kdump0:dhcp', + 'rd.neednet=1' + )) + else: + extra_qemu_args.extend(( + '-drive', 'file=disk.raw,index=0,media=disk,if=virtio', )) # Other arch-specific arguments if arch == 'aarch64': extra_qemu_args.extend(( '-machine', 'virt', - '-cpu', 'max', + '-cpu', 'cortex-a57', '-bios', '/usr/share/qemu/qemu-uefi-aarch64.bin', )) if arch == 'x86_64': @@ -266,14 +227,15 @@ extra_qemu_args.extend(( '-machine', 'virt', )) + kernel_args = ( 'panic=1', 'nokaslr', 'console={}'.format(console), 'root=kdump', 'rootflags=bind', - 'rd.shell=0', - 'rd.emergency=poweroff', + 'rd.shell=0', + 'rd.emergency=poweroff', *extra_kernel_args, '--', 'trackrss={}'.format(logdev), @@ -283,10 +245,10 @@ '-smp', str(params['NUMCPUS']), '-no-reboot', '-m', '{:d}K'.format(qemu_ram), - '-display', 'none', + '-nographic', *console_args, '-kernel', params['KERNEL'], - '-initrd', initrd.path, + '-initrd', initrd, '-append', ' '.join(kernel_args), '-device', 'loader,file={},force-raw=on,addr=0x{:x}'.format( elfcorehdr.path, elfcorehdr.address), @@ -302,15 +264,14 @@ f = open(params['TRACKRSS_LOG'], "w") f.close() - tail_trackrss = subprocess.Popen(["tail", "-f", params['TRACKRSS_LOG']], stdout=2) - - result = subprocess.run(qemu_args, stdout=sys.stderr, stderr=sys.stderr, check=True) - if not result.returncode: - print("qemu result: ", result, file=sys.stderr) + subprocess.run(qemu_args, stdout=sys.stderr, stderr=sys.stderr, check=True) tail_messages.kill() - tail_trackrss.kill() + + print("trackrss output:", file=sys.stderr) + subprocess.run(['cat', params['TRACKRSS_LOG']], stdout=2) + print("(end of trackrss output)", file=sys.stderr) results = dict() @@ -350,42 +311,171 @@ def calc_diff(src, dst, key, diffkey): src[diffkey] = max(0, dst[key] - src[key]) -with subprocess.Popen(('get_kernel_version', params['KERNEL']), - stdout=subprocess.PIPE) as p: - params['KERNELVER'] = p.communicate()[0].decode().strip() - -with tempfile.TemporaryDirectory() as tmpdir: - oldcwd = os.getcwd() - os.chdir(tmpdir) - elfcorehdr = build_elfcorehdr(oldcwd, ADDR_ELFCOREHDR) - - install_kdump_init(oldcwd) - init_local_dracut(params) - - params['NET'] = False - initrd = build_initrd(oldcwd, params, 'dummy.conf') - results = run_qemu(oldcwd, params, initrd, elfcorehdr) - - params['NET'] = True - initrd = build_initrd(oldcwd, params, 'dummy-net.conf') - netresults = run_qemu(oldcwd, params, initrd, elfcorehdr) - os.chdir(oldcwd) - -calc_diff(results, netresults, 'KERNEL_INIT', 'INIT_NET') -calc_diff(results, netresults, 'INIT_CACHED', 'INIT_CACHED_NET') -calc_diff(results, netresults, 'USER_BASE', 'USER_NET') - -keys = ( - 'KERNEL_BASE', - 'KERNEL_INIT', - 'INIT_CACHED', - 'PAGESIZE', - 'SIZEOFPAGE', - 'PERCPU', - 'USER_BASE', - 'INIT_NET', - 'INIT_CACHED_NET', - 'USER_NET', -) -for key in keys: - print('{}={:d}'.format(key, results[key])) +def dump_ok(crashdir): + if not os.path.isdir(crashdir): + print(crashdir + " does not exist", file=sys.stderr) + return False + + with os.scandir(crashdir) as it: + for entry in it: + if not entry.name.startswith('.') and entry.is_dir(): + print("found dump directory: " + entry.path, file=sys.stderr) + if not os.path.isfile(os.path.join(entry.path, 'vmcore')): + print("vmcore not found", file=sys.stderr) + return False + + if not os.path.isfile(os.path.join(entry.path, 'README.txt')): + print("README.txt not found", file=sys.stderr) + return False + + try: + f = open(os.path.join(entry.path, 'README.txt'),"r") + readme = f.read() + if not 'vmcore status: saved successfully' in readme: + print("README.txt does not contain vmcore success status", file=sys.stderr) + return False + except: + print("can't read README.txt", file=sys.stderr) + return False + print("vmcore and README.txt check OK", file=sys.stderr) + return True + return False + +def calibrate_kernel(image, flavour): + params['KERNEL'] = image + + # Physical address where elfcorehdr should be loaded. + # This is tricky. The elfcorehdr memory range is removed from the kernel + # memory map with a command line option, but the kernel boot code runs + # before the command line is parsed, and it may overwrite the data. + if params['ARCH'] == 'aarch64': + # QEMU defines all RAM at 1G physical for AArch64 + ADDR_ELFCOREHDR = (1024 * 1024 * 1024) + (256 * 1024 * 1024) + elif params['ARCH'] == 'riscv64': + # QEMU defines all RAM at 2G physical for RISC-V + ADDR_ELFCOREHDR = 0x80000000 + (256 * 1024 * 1024) + else: + # For other platforms, the region at 768M should be reasonably safe, + # because it is high enough to avoid conflicts with special-purpose + # regions and low enough to avoid conflicts with allocations at the + # end of RAM. + ADDR_ELFCOREHDR = 768 * 1024 * 1024 + + with subprocess.Popen(('get_kernel_version', params['KERNEL']), + stdout=subprocess.PIPE) as p: + params['KERNELVER'] = p.communicate()[0].decode().strip() + + with tempfile.TemporaryDirectory() as tmpdir: + oldcwd = os.getcwd() + os.chdir(tmpdir) + elfcorehdr = build_elfcorehdr(oldcwd, ADDR_ELFCOREHDR) + + # clean up after previous runs + if os.path.exists('/root/.ssh/id_ed25519'): + os.remove('/root/.ssh/id_ed25519') + if os.path.exists('/root/.ssh/id_ed25519.pub'): + os.remove('/root/.ssh/id_ed25519.pub') + subprocess.run(('rm', '-rf', '/tmp/netdump'), stdout=sys.stderr, stderr=sys.stderr, check=False) + + # prepare disk image for saving the non-network dump + subprocess.run(('dd', 'if=/dev/zero', 'of=disk.raw', 'bs=1', 'seek=300M', 'count=1'), stdout=sys.stderr, stderr=sys.stderr, check=True) + subprocess.run(('/usr/sbin/mkfs.ext3', '-L', 'calib-disk', 'disk.raw'), stdout=sys.stderr, stderr=sys.stderr, check=True) + + # configure and start ssh server for the network dump + subprocess.run(('ssh-keygen', '-A'), stdout=sys.stderr, stderr=sys.stderr, check=True) + subprocess.run(('/usr/sbin/sshd', '-p', '40022'), stdout=sys.stderr, stderr=sys.stderr, check=True) + subprocess.run(('ssh-keygen', '-f', '/root/.ssh/id_ed25519', '-N', ''), stdout=sys.stderr, stderr=sys.stderr, check=True) + shutil.copy("/root/.ssh/id_ed25519.pub", "/root/.ssh/authorized_keys") + + install_kdump_init(oldcwd) + init_local_dracut(params) + + params['NET'] = False + initrd = build_initrd(oldcwd, params, 'dummy.conf', "test-initrd") + results = run_qemu(oldcwd, params, initrd, elfcorehdr) + # verify that the dump completed successfully + os.mkdir('mount') + subprocess.run(('mount', '-o', 'loop', 'disk.raw', 'mount'), stdout=sys.stderr, stderr=sys.stderr, check=True) + ret = dump_ok('mount/var/crash') + subprocess.run(('umount', 'mount'), stdout=sys.stderr, stderr=sys.stderr, check=True) + if not ret: + print("non-network dump failed; calibration failed", file=sys.stderr) + exit(1) + + params['NET'] = True + initrd = build_initrd(oldcwd, params, 'dummy-net.conf', "test-initrd-net") + os.mkdir('/tmp/netdump') + netresults = run_qemu(oldcwd, params, initrd, elfcorehdr) + if not dump_ok('/tmp/netdump'): + print("network dump failed; calibration failed", file=sys.stderr) + exit(1) + + os.chdir(oldcwd) + + calc_diff(results, netresults, 'KERNEL_INIT', 'INIT_NET') + calc_diff(results, netresults, 'INIT_CACHED', 'INIT_CACHED_NET') + calc_diff(results, netresults, 'USER_BASE', 'USER_NET') + + keys = ( + 'KERNEL_BASE', + 'KERNEL_INIT', + 'INIT_CACHED', + 'PAGESIZE', + 'SIZEOFPAGE', + 'PERCPU', + 'USER_BASE', + 'INIT_NET', + 'INIT_CACHED_NET', + 'USER_NET', + ) + for key in keys: + if flavour: + print('{}_{}={:d}'.format(key, flavour, results[key])) + else: + print('{}={:d}'.format(key, results[key])) + + +################################################ +# main program + +# Directory with scripts and other data +params['SCRIPTDIR'] = os.path.abspath(os.path.dirname(sys.argv[0])) + +# System dracut base directory +params['DRACUTDIR'] = '/usr/lib/dracut' + +# Total VM memory in KiB: +params['TOTAL_RAM'] = 1024 * 1024 + +# Number of CPUs for the VM +params['NUMCPUS'] = 2 + +# Where kernel messages should go +params['MESSAGES_LOG'] = 'messages.log' + +# Where trackrss log should go +params['TRACKRSS_LOG'] = 'trackrss.log' + +# Store the system architecture for convenience +arch = os.uname()[4] +params['ARCH'] = os.uname()[4] + +if arch == "i386" or arch == "i586" or arch == "i686" or arch == "x86_64": + image="vmlinuz" +elif arch.startswith("s390"): + image="image" +elif arch == "aarch64" or arch == "riscv64": + image="Image" +else: + image="vmlinux" + +kernels = glob.glob("/boot/"+image+"-*") +print("Kernels to calibrate: ", kernels, file=sys.stderr) +for k in kernels: + flavour=k.split("-")[-1] + if flavour == "default": + flavour = None + print("Calibrating {} (flavour: {})".format(k, flavour), file=sys.stderr) + calibrate_kernel(k, flavour) + +# vim: set et ts=4 sw=4 : diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdump-2.1.0/doc/man/kdump.5.txt.in new/kdump-2.1.4/doc/man/kdump.5.txt.in --- old/kdump-2.1.0/doc/man/kdump.5.txt.in 2025-05-22 10:28:40.000000000 +0200 +++ new/kdump-2.1.4/doc/man/kdump.5.txt.in 2025-07-18 13:52:43.000000000 +0200 @@ -109,6 +109,8 @@ parameter is not added to the kdump kernel command line and _--num-threads_ is set to the number of CPUs. +Decreasing the number of CPUs will lower the memory required by kdump. + Default is 32. @@ -554,6 +556,9 @@ KDUMP_CONTINUE_ON_ERROR is set to "false" to avoid being dropped to a debug shell. +This value, if larger than 5 seconds, is also used as a timeout for _ftp_ and +_sftp_ transfers. Otherwise 5 seconds is used for _ftp_ and _sftp_. + Default: "30" KDUMP_SMTP_SERVER diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdump-2.1.0/doc/man/kdump.7.txt.in new/kdump-2.1.4/doc/man/kdump.7.txt.in --- old/kdump-2.1.0/doc/man/kdump.7.txt.in 2025-05-22 10:28:40.000000000 +0200 +++ new/kdump-2.1.4/doc/man/kdump.7.txt.in 2025-07-18 13:52:43.000000000 +0200 @@ -68,7 +68,7 @@ ----------------------- A simple method to use kdump on SUSE is to install -the kdump package and enable the kdum.service: +the kdump package and enable the kdump.service: ---------------------------------- # zypper install yast2-kdump @@ -84,7 +84,8 @@ This will fail, because the currently running kernel has not been started with the _crashkernel_ commandline option. However -the service will by default update the bootloader to provide the +the service will also start the kdump-commandline.service, +which will by default update the bootloader to provide the option on the next boot. If you don't perform this step, the service will fail during the @@ -101,12 +102,10 @@ that, you have to add a parameter called _crashkernel_ in bootloader configuration. The syntax is: - crashkernel=size@offset + crashkernel=size[@offset] -The _offset_ is the load offset, i.e. the physical base address on which the -memory reservation area starts. Starting with version 2.6.27, it's not necessary -to specify that _offset_ manually since the kernel chooses a suitable base -address automatically. +The optional _offset_ is the load offset, i.e. the physical base address on +which the memory reservation area starts. To find a suggested value for _size_, us the _kdumptool calibrate_ command. The suggested value is the sum of the Low and High values in its output. @@ -172,6 +171,10 @@ You can use the values suggested by _kdumptool_calibrate_ as a starting point for finding a correct value and setting KDUMP_CRASHKERNEL manually. +The value of KDUMP_CPUS influences the amount of memory required by kdump. +You may want to decrease the default value to limit the memory required. +Note that previously the default was to use a single CPU. + Configuration ------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdump-2.1.0/dracut/kdump-save new/kdump-2.1.4/dracut/kdump-save --- old/kdump-2.1.0/dracut/kdump-save 2025-05-22 10:28:40.000000000 +0200 +++ new/kdump-2.1.4/dracut/kdump-save 2025-07-18 13:52:43.000000000 +0200 @@ -17,7 +17,7 @@ # KDUMP_TRANSFER may specify a custom command to do all the work if [[ -n ${KDUMP_TRANSFER} ]]; then - ${KDUMP_TRANSFER} + eval "${KDUMP_TRANSFER}" RET=$? if [[ ${RET} -ne 0 ]]; then echo "Transfer exit code: ${RET}" @@ -29,7 +29,7 @@ # KDUMP_PRESCRIPT if [[ -n ${KDUMP_PRESCRIPT} ]]; then echo "Running KDUMP_PRESCRIPT (${KDUMP_PRESCRIPT})" - ${KDUMP_PRESCRIPT} + eval "${KDUMP_PRESCRIPT}" RES=$? [[ ${RES} -ne 0 ]] && error "Pre-script failed (${RES})" fi @@ -53,7 +53,20 @@ # the directory part of URL does not exist yet URL=${KDUMP_SAVEDIR#*://} URL_DIR="/${URL#*/}" + HOST="${URL%%/*}" URL="sftp://${URL%%/*}" + # when no PW present in URL we assume key-based authentication; + # prevent lftp prompting for a password by setting LFTP_PASSWORD + # otherwise let LFTP parse the password from the URL + UPW="${HOST%%@*}" + HOST="${HOST#*@}" + USER= + PW= + if ! [[ ${UPW} == ${HOST} ]]; then + PW="${UPW#*:}" + [[ ${PW} == ${UPW} ]] && PW="" + fi + [[ -z "${PW}" ]] && export LFTP_PASSWORD= ;; ssh) # split URL into host and directory parts, ssh can't @@ -165,9 +178,10 @@ DIR="${URL_DIR}/${SUBDIR}" LFTP_DEBUG="" ${VERBOSE} && LFTP_DEBUG="-d " - SAVE_COMMAND='lftp ${LFTP_DEBUG} -c "set net:timeout 5; set net:max-retries 2; open --env-password ${URL} || exit 1; mkdir -pf ${DIR}; chmod 700 ${DIR}; put ${SOURCE} -o ${DIR}/${FILENAME}"' - # NOTE: --env-password is a hack for sftp not to ask for password if keys are used - # the password can still be part of the URL + LFTP_TIMEOUT=5 + [[ ${KDUMP_NET_TIMEOUT} -gt 5 ]] && LFTP_TIMEOUT=${KDUMP_NET_TIMEOUT} + SAVE_COMMAND='lftp ${LFTP_DEBUG} -c "set net:timeout '${LFTP_TIMEOUT}'; set net:max-retries 2; open --env-password ${URL} || exit 1; mkdir -pf ${DIR}; chmod 700 ${DIR}; put ${SOURCE} -o ${DIR}/${FILENAME}"' + # NOTE: --env-password/LFTP_PASSWORD is a hack for sftp not to ask for password if keys are used esac # use a FIFO; lftp can upload files from a fifo (unlike sftp) but not from stdin @@ -331,7 +345,7 @@ # KDUMP_POSTSCRIPT if [[ -n ${KDUMP_POSTSCRIPT} ]]; then echo "Running KDUMP_POSTSCRIPT (${KDUMP_POSTSCRIPT})" - ${KDUMP_POSTSCRIPT} + eval "${KDUMP_POSTSCRIPT}" RES=$? [[ ${RES} -ne 0 ]] && error "Post-script failed (${RES})" fi diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdump-2.1.0/init/load.sh new/kdump-2.1.4/init/load.sh --- old/kdump-2.1.0/init/load.sh 2025-05-22 10:28:40.000000000 +0200 +++ new/kdump-2.1.4/init/load.sh 2025-07-18 13:52:43.000000000 +0200 @@ -97,6 +97,8 @@ remove_from_commandline \ 'root|resume|crashkernel|splash|mem|BOOT_IMAGE|showopts|zfcp\.allow_lun_scan|hugepages|acpi_no_memhotplug|cgroup_disable|unknown_nmi_panic|rd\.udev\.children-max' \ < /proc/cmdline) + + [[ -e /proc/xen ]] && KDUMP_CPUS=1 # makedumpfile does not support --num-threads on XEN if [ ${KDUMP_CPUS:-1} -ne 0 ] ; then nr_cpus="nr_cpus=${KDUMP_CPUS:-1}" fi @@ -118,13 +120,6 @@ commandline="$commandline zfcp.allow_lun_scan=0" ;; esac - - # Xen does not include the kernel release in VMCOREINFO_XEN - # so we have to pass it via the command line - if [[ $(uname -r) =~ -xen$ ]] ; then - kernelrelease=$(uname -r) - commandline="$commandline kernelversion=$kernelrelease" - fi fi commandline="$commandline $(set_serial_console)" @@ -289,6 +284,14 @@ if [ "$KDUMP_FADUMP" = "true" ] ; then load_kdump_fadump else + read RESERVED < /sys/kernel/kexec_crash_size + [[ ${RESERVED} -eq 0 ]] && { + echo "No crashkernel memory reserved, Kdump cannot start." >&2 + echo "Normally the crashkernel= option is handled by kdump-commandline.service" >&2 + echo "See the status of kdump-commandline.service or man 7 kdump for details." >&2 + exit 1 + } + # check if initrd and the kernel it was built for exist # return 6 if not, which is treated as success by # the kdump-early service diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdump-2.1.0/kdumptool/calibrate.cc new/kdump-2.1.4/kdumptool/calibrate.cc --- old/kdump-2.1.0/kdumptool/calibrate.cc 2025-05-22 10:28:40.000000000 +0200 +++ new/kdump-2.1.4/kdumptool/calibrate.cc 2025-07-18 13:52:43.000000000 +0200 @@ -33,6 +33,7 @@ #include <unistd.h> #include <sys/stat.h> #include <sys/types.h> +#include <sys/utsname.h> #include <getopt.h> @@ -298,9 +299,37 @@ { "USER_NET", &SizeConstants::m_user_net }, { nullptr, nullptr } }; + /* get the running kernel flavour + if not default, try looking for the flavour-suffixed variable, + falling back to the defaul unsuffixed variable */ + struct utsname uts; + char *flavour; + + if (uname(&uts) >= 0 && + (flavour = strrchr(uts.release, '-')) && + *(++flavour) && + strcmp(flavour, "default")) { + DEBUG("Kernel flavour: %s", flavour); + } + else { + flavour = NULL; + DEBUG("Default kernel flavour"); + } + for (auto p = &vars[0]; p->name; ++p) { - char *val = std::getenv(p->name); - char *end; + char *val = NULL; + char *end; + if (flavour) { + std::string flavoured_name(p->name); + flavoured_name.append("_"); + flavoured_name.append(flavour); + val = std::getenv(flavoured_name.c_str()); + if (!val || !*val) + DEBUG("No value configured for %s, using %s", flavoured_name.c_str(), p->name); + } + if (!val || !*val) + val = std::getenv(p->name); + if (!val || !*val) throw std::runtime_error(std::string("No value configured for ") + p->name); this->*p->var = strtoll(val, &end, 10); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdump-2.1.0/kdumptool/kdumptool new/kdump-2.1.4/kdumptool/kdumptool --- old/kdump-2.1.0/kdumptool/kdumptool 2025-05-22 10:28:40.000000000 +0200 +++ new/kdump-2.1.4/kdumptool/kdumptool 2025-07-18 13:52:43.000000000 +0200 @@ -1,12 +1,5 @@ #!/bin/bash -# kdumptool used be a swiss-army knife program with lots of subcommands. -# Now the only remaining functionality is "kdumptool calibrate" used by YaST -# and possibly other tools to get crashkernel reservation info. -# So this is now a wrapper for the calibrate binary, carved out of the -# original kdumptool. - - function usage() { cat >&2 <<-__END @@ -24,7 +17,7 @@ -c check if the current options found in /proc/cmdline are equal to the expected values; print warnings if not -u call pbl to update the options to the expected values - (when used togerger with -c only update when needed) + (when used together with -c only update when needed) -U same as -u but only if KDUMP_UPDATE_BOOTLOADER is true -d call pbl to delete kdump-related kernel command line options -D same as -d but only if KDUMP_UPDATE_BOOTLOADER is true diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdump-2.1.0/packaging/suse/calibrate/README new/kdump-2.1.4/packaging/suse/calibrate/README --- old/kdump-2.1.0/packaging/suse/calibrate/README 2025-05-22 10:28:40.000000000 +0200 +++ new/kdump-2.1.4/packaging/suse/calibrate/README 2025-07-18 13:52:43.000000000 +0200 @@ -32,12 +32,19 @@ Macros: %_with_calibrate 1 :Macros + BuildFlags: allowrootforbuild:1 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 + + The calibrate needs the build to run as root (for stuff like starting + SSH or mounting filesystems). + allowrootforbuild in the project config allows this in OBS. + needsrootforbuild in the spec file turns on building as root. + For a local build you need to run osc build --userootforbuild --with calibrate 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 @@ -45,6 +52,7 @@ 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. + Make sure to wipe old binaries of the package (osc wipebinaries --all). It will extract calibrate.conf from all the built kdump binaries in the project and update calibrate.conf.all with the extracted values. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdump-2.1.0/packaging/suse/kdump.spec new/kdump-2.1.4/packaging/suse/kdump.spec --- old/kdump-2.1.0/packaging/suse/kdump.spec 2025-05-22 10:28:40.000000000 +0200 +++ new/kdump-2.1.4/packaging/suse/kdump.spec 2025-07-18 13:52:43.000000000 +0200 @@ -14,7 +14,7 @@ # Please submit bugfixes or comments via https://bugs.opensuse.org/ # - +#needsrootforbuild %bcond_with calibrate @@ -78,16 +78,26 @@ # so turn them on unconditionally # %if %{with calibrate} BuildRequires: %qemu -BuildRequires: dhcp-client +BuildRequires: udev +BuildRequires: systemd +BuildRequires: NetworkManager +BuildRequires: iproute2 +BuildRequires: dbus-1 +BuildRequires: hostname BuildRequires: dracut >= 047 BuildRequires: iputils BuildRequires: kernel-default +%ifarch aarch64 +BuildRequires: kernel-64kb +%endif BuildRequires: lftp BuildRequires: makedumpfile BuildRequires: openssh-clients +BuildRequires: openssh-server BuildRequires: pciutils BuildRequires: procps BuildRequires: python3 +BuildRequires: e2fsprogs %ifnarch s390x BuildRequires: qemu-ipxe BuildRequires: qemu-vgabios