Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package kdump for openSUSE:Factory checked in at 2024-05-20 18:09:41 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kdump (Old) and /work/SRC/openSUSE:Factory/.kdump.new.1880 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kdump" Mon May 20 18:09:41 2024 rev:146 rq:1174881 version:2.0.5 Changes: -------- --- /work/SRC/openSUSE:Factory/kdump/kdump.changes 2024-01-19 23:00:11.513631277 +0100 +++ /work/SRC/openSUSE:Factory/.kdump.new.1880/kdump.changes 2024-05-20 18:09:55.898638048 +0200 @@ -1,0 +2,13 @@ +Fri May 17 12:27:09 UTC 2024 - Jiri Bohac <jbo...@suse.com> + +- upgrade to version 2.0.5 + * spec: differentiate between uninstall and upgrade in postun/preun (bsc#1191410) + * spec: return success from pre, post, preun and postun scriplets (bsc#1222228) + * add a note to README.txt about the flattened format (bsc#1221374) + * use the same persistent device links as dracut (bsc#1222009, bsc#1219471) + * remove dracut parse-root.sh hook (bsc#1221288) + * always use nr_cpus, not maxcpus (bsc#1218180) + * prevent mounting root in fadump (bsc#1219958) + * update calibrate values + +------------------------------------------------------------------- Old: ---- kdump-2.0.1.tar.xz New: ---- kdump-2.0.5.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kdump.spec ++++++ --- /var/tmp/diff_new_pack.CnbTcD/_old 2024-05-20 18:09:56.578662806 +0200 +++ /var/tmp/diff_new_pack.CnbTcD/_new 2024-05-20 18:09:56.582662951 +0200 @@ -57,7 +57,7 @@ %define dracutlibdir %{_prefix}/lib/dracut Name: kdump -Version: 2.0.1 +Version: 2.0.5 Release: 0 Summary: Kernel crash dump scripts and utilities License: GPL-2.0-or-later @@ -89,8 +89,6 @@ BuildRequires: qemu-ipxe BuildRequires: qemu-vgabios %endif -BuildRequires: systemd-sysvinit -BuildRequires: util-linux-systemd %endif Requires: /usr/bin/sed Requires: dracut >= 047 @@ -184,6 +182,7 @@ %service_add_pre kdump.service %service_add_pre kdump-early.service %service_add_pre kdump-notify.service +exit 0 %post # change only permission if the file exists before /etc/sysconfig/kdump @@ -212,24 +211,35 @@ servicelog_notify --remove --command=/usr/lib/kdump/kdump-migrate-action.sh servicelog_notify --add --command=/usr/lib/kdump/kdump-migrate-action.sh --match='refcode="#MIGRATE" and serviceable=0' --type=EVENT --method=pairs_stdin %endif +exit 0 %preun %ifarch ppc64 ppc64le -servicelog_notify --remove --command=/usr/lib/kdump/kdump-migrate-action.sh +if [ $1 -eq 0 ]; then + # removal, not upgrade + servicelog_notify --remove --command=/usr/lib/kdump/kdump-migrate-action.sh +fi %endif echo "Stopping kdump ..." %service_del_preun kdump.service %service_del_preun kdump-early.service %service_del_preun kdump-notify.service +exit 0 %postun -# force regeneration of kdumprd -touch %{_sysconfdir}/sysconfig/kdump -# delete symbolic link -rm %{_localstatedir}/log/dump >/dev/null 2>&1 || true +if [ $1 -gt 0 ]; then + # upgrade + # force regeneration of kdumprd + touch %{_sysconfdir}/sysconfig/kdump +else + # removal + # delete symbolic link + rm %{_localstatedir}/log/dump >/dev/null 2>&1 || true +fi %service_del_postun kdump.service %service_del_postun kdump-early.service %service_del_postun kdump-notify.service +exit 0 %files %defattr(-,root,root) ++++++ calibrate.conf.all ++++++ --- /var/tmp/diff_new_pack.CnbTcD/_old 2024-05-20 18:09:56.634664845 +0200 +++ /var/tmp/diff_new_pack.CnbTcD/_new 2024-05-20 18:09:56.638664990 +0200 @@ -1,12 +1,12 @@ -alp1600.aarch64:INIT_CACHED=35308 -alp1600.aarch64:INIT_CACHED_NET=13196 -alp1600.aarch64:INIT_NET=4444 -alp1600.aarch64:KERNEL_BASE=93832 -alp1600.aarch64:KERNEL_INIT=23264 +alp1600.aarch64:INIT_CACHED=38920 +alp1600.aarch64:INIT_CACHED_NET=13580 +alp1600.aarch64:INIT_NET=4656 +alp1600.aarch64:KERNEL_BASE=79844 +alp1600.aarch64:KERNEL_INIT=25660 alp1600.aarch64:PAGESIZE=4096 -alp1600.aarch64:PERCPU=152 +alp1600.aarch64:PERCPU=144 alp1600.aarch64:SIZEOFPAGE=64 -alp1600.aarch64:USER_BASE=12132 +alp1600.aarch64:USER_BASE=14172 alp1600.aarch64:USER_NET=0 alp1600.i386:INIT_CACHED=42804 alp1600.i386:INIT_CACHED_NET=12916 @@ -18,46 +18,56 @@ alp1600.i386:SIZEOFPAGE=40 alp1600.i386:USER_BASE=13064 alp1600.i386:USER_NET=1868 -alp1600.ppc64:INIT_CACHED=92096 -alp1600.ppc64:INIT_CACHED_NET=20928 -alp1600.ppc64:INIT_NET=5056 -alp1600.ppc64:KERNEL_BASE=147840 -alp1600.ppc64:KERNEL_INIT=22208 +alp1600.ppc64:INIT_CACHED=85312 +alp1600.ppc64:INIT_CACHED_NET=21056 +alp1600.ppc64:INIT_NET=5184 +alp1600.ppc64:KERNEL_BASE=149184 +alp1600.ppc64:KERNEL_INIT=20544 alp1600.ppc64:PAGESIZE=65536 alp1600.ppc64:PERCPU=896 alp1600.ppc64:SIZEOFPAGE=64 -alp1600.ppc64:USER_BASE=87552 -alp1600.ppc64:USER_NET=4032 -alp1600.ppc64le:INIT_CACHED=81216 -alp1600.ppc64le:INIT_CACHED_NET=23616 -alp1600.ppc64le:INIT_NET=6336 -alp1600.ppc64le:KERNEL_BASE=146240 -alp1600.ppc64le:KERNEL_INIT=20224 +alp1600.ppc64:USER_BASE=47552 +alp1600.ppc64:USER_NET=1536 +alp1600.ppc64le:INIT_CACHED=89216 +alp1600.ppc64le:INIT_CACHED_NET=24128 +alp1600.ppc64le:INIT_NET=6528 +alp1600.ppc64le:KERNEL_BASE=136768 +alp1600.ppc64le:KERNEL_INIT=22272 alp1600.ppc64le:PAGESIZE=65536 alp1600.ppc64le:PERCPU=896 alp1600.ppc64le:SIZEOFPAGE=64 -alp1600.ppc64le:USER_BASE=40960 -alp1600.ppc64le:USER_NET=2112 -alp1600.s390x:INIT_CACHED=28560 -alp1600.s390x:INIT_CACHED_NET=12480 -alp1600.s390x:INIT_NET=4512 -alp1600.s390x:KERNEL_BASE=50036 -alp1600.s390x:KERNEL_INIT=14624 +alp1600.ppc64le:USER_BASE=45440 +alp1600.ppc64le:USER_NET=0 +alp1600.riscv64:INIT_CACHED=32504 +alp1600.riscv64:INIT_CACHED_NET=11580 +alp1600.riscv64:INIT_NET=5320 +alp1600.riscv64:KERNEL_BASE=107252 +alp1600.riscv64:KERNEL_INIT=23588 +alp1600.riscv64:PAGESIZE=4096 +alp1600.riscv64:PERCPU=144 +alp1600.riscv64:SIZEOFPAGE=64 +alp1600.riscv64:USER_BASE=12092 +alp1600.riscv64:USER_NET=1928 +alp1600.s390x:INIT_CACHED=31092 +alp1600.s390x:INIT_CACHED_NET=12644 +alp1600.s390x:INIT_NET=4564 +alp1600.s390x:KERNEL_BASE=46164 +alp1600.s390x:KERNEL_INIT=16312 alp1600.s390x:PAGESIZE=4096 -alp1600.s390x:PERCPU=148 +alp1600.s390x:PERCPU=136 alp1600.s390x:SIZEOFPAGE=64 -alp1600.s390x:USER_BASE=10280 -alp1600.s390x:USER_NET=1352 -alp1600.x86_64:INIT_CACHED=37336 -alp1600.x86_64:INIT_CACHED_NET=12928 -alp1600.x86_64:INIT_NET=5040 -alp1600.x86_64:KERNEL_BASE=108796 -alp1600.x86_64:KERNEL_INIT=23568 +alp1600.s390x:USER_BASE=12888 +alp1600.s390x:USER_NET=0 +alp1600.x86_64:INIT_CACHED=38308 +alp1600.x86_64:INIT_CACHED_NET=13152 +alp1600.x86_64:INIT_NET=5124 +alp1600.x86_64:KERNEL_BASE=86928 +alp1600.x86_64:KERNEL_INIT=24132 alp1600.x86_64:PAGESIZE=4096 alp1600.x86_64:PERCPU=292 alp1600.x86_64:SIZEOFPAGE=64 -alp1600.x86_64:USER_BASE=9232 -alp1600.x86_64:USER_NET=14408 +alp1600.x86_64:USER_BASE=15632 +alp1600.x86_64:USER_NET=0 leap150300.aarch64:INIT_CACHED=34920 leap150300.aarch64:INIT_CACHED_NET=9524 leap150300.aarch64:INIT_NET=3340 @@ -288,55 +298,55 @@ sle150500.x86_64:SIZEOFPAGE=64 sle150500.x86_64:USER_BASE=18320 sle150500.x86_64:USER_NET=4216 -sle150600.aarch64:INIT_CACHED=31832 -sle150600.aarch64:INIT_CACHED_NET=10384 -sle150600.aarch64:INIT_NET=3424 -sle150600.aarch64:KERNEL_BASE=82592 -sle150600.aarch64:KERNEL_INIT=17340 +sle150600.aarch64:INIT_CACHED=35400 +sle150600.aarch64:INIT_CACHED_NET=13468 +sle150600.aarch64:INIT_NET=4616 +sle150600.aarch64:KERNEL_BASE=94172 +sle150600.aarch64:KERNEL_INIT=21788 sle150600.aarch64:PAGESIZE=4096 -sle150600.aarch64:PERCPU=144 +sle150600.aarch64:PERCPU=152 sle150600.aarch64:SIZEOFPAGE=64 -sle150600.aarch64:USER_BASE=13620 -sle150600.aarch64:USER_NET=7968 -sle150600.ppc64le:INIT_CACHED=72832 -sle150600.ppc64le:INIT_CACHED_NET=17216 -sle150600.ppc64le:INIT_NET=3968 -sle150600.ppc64le:KERNEL_BASE=119744 -sle150600.ppc64le:KERNEL_INIT=16960 +sle150600.aarch64:USER_BASE=13644 +sle150600.aarch64:USER_NET=604 +sle150600.ppc64le:INIT_CACHED=79616 +sle150600.ppc64le:INIT_CACHED_NET=21248 +sle150600.ppc64le:INIT_NET=5248 +sle150600.ppc64le:KERNEL_BASE=151616 +sle150600.ppc64le:KERNEL_INIT=19968 sle150600.ppc64le:PAGESIZE=65536 sle150600.ppc64le:PERCPU=896 sle150600.ppc64le:SIZEOFPAGE=64 -sle150600.ppc64le:USER_BASE=62848 -sle150600.ppc64le:USER_NET=3136 -sle150600.s390x:INIT_CACHED=28240 -sle150600.s390x:INIT_CACHED_NET=9600 -sle150600.s390x:INIT_NET=3112 -sle150600.s390x:KERNEL_BASE=44856 -sle150600.s390x:KERNEL_INIT=12728 +sle150600.ppc64le:USER_BASE=52032 +sle150600.ppc64le:USER_NET=0 +sle150600.s390x:INIT_CACHED=31244 +sle150600.s390x:INIT_CACHED_NET=11916 +sle150600.s390x:INIT_NET=3928 +sle150600.s390x:KERNEL_BASE=49896 +sle150600.s390x:KERNEL_INIT=14772 sle150600.s390x:PAGESIZE=4096 -sle150600.s390x:PERCPU=140 +sle150600.s390x:PERCPU=144 sle150600.s390x:SIZEOFPAGE=64 -sle150600.s390x:USER_BASE=7568 -sle150600.s390x:USER_NET=12524 -sle150600.x86_64:INIT_CACHED=31096 -sle150600.x86_64:INIT_CACHED_NET=9704 -sle150600.x86_64:INIT_NET=3672 -sle150600.x86_64:KERNEL_BASE=97668 -sle150600.x86_64:KERNEL_INIT=17996 +sle150600.s390x:USER_BASE=14300 +sle150600.s390x:USER_NET=0 +sle150600.x86_64:INIT_CACHED=34220 +sle150600.x86_64:INIT_CACHED_NET=12532 +sle150600.x86_64:INIT_NET=4852 +sle150600.x86_64:KERNEL_BASE=93748 +sle150600.x86_64:KERNEL_INIT=21344 sle150600.x86_64:PAGESIZE=4096 -sle150600.x86_64:PERCPU=264 +sle150600.x86_64:PERCPU=276 sle150600.x86_64:SIZEOFPAGE=64 -sle150600.x86_64:USER_BASE=18624 -sle150600.x86_64:USER_NET=3424 -tumbleweed.aarch64:INIT_CACHED=35996 -tumbleweed.aarch64:INIT_CACHED_NET=13316 -tumbleweed.aarch64:INIT_NET=4608 -tumbleweed.aarch64:KERNEL_BASE=80040 -tumbleweed.aarch64:KERNEL_INIT=23512 +sle150600.x86_64:USER_BASE=15344 +sle150600.x86_64:USER_NET=0 +tumbleweed.aarch64:INIT_CACHED=38920 +tumbleweed.aarch64:INIT_CACHED_NET=13580 +tumbleweed.aarch64:INIT_NET=4656 +tumbleweed.aarch64:KERNEL_BASE=79844 +tumbleweed.aarch64:KERNEL_INIT=25660 tumbleweed.aarch64:PAGESIZE=4096 -tumbleweed.aarch64:PERCPU=152 +tumbleweed.aarch64:PERCPU=144 tumbleweed.aarch64:SIZEOFPAGE=64 -tumbleweed.aarch64:USER_BASE=12900 +tumbleweed.aarch64:USER_BASE=14172 tumbleweed.aarch64:USER_NET=0 tumbleweed.i386:INIT_CACHED=42804 tumbleweed.i386:INIT_CACHED_NET=12916 @@ -358,16 +368,16 @@ tumbleweed.ppc64:SIZEOFPAGE=64 tumbleweed.ppc64:USER_BASE=47552 tumbleweed.ppc64:USER_NET=1536 -tumbleweed.ppc64le:INIT_CACHED=84800 -tumbleweed.ppc64le:INIT_CACHED_NET=23872 -tumbleweed.ppc64le:INIT_NET=6464 -tumbleweed.ppc64le:KERNEL_BASE=145600 -tumbleweed.ppc64le:KERNEL_INIT=20736 +tumbleweed.ppc64le:INIT_CACHED=89216 +tumbleweed.ppc64le:INIT_CACHED_NET=24128 +tumbleweed.ppc64le:INIT_NET=6528 +tumbleweed.ppc64le:KERNEL_BASE=136768 +tumbleweed.ppc64le:KERNEL_INIT=22272 tumbleweed.ppc64le:PAGESIZE=65536 tumbleweed.ppc64le:PERCPU=896 tumbleweed.ppc64le:SIZEOFPAGE=64 -tumbleweed.ppc64le:USER_BASE=40832 -tumbleweed.ppc64le:USER_NET=5184 +tumbleweed.ppc64le:USER_BASE=45440 +tumbleweed.ppc64le:USER_NET=0 tumbleweed.riscv64:INIT_CACHED=32504 tumbleweed.riscv64:INIT_CACHED_NET=11580 tumbleweed.riscv64:INIT_NET=5320 @@ -378,24 +388,24 @@ tumbleweed.riscv64:SIZEOFPAGE=64 tumbleweed.riscv64:USER_BASE=12092 tumbleweed.riscv64:USER_NET=1928 -tumbleweed.s390x:INIT_CACHED=28560 -tumbleweed.s390x:INIT_CACHED_NET=12480 -tumbleweed.s390x:INIT_NET=4512 -tumbleweed.s390x:KERNEL_BASE=50036 -tumbleweed.s390x:KERNEL_INIT=14624 +tumbleweed.s390x:INIT_CACHED=31092 +tumbleweed.s390x:INIT_CACHED_NET=12644 +tumbleweed.s390x:INIT_NET=4564 +tumbleweed.s390x:KERNEL_BASE=46164 +tumbleweed.s390x:KERNEL_INIT=16312 tumbleweed.s390x:PAGESIZE=4096 -tumbleweed.s390x:PERCPU=148 +tumbleweed.s390x:PERCPU=136 tumbleweed.s390x:SIZEOFPAGE=64 -tumbleweed.s390x:USER_BASE=10280 -tumbleweed.s390x:USER_NET=1352 -tumbleweed.x86_64:INIT_CACHED=37336 -tumbleweed.x86_64:INIT_CACHED_NET=12928 -tumbleweed.x86_64:INIT_NET=5040 -tumbleweed.x86_64:KERNEL_BASE=108796 -tumbleweed.x86_64:KERNEL_INIT=23568 +tumbleweed.s390x:USER_BASE=12888 +tumbleweed.s390x:USER_NET=0 +tumbleweed.x86_64:INIT_CACHED=38308 +tumbleweed.x86_64:INIT_CACHED_NET=13152 +tumbleweed.x86_64:INIT_NET=5124 +tumbleweed.x86_64:KERNEL_BASE=86928 +tumbleweed.x86_64:KERNEL_INIT=24132 tumbleweed.x86_64:PAGESIZE=4096 tumbleweed.x86_64:PERCPU=292 tumbleweed.x86_64:SIZEOFPAGE=64 -tumbleweed.x86_64:USER_BASE=9232 -tumbleweed.x86_64:USER_NET=14408 +tumbleweed.x86_64:USER_BASE=15632 +tumbleweed.x86_64:USER_NET=0 ++++++ kdump-2.0.1.tar.xz -> kdump-2.0.5.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdump-2.0.1/NEWS new/kdump-2.0.5/NEWS --- old/kdump-2.0.1/NEWS 2024-01-18 14:45:37.000000000 +0100 +++ new/kdump-2.0.5/NEWS 2024-05-16 16:12:25.000000000 +0200 @@ -1,6 +1,26 @@ +2.0.5 +----- + * spec: differentiate between uninstall and upgrade in postun/preun (bsc#1191410) + +2.0.4 +----- + * spec: return success from pre, post, preun and postun scriplets (bsc#1222228) + +2.0.3 +----- + * add a note to README.txt about the flattened format (bsc#1221374) + * use the same persistent device links as dracut (bsc#1222009, bsc#1219471) + * remove dracut parse-root.sh hook (bsc#1221288) + +2.0.2 +----- + * always use nr_cpus, not maxcpus (bsc#1218180) + * prevent mounting root in fadump (bsc#1219958) + 2.0.1 ----- * load.sh: fix fadump (bsc#1218589) + 2.0.0 ----- * add support for riscv64 (bsc#1204214) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdump-2.0.1/doc/man/kdump.5.txt.in new/kdump-2.0.5/doc/man/kdump.5.txt.in --- old/kdump-2.0.1/doc/man/kdump.5.txt.in 2024-01-18 14:45:37.000000000 +0100 +++ new/kdump-2.0.5/doc/man/kdump.5.txt.in 2024-05-16 16:12:25.000000000 +0200 @@ -77,10 +77,10 @@ so you probably don't get the maximum speed if you set this parameter to the number of CPUs in your system. -This parameter modifies the _maxcpus_ parameter of the kdump kernel and +This parameter modifies the _nr_cpus_ parameter of the kdump kernel and the number of *makedumpfile*(8) processes created. -If the value is zero, all available CPUs are used, i.e. the _maxcpus_ +If the value is zero, all available CPUs are used, i.e. the _nr_cpus_ parameter is not added to the kdump kernel command line. Default is 1. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdump-2.0.1/dracut/init-fadump.c new/kdump-2.0.5/dracut/init-fadump.c --- old/kdump-2.0.1/dracut/init-fadump.c 2024-01-18 14:45:37.000000000 +0100 +++ new/kdump-2.0.5/dracut/init-fadump.c 2024-05-16 16:12:25.000000000 +0200 @@ -24,6 +24,7 @@ #include <stdlib.h> #include <string.h> #include <unistd.h> +#include <ctype.h> #include <linux/magic.h> #include <sys/mount.h> #include <sys/stat.h> @@ -39,6 +40,9 @@ #define DRACUT_INIT "/init.dracut" +#define KERNEL_CMDLINE (PROC_DIR "/cmdline") +#define MAX_COMMAND_LINE_SIZE 4096 + static int unlink_failure(const char *path) { fprintf(stderr, "Cannot unlink %s: %s\n", @@ -59,24 +63,6 @@ return -1; } -static int check_fadump(void) -{ - int err; - - if (mount(PROC, PROC_DIR, PROC, - MS_NOSUID|MS_NOEXEC|MS_NODEV, NULL)) - return mount_failure(PROC); - - err = access(PROC_VMCORE, F_OK); - - /* give a warning, but ignore errors */ - if (umount(PROC_DIR)) - fprintf(stderr, "Cannot unmount %s: %s\n", - PROC_DIR, strerror(errno)); - - return err; -} - static int execute(const char *prog, char *const *argv) { execv(prog, argv); @@ -225,9 +211,115 @@ return 0; } +/* copy kernel command line to the SYSTEMD_PROC_CMDLINE environment variable, + * replacing root=... with root=kdump rootflags=bind + */ +static int adjust_cmdline() +{ + FILE *in; + int c, in_quotes = 0, filter = 0; + const char match[] = "root="; + const char *match_pos = match; + char cmdline[MAX_COMMAND_LINE_SIZE]; + char *cmdline_pos = cmdline; + char *cmdline_end = cmdline + MAX_COMMAND_LINE_SIZE - 1; + int truncated = 0; + + in = fopen(KERNEL_CMDLINE, "r"); + if (!in) { + fprintf(stderr, "Cannot open %s: %s\n", + KERNEL_CMDLINE, strerror(errno)); + return -1; + } + + /* put root=kdump rootflags=bind on the beginning of cmdline */ + cmdline_pos = stpcpy(cmdline_pos, "root=kdump rootflags=bind "); + + /* copy original command line, filtering out root= */ + while ((c = fgetc(in)) != EOF) { + + if (c == '"') + in_quotes = !in_quotes; + + if (isspace(c) && !in_quotes) + /* new option, start matching */ + match_pos = match; + else if (match_pos) { + if (c == *match_pos) { + /* c is still matching */ + filter = 1; + ++match_pos; + if (! *match_pos) + match_pos = NULL; /* matched until the end of match */ + + } else { + /* c does not match */ + const char *m = match; + filter = 0; + + /* output the already matched part */ + for (m = match; m < match_pos; ++m) { + if (cmdline_pos >= cmdline_end) { + truncated = 1; + break; + } + *(cmdline_pos++) = *m; + } + + /* stop filtering, stop matching until next space */ + filter = 0; + match_pos = NULL; + } + } + + if (!filter) { + if (cmdline_pos >= cmdline_end) { + truncated = 1; + break; + } + *(cmdline_pos++) = c; + } + } + + fclose(in); + + *cmdline_pos = 0; + printf("Passing modified command line to systemd: %s\n", cmdline); + if (truncated) + fprintf(stderr, "Warning, command line truncated!\n"); + + if (setenv("SYSTEMD_PROC_CMDLINE", cmdline, 1)) { + fprintf(stderr, "Failed setting SYSTEMD_PROC_CMDLINE: %s\n", strerror(errno)); + return -1; + } + + return 0; +} + static int exec_next_init(int argc, char *const *argv) { - if (check_fadump()) { + int fadump = 0; + + /* temporarily mount /proc to: + * - check for /proc/vmcore to decide if we're in a fadump environment + * - pass a modified command line to systemd, replacing root=... with root=kdump + */ + if (mount(PROC, PROC_DIR, PROC, + MS_NOSUID|MS_NOEXEC|MS_NODEV, NULL)) + mount_failure(PROC); + else { + if (access(PROC_VMCORE, F_OK) == 0) { + fadump = 1; + adjust_cmdline(); + } + + /* give a warning, but ignore errors */ + if (umount(PROC_DIR)) + fprintf(stderr, "Cannot unmount %s: %s\n", + PROC_DIR, strerror(errno)); + } + + if (!fadump) { if (rename(DRACUT_INIT, argv[0])) { fprintf(stderr, "Cannot rename %s to %s: %s\n", DRACUT_INIT, argv[0], strerror(errno)); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdump-2.0.1/dracut/kdump-root.sh new/kdump-2.0.5/dracut/kdump-root.sh --- old/kdump-2.0.1/dracut/kdump-root.sh 2024-01-18 14:45:37.000000000 +0100 +++ new/kdump-2.0.5/dracut/kdump-root.sh 2024-05-16 16:12:25.000000000 +0200 @@ -1,11 +1,5 @@ -#! /bin/sh -# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- -# ex: ts=8 sw=4 sts=4 et filetype=sh - -# This script is sourced, so root should be set. But let's be paranoid -[ -z "$root" ] && root=$(getarg root=) - -# kdump initrd uses a special directory structure -if [ "$root" = "kdump" ]; then - rootok=1 -fi +#!/bin/sh +# we don't mount root in kdump +# prevent dracut from failing because it does not +# understand root=kdump +rootok=1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdump-2.0.1/dracut/kdump-save new/kdump-2.0.5/dracut/kdump-save --- old/kdump-2.0.1/dracut/kdump-save 2024-01-18 14:45:37.000000000 +0100 +++ new/kdump-2.0.5/dracut/kdump-save 2024-05-16 16:12:25.000000000 +0200 @@ -272,6 +272,7 @@ [[ $((KDUMP_VERBOSE & 2)) -ne 0 ]] && MSG_LEVEL=$((MSG_LEVEL | 1)) # progress DUMP_COMMAND="makedumpfile -F ${FORMAT} ${THREADS} --message-level $MSG_LEVEL -d ${KDUMP_DUMPLEVEL} ${MAKEDUMPFILE_OPTIONS} /proc/vmcore" + DUMP_INFO+=$'\n'"Note: vmcore saved in makedumpfile flattened format" fi # save the dump @@ -352,7 +353,7 @@ bash fi - mountpoint /kdump/mnt && umount /kdump/mnt + umount -q /kdump/mnt else echo "Dump saving completed. Running a shell; exit will reboot." diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdump-2.0.1/dracut/module-setup.sh new/kdump-2.0.5/dracut/module-setup.sh --- old/kdump-2.0.1/dracut/module-setup.sh 2024-01-18 14:45:37.000000000 +0100 +++ new/kdump-2.0.5/dracut/module-setup.sh 2024-05-16 16:12:25.000000000 +0200 @@ -155,14 +155,21 @@ # filter out problematic sysctl settings kdump_filter_sysctl "${initdir}" #FIXME needed? + # avoid dracut failing with root=kdump inst_hook cmdline 50 "$moddir/kdump-root.sh" + + # prevent mounting, fscking and waiting for root + mkdir -p "$initdir/etc/systemd/system-generators" + ln -s /dev/null "$initdir/etc/systemd/system-generators/dracut-rootfs-generator" + rm -f "$initdir/lib/dracut/hooks/cmdline/00-parse-root.sh" + inst_script "$moddir"/kdump-save /kdump/kdump-save inst_simple "$moddir/kdump-save.service" "$systemdsystemunitdir/kdump-save.service" mkdir -p "$initdir/$systemdsystemunitdir"/initrd.target.wants ln_r "$systemdsystemunitdir"/kdump-save.service \ "$systemdsystemunitdir"/initrd.target.wants/kdump-save.service - + # per-protocol config case ${KDUMP_PROTO} in ssh) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdump-2.0.1/init/load.sh new/kdump-2.0.5/init/load.sh --- old/kdump-2.0.1/init/load.sh 2024-01-18 14:45:37.000000000 +0100 +++ new/kdump-2.0.5/init/load.sh 2024-05-16 16:12:25.000000000 +0200 @@ -83,20 +83,6 @@ echo "${kdump_console}" } -# Get the name of kernel parameter to limit CPUs -function cpus_param() -{ - # nr_cpus does not work properly on ppc/ppc64/ppc64le - case $(uname -m) in - ppc*) - echo maxcpus - return 0 - ;; - esac - - echo nr_cpus -} - # # Builds the kdump command line from KDUMP_COMMANDLINE. function build_kdump_commandline() @@ -111,7 +97,7 @@ '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) if [ ${KDUMP_CPUS:-1} -ne 0 ] ; then - nr_cpus=$(cpus_param "$kdump_kernel")=${KDUMP_CPUS:-1} + nr_cpus="nr_cpus=${KDUMP_CPUS:-1}" fi commandline="$commandline sysrq=yes reset_devices acpi_no_memhotplug cgroup_disable=memory nokaslr" commandline="$commandline numa=off" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdump-2.0.1/init/mkdumprd new/kdump-2.0.5/init/mkdumprd --- old/kdump-2.0.1/init/mkdumprd 2024-01-18 14:45:37.000000000 +0100 +++ new/kdump-2.0.5/init/mkdumprd 2024-05-16 16:12:25.000000000 +0200 @@ -56,16 +56,9 @@ error "Cannot find mount point for ${KDUMP_SAVEDIR#*://}" # get persistent device name for SOURCE - local _symlink - for _symlink in $(udevadm info --root --query=symlink "$SOURCE") - do - case "$_symlink" in - */by-path/*|*/mapper/*) - SOURCE="$_symlink" - break - esac - done - + PSOURCE=$(get_persistent_dev "$SOURCE") + [[ -n $PSOURCE ]] && SOURCE=$PSOURCE + TARGET="${MOUNTPOINT}${TARGET}" KDUMP_DRACUT_MOUNT_OPTION="${SOURCE} ${TARGET} ${FS} ${OPTIONS}" ;; @@ -130,6 +123,48 @@ return 0 } + +# get_persistent_dev() and get_maj_min() taken from dracut + +# get_maj_min <device> +# Prints the major and minor of a device node. +# Example: +# $ get_maj_min /dev/sda2 +# 8:2 +get_maj_min() { + local _majmin + _majmin="$(stat -L -c '%t:%T' "$1" 2>/dev/null)" + printf "%s" "$((0x${_majmin%:*})):$((0x${_majmin#*:}))" +} + +# get a persistent path from a device +get_persistent_dev() { + local i _tmp _dev _pol + + _dev=$(get_maj_min "$1") + [ -z "$_dev" ] && return + + for i in \ + /dev/mapper/* \ + /dev/disk/by-uuid/* \ + /dev/disk/by-label/* \ + /dev/disk/by-partuuid/* \ + /dev/disk/by-partlabel/* \ + /dev/disk/by-id/* \ + /dev/disk/by-path/*; do + [[ -e $i ]] || continue + [[ $i == /dev/mapper/control ]] && continue + [[ $i == /dev/mapper/mpath* ]] && continue + _tmp=$(get_maj_min "$i") + if [ "$_tmp" = "$_dev" ]; then + printf -- "%s" "$i" + return + fi + done + printf -- "%s" "$1" +} + + function error() { echo "$1" >&2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdump-2.0.1/packaging/suse/kdump.spec new/kdump-2.0.5/packaging/suse/kdump.spec --- old/kdump-2.0.1/packaging/suse/kdump.spec 2024-01-18 14:45:37.000000000 +0100 +++ new/kdump-2.0.5/packaging/suse/kdump.spec 2024-05-16 16:12:25.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package kdump # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -15,6 +15,7 @@ # Please submit bugfixes or comments via https://bugs.opensuse.org/ # + %bcond_with calibrate %if 0%{?is_opensuse} @@ -56,7 +57,7 @@ %define dracutlibdir %{_prefix}/lib/dracut Name: kdump -Version: 1.0.2+git26.gc6fab38 +Version: 2.0.1 Release: 0 Summary: Kernel crash dump scripts and utilities License: GPL-2.0-or-later @@ -78,18 +79,16 @@ BuildRequires: dracut >= 047 BuildRequires: iputils BuildRequires: kernel-default +BuildRequires: lftp BuildRequires: makedumpfile -BuildRequires: procps +BuildRequires: openssh-clients BuildRequires: pciutils +BuildRequires: procps BuildRequires: python3 -BuildRequires: openssh-clients -BuildRequires: lftp %ifnarch s390x BuildRequires: qemu-ipxe BuildRequires: qemu-vgabios %endif -BuildRequires: systemd-sysvinit -BuildRequires: util-linux-systemd %endif Requires: /usr/bin/sed Requires: dracut >= 047 @@ -106,10 +105,10 @@ PreReq: /usr/bin/rm PreReq: /usr/bin/touch Recommends: cifs-utils -Recommends: nfs-client Recommends: lftp +Recommends: nfs-client Recommends: openssh-clients -Suggests: mailx +Suggests: mailx # update should detect the split-off from kexec-tools Provides: kexec-tools:%{_initddir}/kdump ExcludeArch: s390 ppc %arm32 @@ -153,7 +152,6 @@ # fails to exit make VERBOSE=1 - %check %ctest @@ -171,7 +169,7 @@ false fi %else -# save the distro_prefix +# 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 @@ -184,6 +182,7 @@ %service_add_pre kdump.service %service_add_pre kdump-early.service %service_add_pre kdump-notify.service +exit 0 %post # change only permission if the file exists before /etc/sysconfig/kdump @@ -212,24 +211,35 @@ servicelog_notify --remove --command=/usr/lib/kdump/kdump-migrate-action.sh servicelog_notify --add --command=/usr/lib/kdump/kdump-migrate-action.sh --match='refcode="#MIGRATE" and serviceable=0' --type=EVENT --method=pairs_stdin %endif +exit 0 %preun %ifarch ppc64 ppc64le -servicelog_notify --remove --command=/usr/lib/kdump/kdump-migrate-action.sh +if [ $1 -eq 0 ]; then + # removal, not upgrade + servicelog_notify --remove --command=/usr/lib/kdump/kdump-migrate-action.sh +fi %endif echo "Stopping kdump ..." %service_del_preun kdump.service %service_del_preun kdump-early.service %service_del_preun kdump-notify.service +exit 0 %postun -# force regeneration of kdumprd -touch %{_sysconfdir}/sysconfig/kdump -# delete symbolic link -rm %{_localstatedir}/log/dump >/dev/null 2>&1 || true +if [ $1 -gt 0 ]; then + # upgrade + # force regeneration of kdumprd + touch %{_sysconfdir}/sysconfig/kdump +else + # removal + # delete symbolic link + rm %{_localstatedir}/log/dump >/dev/null 2>&1 || true +fi %service_del_postun kdump.service %service_del_postun kdump-early.service %service_del_postun kdump-notify.service +exit 0 %files %defattr(-,root,root)