diff --git a/kdump-bootloader-grub2.patch b/kdump-bootloader-grub2.patch new file mode 100644 index 0000000..ad9f110 --- /dev/null +++ b/kdump-bootloader-grub2.patch @@ -0,0 +1,59 @@ +Date: Fri Sep 26 11:43:33 2014 +0200 +From: Petr Tesarik +Subject: kdump-Bootloader: add support for GRUB2 +References: bsc#889192 +Patch-mainline: v0.8.16 +Git-commit: 30d4271c72251c5f1c995d0580b19aa000ade1d6 + +GRUB2 is very different from the other bootloader, because the final +configuration file is generated by an external utility. This means +that the command line must be modified in the global settings instead +of the individual section. + +Signed-off-by: Petr Tesarik + +--- + init/kdump-bootloader.pl | 22 +++++++++++++++++----- + 1 file changed, 17 insertions(+), 5 deletions(-) + +--- a/init/kdump-bootloader.pl ++++ b/init/kdump-bootloader.pl +@@ -4,11 +4,19 @@ 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") { +- my $section = Bootloader::Tools::GetDefaultSection (); + print $section->{"append"}; + } elsif ($ARGV[0] eq "--update") { +- my $section = Bootloader::Tools::GetDefaultSection (); + my $input = $section->{"append"}; + my $result; + while (length($input)) { +@@ -28,9 +36,13 @@ if ($ARGV[0] eq "--get") { + shift @ARGV; + $result .= " " if length($result); + $result .= join(" ", @ARGV); +- $section->{"append"} = $result; +- $section->{"__modified"} = 1; +- Bootloader::Tools::SetGlobals(); ++ 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)"; + } diff --git a/kdump-enable-fadump-ppc64le.patch b/kdump-enable-fadump-ppc64le.patch new file mode 100644 index 0000000..f6bf448 --- /dev/null +++ b/kdump-enable-fadump-ppc64le.patch @@ -0,0 +1,33 @@ +Date: Wed Sep 24 13:56:42 2014 +0200 +From: Petr Tesarik +Subject: Enable FADUMP on ppc64le +References: bsc#889192 +Patch-mainline: v0.8.16 +Git-commit: 69bce53e9a02145e857bd4c36effcaf560a8f8cf + +The FADUMP feature is only available on IBM POWER systems, but the +new little-endian variant has a new CMAKE_SYSTEM_PROCESSOR value. + +Signed-off-by: Petr Tesarik + +--- + CMakeLists.txt | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -144,11 +144,11 @@ ENDIF(NOT LIBSSL_FOUND) + # Check for FADUMP + # + +-IF(“${CMAKE_SYSTEM_PROCESSOR}” STREQUAL “ppc64”) ++IF("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "ppc64(le)?") + SET(HAVE_FADUMP TRUE) +-ELSE(“${CMAKE_SYSTEM_PROCESSOR}” STREQUAL “ppc64”) ++ELSE() + SET(HAVE_FADUMP FALSE) +-ENDIF(“${CMAKE_SYSTEM_PROCESSOR}” STREQUAL “ppc64”) ++ENDIF() + + # + # Configure file diff --git a/kdump-fadump-bootloader-always.patch b/kdump-fadump-bootloader-always.patch new file mode 100644 index 0000000..8dda0dd --- /dev/null +++ b/kdump-fadump-bootloader-always.patch @@ -0,0 +1,44 @@ +Date: Fri Sep 26 08:10:38 2014 +0200 +From: Petr Tesarik +Subject: Always turn on fadump if KDUMP_FADUMP is true +References: bsc#889192 +Patch-mainline: v0.8.16 +Git-commit: 1f7e52d908f0ad2b2a33cdd374a8888bcf6f8234 + +The problem is that fadump-related files under /sys/kernel are +created only if the kernel is booted with fadump=on. So, this +is a chicken-and-egg problem, and a reboot is always necessary if +the current kernel is loaded without fadump=on. + +However, if the command line is not modified here, the admin must +first add fadump=on to the bootloader command line, and then enable +KDUMP_FADUMP, i.e. enable it in two different places. If the command +line is modified unconditionally, there is only one "big switch" for +FADUMP. + +Signed-off-by: Petr Tesarik + +--- + init/rc.kdump.functions | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/init/rc.kdump.functions ++++ b/init/rc.kdump.functions +@@ -259,6 +259,8 @@ function fadump_bootloader() + # Update fadump configuration + function load_kdump_fadump() + { ++ fadump_bootloader on ++ + if ! fadump_enabled; then + echo ": fadump is not enabled in the kernel." + rc_status -s +@@ -266,8 +268,6 @@ function load_kdump_fadump() + rc_exit + fi + +- fadump_bootloader on +- + # The kernel fails with EINVAL if registered already + # (see bnc#814780) + if [ "$(cat $FADUMP_REGISTERED)" != "1" ]; then diff --git a/kdump-fadump-keep-sysroot.patch b/kdump-fadump-keep-sysroot.patch new file mode 100644 index 0000000..308497f --- /dev/null +++ b/kdump-fadump-keep-sysroot.patch @@ -0,0 +1,59 @@ +Date: Fri Sep 26 15:50:05 2014 +0200 +From: Petr Tesarik +Subject: Keep /sysroot mount point if fadump is on +References: bsc#889192 +Patch-mainline: v0.8.16 +Git-commit: 4c1a5aac3df1e4ea2f0509c5b653083a02c1d4dc + +As FADUMP uses the normal initrd, the system must be able to boot up +eventually, so normal mount points are required. + +But mounting the same device twice may not be possible because of +conflicting mount options, so system root may not be mountable under +/kdump. In order to keep the kdump-specific mount point hierarchy, +convert any such mount to a bind mount from /sysroot. + +Signed-off-by: Petr Tesarik + +--- + init/module-setup.sh | 20 ++++++++++++++++++-- + 1 file changed, 18 insertions(+), 2 deletions(-) + +--- a/init/module-setup.sh ++++ b/init/module-setup.sh +@@ -126,17 +126,33 @@ install() { + kdump_map_mpath_wwid + for_each_host_dev_and_slaves_all kdump_add_mpath_dev + ++ # Convert system root mounts to bind mounts ++ if [ "$KDUMP_FADUMP" = "yes" ] ; then ++ local i line ++ for i in "${!fstab_lines[@]}" ++ do ++ line=( ${fstab_lines[i]} ) ++ if [ "${line[1]%/*}" = "/kdump" ] ; then ++ fstab_lines[i]="/sysroot ${line[1]} none bind" ++ fi ++ done ++ fi ++ + kdump_setup_files "$initdir" "$kdump_mpath_wwids" + + if dracut_module_included "systemd" ; then +- rm -f "${initdir}/$systemdutildir"/system-generators/dracut-rootfs-generator ++ [ "$KDUMP_FADUMP" != yes ] && \ ++ rm -f "${initdir}/$systemdutildir"/system-generators/dracut-rootfs-generator ++ + inst_simple /lib/kdump/save_dump.sh + inst_simple "$moddir/kdump-save.service" \ + "$systemdsystemunitdir"/kdump-save.service + ln_r "$systemdsystemunitdir"/kdump-save.service \ + "$systemdsystemunitdir"/initrd.target.wants/kdump-save.service + else +- inst_hook mount 30 "$moddir/mount-kdump.sh" ++ [ "$KDUMP_FADUMP" != yes ] && \ ++ inst_hook mount 30 "$moddir/mount-kdump.sh" ++ + inst_hook pre-pivot 90 /lib/kdump/save_dump.sh + fi + diff --git a/kdump-get-multipath-wwid-from-sysfs.patch b/kdump-get-multipath-wwid-from-sysfs.patch index 2579a6e..c0ac282 100644 --- a/kdump-get-multipath-wwid-from-sysfs.patch +++ b/kdump-get-multipath-wwid-from-sysfs.patch @@ -4,6 +4,7 @@ Subject: Get required multipath wwids from sysfs References: bnc#883883 Patch-mainline: v0.8.16 Git-commit: 4aa46801a53070dc0b0c27f4247cdc8e2b678694 +Git-commit: bb073caafcecfe667fba528c170f89bb29447a1d The dracut code path must use for_each_host_dev_and_slaves_all to find multipath devices that are "hidden" beneath e.g. an LVM volume. @@ -71,7 +72,7 @@ Signed-off-by: Petr Tesarik +{ + local f _dir _uuid _wwid _dev + for f in /sys/block/*/dm/uuid ; do -+ eval "_uuid=$(<$f)" 2>/dev/null ++ eval "_uuid=\$(<$f)" 2>/dev/null + [[ "$_uuid" = mpath-* ]] || continue + _dir="${f%/dm/uuid}" + _wwid=$(<"$_dir"/dm/name) diff --git a/kdump.changes b/kdump.changes index 200ba63..ab29cc6 100644 --- a/kdump.changes +++ b/kdump.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Fri Sep 26 14:13:54 UTC 2014 - ptesarik@suse.cz + +- kdump-enable-fadump-ppc64le.patch: Enable FADUMP on ppc64le + (bsc#889192). +- kdump-fadump-bootloader-always.patch: Always turn on fadump if + KDUMP_FADUMP is true (bsc#889192). +- kdump-bootloader-grub2.patch: kdump-Bootloader: add support for + GRUB2 (bsc#889192). +- kdump-fadump-keep-sysroot.patch: Keep /sysroot mount point if + fadump is on (bsc#889192). +- kdump-get-multipath-wwid-from-sysfs.patch: Refresh. + ------------------------------------------------------------------- Fri Sep 26 10:05:56 UTC 2014 - ptesarik@suse.cz diff --git a/kdump.spec b/kdump.spec index 9f60529..eeaef1a 100644 --- a/kdump.spec +++ b/kdump.spec @@ -76,6 +76,10 @@ Patch8: %{name}-get-multipath-wwid-from-sysfs.patch Patch9: %{name}-split-kdump_default_netdev.patch Patch10: %{name}-move-network-setup-to-module-setup.patch Patch11: %{name}-add-IPv6-KDUMP_NETCONFIG-modes.patch +Patch12: %{name}-enable-fadump-ppc64le.patch +Patch13: %{name}-fadump-bootloader-always.patch +Patch14: %{name}-bootloader-grub2.patch +Patch15: %{name}-fadump-keep-sysroot.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build # rename "kdump-helpers" (10.3) -> "kdump" (11.0/SP2) Provides: kdump-helpers = %{version} @@ -125,6 +129,10 @@ Authors: %patch9 -p1 %patch10 -p1 %patch11 -p1 +%patch12 -p1 +%patch13 -p1 +%patch14 -p1 +%patch15 -p1 %build export CFLAGS="%optflags"