diff -Nru makedumpfile-1.6.6/debian/50-kdump-tools.rules makedumpfile-1.6.6/debian/50-kdump-tools.rules --- makedumpfile-1.6.6/debian/50-kdump-tools.rules 2019-07-20 13:02:04.000000000 -0300 +++ makedumpfile-1.6.6/debian/50-kdump-tools.rules 2020-01-03 16:16:18.000000000 -0300 @@ -1,5 +1,5 @@ -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" +SUBSYSTEM=="memory", ACTION=="online", PROGRAM="/usr/sbin/kdump-config try-reload" +SUBSYSTEM=="memory", ACTION=="offline", PROGRAM="/usr/sbin/kdump-config try-reload" +SUBSYSTEM=="cpu", ACTION=="add", PROGRAM="/usr/sbin/kdump-config try-reload" +SUBSYSTEM=="cpu", ACTION=="remove", PROGRAM="/usr/sbin/kdump-config try-reload" +SUBSYSTEM=="cpu", ACTION=="online", PROGRAM="/usr/sbin/kdump-config try-reload" diff -Nru makedumpfile-1.6.6/debian/changelog makedumpfile-1.6.6/debian/changelog --- makedumpfile-1.6.6/debian/changelog 2019-08-06 12:18:15.000000000 -0300 +++ makedumpfile-1.6.6/debian/changelog 2020-01-03 16:30:05.000000000 -0300 @@ -1,3 +1,21 @@ +makedumpfile (1:1.6.6-2ubuntu2) eoan; urgency=medium + + [ Thadeu Lima de Souza Cascardo ] + * Add a reload command. (LP: #1828596) + * Use kdump-config reload after cpu or memory hotplug. (LP: #1828596) + * kdump-config: implement try-reload (LP: #1828596) + * udev: hotplug: use try-reload (LP: #1828596) + * Use reset_devices as a cmdline parameter. (LP: #1800566) + + [ Guilherme G. Piccoli ] + * Add a systemd-resolved service dependency in order to make kdump-tool + able to resolve DNS when in kdump boot. (LP: #1856323) + * x86_64: Fix an error due to makedumpfile being out-of-sync with recent + kernels. To achieve that, add the following patch: "Increase + SECTION_MAP_LAST_BIT to 4". (LP: #1857616) + + -- Guilherme G. Piccoli Fri, 03 Jan 2020 16:10:19 -0300 + makedumpfile (1:1.6.6-2ubuntu1) eoan; urgency=medium [ Thadeu Lima de Souza Cascardo ] diff -Nru makedumpfile-1.6.6/debian/kdump-config.in makedumpfile-1.6.6/debian/kdump-config.in --- makedumpfile-1.6.6/debian/kdump-config.in 2019-07-20 13:01:39.000000000 -0300 +++ makedumpfile-1.6.6/debian/kdump-config.in 2020-01-03 16:16:18.000000000 -0300 @@ -65,6 +65,7 @@ sys_fadump_enabled=/sys/kernel/fadump_enabled sys_fadump_registered=/sys/kernel/fadump_registered kexec_cmd_file=$KDUMP_COREDIR/kexec_cmd +lock_file=$KDUMP_COREDIR/kdump_lock # DUMP_MODE = kdump/fadump # The default dump mode is kdump. @@ -891,7 +892,47 @@ } +load() +{ + if [ "$DUMP_MODE" == "fadump" ]; then + check_fadump_support; + fadump_register + else + check_kdump_support; + kdump_create_symlinks $KVER; + manage_symlinks; + locate_kdump_kernel; + kdump_load + fi +} +unload() +{ + if [ "$DUMP_MODE" == "fadump" ]; then + fadump_unregister + else + kdump_unload + fi +} + +reload() +{ + unload + load +} + +condreload() +{ + local sys_loaded="$sys_kexec_crash" + if [ "$DUMP_MODE" == "fadump" ] ; then + check_fadump_support + sys_loaded="$sys_fadump_registered" + fi + flock 9 + if [ -e $sys_loaded -a `cat $sys_loaded` -eq 1 ] ; then + reload + fi +} case "$1" in test) @@ -916,23 +957,16 @@ kdump_show ;; load) - if [ "$DUMP_MODE" == "fadump" ]; then - check_fadump_support; - fadump_register - else - check_kdump_support; - kdump_create_symlinks $KVER; - manage_symlinks; - locate_kdump_kernel; - kdump_load - fi + load ;; unload) - if [ "$DUMP_MODE" == "fadump" ]; then - fadump_unregister - else - kdump_unload - fi + unload + ;; + reload) + reload + ;; + condreload|try-reload) + condreload 9>$lock_file ;; status) if [ "$DUMP_MODE" == "fadump" ]; then diff -Nru makedumpfile-1.6.6/debian/kdump-tools-dump.service makedumpfile-1.6.6/debian/kdump-tools-dump.service --- makedumpfile-1.6.6/debian/kdump-tools-dump.service 2019-07-20 11:25:01.000000000 -0300 +++ makedumpfile-1.6.6/debian/kdump-tools-dump.service 2020-01-03 16:16:18.000000000 -0300 @@ -1,7 +1,7 @@ [Unit] Description=Kernel crash dump capture service -Wants=network-online.target -After=network-online.target +Wants=network-online.target dbus.socket systemd-resolved.service +After=network-online.target dbus.socket systemd-resolved.service [Service] Type=oneshot diff -Nru makedumpfile-1.6.6/debian/patches/0003-Increase-SECTION_MAP_LAST_BIT-to-4.patch makedumpfile-1.6.6/debian/patches/0003-Increase-SECTION_MAP_LAST_BIT-to-4.patch --- makedumpfile-1.6.6/debian/patches/0003-Increase-SECTION_MAP_LAST_BIT-to-4.patch 1969-12-31 21:00:00.000000000 -0300 +++ makedumpfile-1.6.6/debian/patches/0003-Increase-SECTION_MAP_LAST_BIT-to-4.patch 2020-01-03 16:21:12.000000000 -0300 @@ -0,0 +1,37 @@ +Author: Kazuhito Hagio +Date: Tue, 23 Jul 2019 12:24:47 -0400 +Subject: Increase SECTION_MAP_LAST_BIT to 4 + +kernel commit 326e1b8f83a4 ("mm/sparsemem: introduce a SECTION_IS_EARLY +flag") added the flag to mem_section->section_mem_map value, and it caused +makedumpfile an error like the following: + + readmem: Can't convert a virtual address(fffffc97d1000000) to physical address. + readmem: type_addr: 0, addr:fffffc97d1000000, size:32768 + __exclude_unnecessary_pages: Can't read the buffer of struct page. + create_2nd_bitmap: Can't exclude unnecessary pages. + +To fix this, SECTION_MAP_LAST_BIT needs to be updated. The bit has not +been used until the addition, so we can just increase the value. + +Signed-off-by: Kazuhito Hagio +--- + makedumpfile.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/makedumpfile.h b/makedumpfile.h +index 24b2f69..df745b9 100644 +--- a/makedumpfile.h ++++ b/makedumpfile.h +@@ -195,7 +195,7 @@ isAnon(unsigned long mapping) + * 2. it has been verified that (1UL<<2) was never set, so it is + * safe to mask that bit off even in old kernels. + */ +-#define SECTION_MAP_LAST_BIT (1UL<<3) ++#define SECTION_MAP_LAST_BIT (1UL<<4) + #define SECTION_MAP_MASK (~(SECTION_MAP_LAST_BIT-1)) + #define NR_SECTION_ROOTS() divideup(num_section, SECTIONS_PER_ROOT()) + #define SECTION_NR_TO_PFN(sec) ((sec) << PFN_SECTION_SHIFT()) +-- +2.24.0 + diff -Nru makedumpfile-1.6.6/debian/patches/series makedumpfile-1.6.6/debian/patches/series --- makedumpfile-1.6.6/debian/patches/series 2019-07-20 11:25:01.000000000 -0300 +++ makedumpfile-1.6.6/debian/patches/series 2020-01-03 16:21:12.000000000 -0300 @@ -1,2 +1,3 @@ 0001-Remove-libebl-linkage.patch 0002-adapt-makefile-to-debian.patch +0003-Increase-SECTION_MAP_LAST_BIT-to-4.patch diff -Nru makedumpfile-1.6.6/debian/rules makedumpfile-1.6.6/debian/rules --- makedumpfile-1.6.6/debian/rules 2019-07-20 11:25:01.000000000 -0300 +++ makedumpfile-1.6.6/debian/rules 2020-01-03 16:16:18.000000000 -0300 @@ -7,7 +7,7 @@ SUBSTVARS = -Vdist:Depends="kexec-tools" endif -KDUMP_CMDLINE_APPEND = systemd.unit=kdump-tools-dump.service +KDUMP_CMDLINE_APPEND = reset_devices systemd.unit=kdump-tools-dump.service ifeq ($(DEB_HOST_ARCH),arm64) KDUMP_CMDLINE_APPEND += nr_cpus=1 else ifeq ($(DEB_HOST_ARCH),ppc64el)