diff -Nru makedumpfile-1.6.5/debian/50-kdump-tools.rules makedumpfile-1.6.5/debian/50-kdump-tools.rules --- makedumpfile-1.6.5/debian/50-kdump-tools.rules 2019-01-05 09:01:02.000000000 -0200 +++ makedumpfile-1.6.5/debian/50-kdump-tools.rules 2019-08-28 09:39:25.000000000 -0300 @@ -1,4 +1,5 @@ -SUBSYSTEM=="memory", ACTION=="online", PROGRAM="/bin/systemctl try-restart kdump-tools.service" -SUBSYSTEM=="memory", ACTION=="offline", PROGRAM="/bin/systemctl try-restart kdump-tools.service" -SUBSYSTEM=="cpu", ACTION=="add", PROGRAM="/bin/systemctl try-restart kdump-tools.service" -SUBSYSTEM=="cpu", ACTION=="remove", PROGRAM="/bin/systemctl try-restart kdump-tools.service" +SUBSYSTEM=="memory", ACTION=="online", PROGRAM="/bin/systemctl reset-failed kdump-tools.service ; /bin/systemctl try-restart kdump-tools.service" +SUBSYSTEM=="memory", ACTION=="offline", PROGRAM="/bin/systemctl reset-failed kdump-tools.service ; /bin/systemctl try-restart kdump-tools.service" +SUBSYSTEM=="cpu", ACTION=="add", PROGRAM="/bin/systemctl reset-failed kdump-tools.service ; /bin/systemctl try-restart kdump-tools.service" +SUBSYSTEM=="cpu", ACTION=="remove", PROGRAM="/bin/systemctl reset-failed kdump-tools.service ; /bin/systemctl try-restart kdump-tools.service" +SUBSYSTEM=="cpu", ACTION=="online", PROGRAM="/bin/systemctl reset-failed kdump-tools.service ; /bin/systemctl try-restart kdump-tools.service" diff -Nru makedumpfile-1.6.5/debian/changelog makedumpfile-1.6.5/debian/changelog --- makedumpfile-1.6.5/debian/changelog 2019-02-07 09:22:23.000000000 -0200 +++ makedumpfile-1.6.5/debian/changelog 2019-08-28 09:39:25.000000000 -0300 @@ -1,3 +1,19 @@ +makedumpfile (1:1.6.5-1ubuntu1~18.04.2) bionic; urgency=medium + + [ Guilherme G. Piccoli ] + * Add kdump retry/delay mechanism when dumping over network (LP: #1681909) + + [ Thadeu Lima de Souza Cascardo ] + * Use maxcpus instead of nr_cpus on ppc64el. (LP: #1828597) + * Reload kdump when CPU is brought online. (LP: #1828596) + * Allow proper reload of kdump after multiple hotplug events. (LP: #1828596) + * ppc64: increase MAX_PHYSMEM_BITS to 2PB (LP: #1841288) + + [ Connor Kuehl ] + * Let the kernel decide the crashkernel offset for ppc64el (LP: #1741860) + + -- Thadeu Lima de Souza Cascardo Wed, 28 Aug 2019 09:39:25 -0300 + makedumpfile (1:1.6.5-1ubuntu1~18.04.1) bionic; urgency=low * Backport back to bionic. (LP: #1655280) (LP: #1790788) diff -Nru makedumpfile-1.6.5/debian/kdump-config.in makedumpfile-1.6.5/debian/kdump-config.in --- makedumpfile-1.6.5/debian/kdump-config.in 2019-01-05 09:01:02.000000000 -0200 +++ makedumpfile-1.6.5/debian/kdump-config.in 2019-08-28 09:39:25.000000000 -0300 @@ -50,6 +50,8 @@ KDUMP_NUM_DUMPS=${KDUMP_NUM_DUMPS:=0} NFS_TIMEO=${NFS_TIMEO:=600} NFS_RETRANS=${NFS_RETRANS:=3} +NFS_MOUNT_RETRY=${NFS_MOUNT_RETRY:=4} +SSH_KDUMP_RETRY=${SSH_KDUMP_RETRY:=16} MAKEDUMP_ARGS=${MAKEDUMP_ARGS:="-c -d 31"} KDUMP_CMDLINE_APPEND=${KDUMP_CMDLINE_APPEND:="@KDUMP_CMDLINE_APPEND@"} KDUMP_KERNEL_HOOK="/etc/kernel/postinst.d/kdump-tools" @@ -647,8 +649,21 @@ # if [ -n "$NFS" ];then log_action_msg "Mounting NFS mountpoint $NFS ..." - mount -t nfs -o nolock -o tcp -o soft -o timeo=${NFS_TIMEO} -o retrans=${NFS_RETRANS} $NFS $KDUMP_COREDIR - ERROR=$? + MOUNTOPTS="-o nolock -o tcp -o soft -o timeo=${NFS_TIMEO} -o retrans=${NFS_RETRANS}" + + CNT=${NFS_MOUNT_RETRY} + while [ $CNT -ne 0 ];do + mount -t nfs $MOUNTOPTS $NFS $KDUMP_COREDIR + ERROR=$? + if [ $ERROR -eq 0 ];then + CNT=0 + else + ((CNT--)) + log_action_msg "Network not reachable; will try $CNT more times" + sleep 3 + fi + done + if [ $ERROR -ne 0 ];then log_failure_msg "$NAME: Unable to mount remote NFS directory $NFS. Cannot save core" logger -t $NAME "Unable to mount remote NFS directory $NFS. Cannot save core" @@ -759,14 +774,23 @@ KDUMP_COREFILE="$KDUMP_STAMPDIR/dump.$KDUMP_STAMP" KDUMP_TMPDMESG="/tmp/dmesg.$KDUMP_STAMP" KDUMP_DMESGFILE="$KDUMP_STAMPDIR/dmesg.$KDUMP_STAMP" - ERROR=0 - ssh -i $KDUMP_SSH_KEY $KDUMP_REMOTE_HOST mkdir -p $KDUMP_STAMPDIR - ERROR=$? - # If remote connections fails, no need to continue - if [ $ERROR -ne 0 ] ; then - log_failure_msg "$NAME: Unable to reach remote server $KDUMP_REMOTE_HOST. No reason to continue" - logger -t $NAME "Unable to reach remote server $KDUMP_REMOTE_HOST. No reason to continue" + CNT=${SSH_KDUMP_RETRY} + while [ $CNT -ne 0 ];do + ssh -i $KDUMP_SSH_KEY $KDUMP_REMOTE_HOST mkdir -p $KDUMP_STAMPDIR + ERROR=$? + if [ $ERROR -eq 0 ];then + CNT=0 + else + ((CNT--)) + log_action_msg "Network not reachable; will try $CNT more times" + sleep 3 + fi + done + + if [ $ERROR -ne 0 ]; then + log_failure_msg "$NAME: Unable to reach remote server $KDUMP_REMOTE_HOST; can't continue" + logger -t $NAME "Unable to reach remote server $KDUMP_REMOTE_HOST; can't continue" return 1 fi diff -Nru makedumpfile-1.6.5/debian/kdump-tools.grub.ppc64el makedumpfile-1.6.5/debian/kdump-tools.grub.ppc64el --- makedumpfile-1.6.5/debian/kdump-tools.grub.ppc64el 2019-01-05 09:01:02.000000000 -0200 +++ makedumpfile-1.6.5/debian/kdump-tools.grub.ppc64el 2019-08-28 09:39:25.000000000 -0300 @@ -1 +1 @@ -GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT crashkernel=2G-4G:320M,4G-32G:512M,32G-64G:1024M,64G-128G:2048M,128G-:4096M@128M" +GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT crashkernel=2G-4G:320M,4G-32G:512M,32G-64G:1024M,64G-128G:2048M,128G-:4096M" diff -Nru makedumpfile-1.6.5/debian/patches/0003-PATCH-ppc64-increase-MAX_PHYSMEM_BITS-to-2PB.patch makedumpfile-1.6.5/debian/patches/0003-PATCH-ppc64-increase-MAX_PHYSMEM_BITS-to-2PB.patch --- makedumpfile-1.6.5/debian/patches/0003-PATCH-ppc64-increase-MAX_PHYSMEM_BITS-to-2PB.patch 1969-12-31 21:00:00.000000000 -0300 +++ makedumpfile-1.6.5/debian/patches/0003-PATCH-ppc64-increase-MAX_PHYSMEM_BITS-to-2PB.patch 2019-08-28 09:39:25.000000000 -0300 @@ -0,0 +1,44 @@ +From: Hari Bathini +Date: Tue, 4 Dec 2018 16:19:38 +0530 +Subject: [PATCH] ppc64: increase MAX_PHYSMEM_BITS to 2PB + +* Required for kernel 4.20 + +With kernel commit 4ffe713b7587 ("powerpc/mm: Increase the max addressable +memory to 2PB"), MAX_PHYSMEM_BITS is bumped up to 51 for SPARSEMEM_VMEMMAP +and SPARSEMEM_EXTREME case. Make the appropriate update here. + +Signed-off-by: Hari Bathini +--- + arch/ppc64.c | 5 +++++ + makedumpfile.h | 1 + + 2 files changed, 6 insertions(+) + +diff --git a/arch/ppc64.c b/arch/ppc64.c +index 947a125..5b8231e 100644 +--- a/arch/ppc64.c ++++ b/arch/ppc64.c +@@ -486,6 +486,11 @@ set_ppc64_max_physmem_bits(void) + || (array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT()))) + return TRUE; + ++ info->max_physmem_bits = _MAX_PHYSMEM_BITS_4_20; ++ if ((array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT_EXTREME())) ++ || (array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT()))) ++ return TRUE; ++ + return FALSE; + } + +diff --git a/makedumpfile.h b/makedumpfile.h +index 73813ed..d49f1f1 100644 +--- a/makedumpfile.h ++++ b/makedumpfile.h +@@ -672,6 +672,7 @@ unsigned long get_kvbase_arm64(void); + #define _MAX_PHYSMEM_BITS_ORIG (44) + #define _MAX_PHYSMEM_BITS_3_7 (46) + #define _MAX_PHYSMEM_BITS_4_19 (47) ++#define _MAX_PHYSMEM_BITS_4_20 (51) + #define REGION_SHIFT (60UL) + #define VMEMMAP_REGION_ID (0xfUL) + diff -Nru makedumpfile-1.6.5/debian/patches/series makedumpfile-1.6.5/debian/patches/series --- makedumpfile-1.6.5/debian/patches/series 2019-01-05 09:01:02.000000000 -0200 +++ makedumpfile-1.6.5/debian/patches/series 2019-08-28 09:39:25.000000000 -0300 @@ -1,2 +1,3 @@ 0001-Remove-libebl-linkage.patch 0002-adapt-makefile-to-debian.patch +0003-PATCH-ppc64-increase-MAX_PHYSMEM_BITS-to-2PB.patch diff -Nru makedumpfile-1.6.5/debian/rules makedumpfile-1.6.5/debian/rules --- makedumpfile-1.6.5/debian/rules 2019-01-14 15:42:44.000000000 -0200 +++ makedumpfile-1.6.5/debian/rules 2019-08-28 09:39:25.000000000 -0300 @@ -7,13 +7,13 @@ SUBSTVARS = -Vdist:Depends="kexec-tools" endif -KDUMP_CMDLINE_APPEND = nr_cpus=1 systemd.unit=kdump-tools-dump.service +KDUMP_CMDLINE_APPEND = systemd.unit=kdump-tools-dump.service ifeq ($(DEB_HOST_ARCH),arm64) - # pass + KDUMP_CMDLINE_APPEND += nr_cpus=1 else ifeq ($(DEB_HOST_ARCH),ppc64el) - KDUMP_CMDLINE_APPEND += irqpoll noirqdistrib nousb + KDUMP_CMDLINE_APPEND += maxcpus=1 irqpoll noirqdistrib nousb else - KDUMP_CMDLINE_APPEND += irqpoll nousb ata_piix.prefer_ms_hyperv=0 + KDUMP_CMDLINE_APPEND += nr_cpus=1 irqpoll nousb ata_piix.prefer_ms_hyperv=0 endif %: