diff options
author | Thadeu Lima de Souza Cascardo <cascardo@debian.org> | 2018-10-16 15:30:16 -0300 |
---|---|---|
committer | Thadeu Lima de Souza Cascardo <cascardo@debian.org> | 2018-10-16 15:30:16 -0300 |
commit | 545f05a3f60281ee4f6711d92ba4fae7ce9a49a4 (patch) | |
tree | 3f00322a0fe3f3aeb57498cf21f802584b9949fc | |
parent | edad422003b3f542856d3d5dbf0fe0dc6727d4d4 (diff) | |
parent | 498c1f0fa3593c8246956bcfafc78eb277fae5e0 (diff) |
makedumpfile (1:1.6.4-3) unstable; urgency=medium
* Reload kdump after memory/CPU hotplug. (LP: #1655280)
* Fix adding crashkernel to zipl.conf when no quotation mark is used.
(LP: #1790788)
[dgit import unpatched makedumpfile 1:1.6.4-3]
46 files changed, 3922 insertions, 0 deletions
diff --git a/debian/50-kdump-tools.rules b/debian/50-kdump-tools.rules new file mode 100644 index 0000000..b05e7c0 --- /dev/null +++ b/debian/50-kdump-tools.rules @@ -0,0 +1,4 @@ +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" diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..c208738 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,1101 @@ +makedumpfile (1:1.6.4-3) unstable; urgency=medium + + * Reload kdump after memory/CPU hotplug. (LP: #1655280) + * Fix adding crashkernel to zipl.conf when no quotation mark is used. + (LP: #1790788) + + -- Thadeu Lima de Souza Cascardo <cascardo@debian.org> Tue, 16 Oct 2018 15:30:16 -0300 + +makedumpfile (1:1.6.4-2) unstable; urgency=medium + + * Ignore uninstalled kernels when doing the kernel postinst. (Closes: #904524) + + -- Thadeu Lima de Souza Cascardo <cascardo@debian.org> Thu, 26 Jul 2018 10:02:40 -0300 + +makedumpfile (1:1.6.4-1) unstable; urgency=medium + + * New upstream release. Main new features: + o 5-level paging support + - 5-level paging on x86_64 system is supported from this version. + + o --mem-usage support for arm64 + - The makedumpfile --mem-usage option is now supported on arm64 system. + And the option was also tested on ppc64 and s390x by Bhupesh Sharma. + + o Support new kernels + - The supported kernel is updated to 4.17.0 in this version. + + * Changelog: + o New feature + - [PATCH v2 0/3] arm64: Add '--mem-usage' support (Bhupesh Sharma) f49ca13 + - [PATCH v2 1/3] Add a new helper file 'tools.c' that provides some useful APIs (Bhupesh Sharma) 4d86cc7 + - [PATCH v2 2/3] arm64: Add support to read symbols like _stext from '/proc/kallsyms' (Bhupesh Sharma) d1e7805 + - [PATCH v2 3/3] Documentation: Update documentation regarding --mem-usage' option (Bhupesh Sharma) 8449bda + - [PATCH 0/4] Add 5-level paging support (Baoquan He) 342fdab + - [PATCH 2/4] Add pgtable_l5_enabled to number_table (Baoquan He) 8ae6f36 + - [PATCH 3/4] Add a new function check_5level_paging() (Baoquan He) 33ca808 + - [PATCH 4/4] arch/x86_64: Add 5-level paging support (Dou Liyang) 30a3214 + - [PATCH] handle mem_section as either a pointer or an array (Thadeu Lima de Souza Cascardo) 14876c4 + - [PATCH] ppc64: Increase the VA range (Hari Bathini) bd1ae9c + + o Bugfix + - [PATCH] sadump: Fix a problem of PTI enabled kernel (Takao Indoh) 38de12a + - [PATCH] Fix a bug when multi-threads feature meets enospace (Zhou Wenjian) 63b05c9 + - [PATCH] Fix array index out of bound exception (Lianbo Jiang) e5f96e7 + - [PATCH] fix for hugepages filtering (Hari Bathini) 246801c + - [PATCH v2] Use integer arithmetics for the progress bar (Petr Tesarik) c6b79cb + - [PATCH 2/2] Check PG_swapbacked for swap cache pages (Petr Tesarik) ca1f31e + - [PATCH] Fix -g for change of mem_section (Kazuhito Hagio) f3c87e0 + - [PATCH] Fix -i for KASLR (Kazuhito Hagio) 08db98c + - [PATCH] Fix validate_mem_section() (Kazuhito Hagio) 8f1aafa + - [PATCH] arm64: Fix calculation of page_offset in case we are running cases other than mem-usage (Bhupesh Sharma) cb7af5f + + o Cleanup + - [PATCH v2] Always use bigger SECTION_MAP_MASK (Petr Tesarik) 6c6789f + - [PATCH 1/2] Add is_cache_page() helper to check if a page belongs to the cache (Petr Tesarik) 694f28c + - [PATCH 1/4] arch/x86_64: Cleanup the address translation of the 4-level page tables (Dou Liyang) acab2a2 + - [PATCH] Fix some compilation warnings on x86 system (Kazuhito Hagio) 2148e43 + - [PATCH] Update maintainers (Masaki Tachibana) bc7420b + + * Remove 0003-sparsemem_extreme.patch, applied upstream. + * Update pt_PT debconf translation, thanks Rui Branco. (Closes: #898280) + * Update ru debconf translation, thanks Lev Lamberov. (Closes: #883139) + * Update da debconf translation, thanks Joe Dalton. (Closes: #856784) + * Make ADT check for systemd service. + * Skip test if crashkernel was not reserved. + + -- Thadeu Lima de Souza Cascardo <cascardo@debian.org> Thu, 19 Jul 2018 16:34:06 -0300 + +makedumpfile (1:1.6.3-2) unstable; urgency=medium + + * Add support for SPARSEMEM_EXTREME mem_section as a pointer. (LP: #1750021) + * Add an autopkgtest that test that a crash produces a compressed dump + file. + * Create initrd for previously installed kernels. (LP: #1751329) + + -- Thadeu Lima de Souza Cascardo <cascardo@debian.org> Mon, 05 Mar 2018 09:28:55 -0300 + +makedumpfile (1:1.6.3-1) unstable; urgency=medium + + * New upstream release. Main new feature: + o Support new kernels + - The supported kernel is updated to 4.14.8 in this version. (LP: #1746299) + 4.14.9 and later can't be filtered correctly due to inappropriate VMCOREINFO, + it will be resolved in kernel 4.15. + + * Changelog: + o New feature + - [PATCH v2] x86_64: Take care of init_level4_pgt rename in kernel (by Pratyush Anand) 64bd5db + - [PATCH v2] Fix SECTION_MAP_MASK for kernel >= v.13 (by Pratyush Anand) 4bf4f2b + - [PATCH v2] book3s/ppc64: Lower the max real address to 53 bits for kernels >= v4.11 + (by Bhupesh Sharma) 6c83e74 + - [PATCH v3 1/4] Support symbol __cpu_online_mask (by Takao Indoh) 3b11c00 + - [PATCH] ppc64: update hash page table geometry (by Hari Bathini) 3c39f13 + - [PATCH] handle renamed init_level4_pgt -> init_top_pgt (by Jeff Mahoney) 5e54d53 + + o Bugfix + - [PATCH v2] arm64: Fix page table walk of 1GB section (by Bradley Bolen) 27508f1 + - [PATCH v2 1/2] ppc64: set page_offset in get_versiondep_info_ppc64() (by Pingfan Liu) 52319d2 + - [PATCH v2 2/2] ppc64: get the info of mem reserved for crashkernel (by Pingfan Liu) c7fcbbc + - [PATCH v3 3/4] sadump: Fix a KASLR problem of sadump (by Takao Indoh) b4f7d95 + - [PATCH v3 4/4] sadump: Fix a KASLR problem of sadump while kdump is working (by Takao Indoh) 13d3059 + - [PATCH 2/2] Fix 'kernel_version' variable being uninitialized & introduce minor reorganization + (by Bhupesh Sharma) d1ffe82 + - [PATCH 1/2] Fix off-by-one errors in exclude_segment() (by Petr Tesarik) 590f35e + - [PATCH 2/2] Fix physical-to-virtual conversion in exclude_segment() (by Petr Tesarik) 6c1bf2a + + o Cleanup + - [PATCH] Fix formatting problems in header file (by Eric DeVolder) cefea9e + - [PATCH v3 2/4] Introduce vtop4_x86_64_pagetable (by Takao Indoh) 6de5d37 + - [PATCH 1/2] Fix compilation warnings on ppc64/ppc64le platforms (by Bhupesh Sharma) 0df157a + - [PATCH] Make good use of is_cyclic_region() (by Atsushi Kumagai) 6bfd7a3 + - [PATCH] Fix the regression about getting kernel version (by Atsushi Kumagai) 254c116 + - [PATCH] Update maintainers (by Atsushi Kumagai) 9d3147e + + * Use multi-user.target. (LP: #1708409) + * kdump-tools Recommends initramfs-tools-core. + * Add myself as uploader. + * Move Vcs control fields to salsa. + + -- Thadeu Lima de Souza Cascardo <cascardo@debian.org> Tue, 06 Feb 2018 12:53:14 -0200 + +makedumpfile (1:1.6.2-2) unstable; urgency=medium + + [ dann frazier ] + * Make the kdump kernel cmdline consistent in comments, code & docs. + * Set reasonable default cmdlines for arm64. (Closes: 883899) + * ppc64el: Remove ata_piix.prefer_ms_hyperv=0 from crashkernel cmdline + * ppc64el: add noirqdistrib to command line. (LP: #1658733) + * Add myself to Uploaders. + * Build-Depend on debhelper (>= 9.20160709) instead of dh-systemd, + which is obsolete. Thanks lintian. + + [ Thadeu Lima de Souza Cascardo ] + * Set crashkernel for ppc64el to load at 128M instead of 32M. That allows + larger kernels to boot. (LP: #1728115) + + -- dann frazier <dannf@debian.org> Fri, 12 Jan 2018 08:47:19 -0700 + +makedumpfile (1:1.6.2-1) unstable; urgency=medium + + [ Thadeu Lima de Souza Cascardo ] + * Add ucf support + + /etc/default/kdump-tools was already changed by the maintainer script, + so it should not be a conffile. ucf allows the maintainer scripts to ask + the user about changes done by the user to the config file. + + Invoking debconf first in the script is desired, because the frontend + might exec and invoke the script itself again. Also, we install the + generated file instead of the original file, as we will replace some of + the settings. (Closes: 877250) + + -- Louis Bouchard <louis@ubuntu.com> Wed, 01 Nov 2017 14:50:26 +0100 + +makedumpfile (1:1.6.2-0.1) unstable; urgency=medium + + * Non-maintainer upload. + + * New upstream release. Main new feature: + o Support for sparc64 + - sparc64 is supported from this version, it's tested on kernel-4.1.12. + + o Add new option for --dump-dmesg + - Introduce the new option "--partial-dmesg", it can exclude the buffers + cleared by "dmesg --clear" while the current --dump-dmesg always extracts + the whole ring buffer. + + o Support new kernels + - The supported kernel is updated to 4.11 in this version. + + * Changelog: + o New feature + - [PATCH] Add initial sparc64 support (by Tom Hromatka) 001d9b7 + - [PATCH v5 1/2] Add runtime kaslr offset if it exists (by Pratyush Anand) + 2bfb7f1 + - [PATCH v5 2/2] x86_64: Calculate page_offset in case of re-filtering/ + sadump/virsh dump (by Pratyush Anand) 4944f93 + - [PATCH v2] Add the --partial-dmesg option to dump only non-cleared dmesg + (by Ivan Delalande) ec5da81 + - [PATCH v3 1/2] Fold the calc of time delta into a func (by Pingfan Liu) + 1192446 + - [PATCH v3 2/2] print_info: Show the remaining time of dump progress (by + Pingfan Liu) 3438e8d + + o Bugfix + - [PATCH] elf_info.c: fix memory leak in get_kcore_dump_loads() (by Pingfan + Liu) f10d1e2 + - [PATCH] Error on re-filtering the dump file with no free pages (by + Mikhail Zaslonko) deb8e1f + - [PATCH] Fix get_kcore_dump_loads() error case (by Pratyush Anand) a569d63 + - [PATCH] sadump: set info->page_size before cache_init() (by Hatayama, + Daisuke) b98e6e0 + - [PATCH] Fix the use of Xen physical and machine addresses (by Petr + Tesarik) e765785 + - [PATCH V3] elf_info: Fix file_size if segment is excluded (by Pratyush + Anand) 88731c7 + - [PATCH v3] Prevent data loss in last page of ELF core dumpfile (by Eric + DeVolder) 622f0d7 + - [PATCH] Consider not page-size aligned phys_end for paddr_to_pfn() (by + Atsushi Kumagai) 25259e6 + - [PATCH] Fix the regression caused by moving cache_init() earlier (by + Atsushi Kumagai) be0461f + + o Cleanup + - [PATCH 1/4] eppic: Rename scripts to reflect validity of kernel version + (by Kamalesh Babulal) b55b29f + - [PATCH 2/4] eppic/vhost_net_buffers: Introduce changes for kernel 3.19 + (by Kamalesh Babulal) 0a1d8ee + - [PATCH 3/4] eppic/dir_names: Introduce changes for kernel 3.14 (by + Kamalesh Babulal) 5c822a7 + - [PATCH 4/4] eppic/keyring: Introduce changes for kernel 4.4 (by Kamalesh + Babulal) 19fe701 + - [PATCH v3 1/7] show_mem_usage(): calculate page offset after elf load (by + Pratyush Anand) 4b0bed3 + - [PATCH v3 2/7] initial(): call cache_init() a bit early (by Pratyush + Anand) 8e2834b + - [PATCH v3 3/7] x86_64: check physical address in PT_LOAD for none direct + mapped regions (by Pratyush Anand) f136302 + - [PATCH v3 4/7] elf_info: kcore: check for invalid physical address (by + Pratyush Anand) f4ab689 + - [PATCH v3 5/7] makedumpfile: Correct the calculation of kvaddr in + set_kcore_vmcoreinfo (by Baoquan He) 4c53423 + - [PATCH v3 6/7] makedumpfile: Discard process_dump_load (by Baoquan He) + f3ff8c6 + - [PATCH v3 7/7] mem-usage: allow to work only with -f for kernel version < + 4.11 (by Pratyush Anand) 78cbb40 + - [PATCH] Fix typo in the ERRMSG of function show_mem_usage (by Eric + Desrochers) ade8512 (Closes: #857051) + - [PATCH] Fix other typos in messages (by Atsushi Kumagai) b171374 + - [PATCH] Fix compiler warnings (by Eric DeVolder) 04dab93 + + * Update debian patches to latest release. + + * Add file to the list of kdump-tools dependencies, it's used by + kdump-config. + + * Add watch file. + + -- Thadeu Lima de Souza Cascardo <cascardo@debian.org> Fri, 08 Sep 2017 16:21:35 -0300 + +makedumpfile (1:1.6.1-2) sid; urgency=medium + + * d/kernel-postinst-generate-initrd : Add scsi_dh_* modules if in + use so the system can dump a crash when root is on multipath + (LP: #1635597) (Closes: 862411) + + [ dann frazier ] + * Select appropriate /etc/default/grub.d/kdump-tools.cfg at build time. + A side-effect of this is that kdump-tools is no longer Arch: all. + (Closes: #863858) + + -- Louis Bouchard <louis@ubuntu.com> Wed, 16 Aug 2017 16:10:01 +0200 + +makedumpfile (1:1.6.1-1) sid; urgency=medium + + * New upstream release. Main new feature: + o Support new kernels + - The supported kernel is updated to 4.8 in this version. + + * Changelog: + o New feature + - [PATCH v2] Support _count -> _refcount rename in struct page (by Vitaly + Kuznetsov) ed46b6a + - [PATCH 1/8] ppc64: fix vtop page translation for 4K pages (by Hari + Bathini) cf02f88 + - [PATCH 2/8] ppc64: Use kernel terminology for each level in 4-level page + table (by Hari Bathini) 37abbe1 + - [PATCH 3/8] ppc64: address changes in kernel v4.5 (by Hari Bathini) + bc86b61 + - [PATCH 4/8] ppc64: address change in _PAGE_PRESNT flag for PowerISA v3.0 + (by Hari Bathini) 3003fbe + - [PATCH 5/8] ppc64: use physical addresses and unfold pud for 64K page + size (by Hari Bathini) afe7f9f + - [PATCH 6/8] ppc64: support big endian Linux page tables (by Hari + Bathini) f3d7cc5 + - [PATCH 7/8] ppc64: use the same masked bit values for 4K and 64K + pagesizes (by Hari Bathini) 398746a + - [PATCH 8/8] ppc64: enable address translation support for radix mmu (by + Hari Bathini) ed65d60 + - [PATCH 01/10] arm64: cleanup code, comment, blank space, blank lines etc + (by Pratyush Anand) c42c582 + - [PATCH 02/10] read_vmcoreinfo_long: Allow to read hex values as well (by + Pratyush Anand) b01fa28 + - [PATCH 03/10] Introduce read_vmcoreinfo_ulong() (by Pratyush Anand) + edc314e + - [PATCH 04/10] arm64: use already available PAGESIZE() and PAGESHIFT() + macros (by Pratyush Anand) 48581a7 + - [PATCH 05/10] arm64: fix page_offset definition (by Pratyush Anand) + a4335c6 + - [PATCH 06/10] arm64: fix re-filtering (by Pratyush Anand) 618b76c + - [PATCH 07/10] arm64: use value of VA_BITS and PHYS_OFFSET embedded into + vmcore (by Pratyush Anand) 74df822 + - [PATCH 08/10] arm64: immunize identity mapped address finding w.r.t. + kernel changes (by Pratyush Anand) a84f726 + - [PATCH 09/10] arm64: Add support for 4level 4K page translations table + (by Azriel Samson) 969ee30 + - [PATCH 10/10] arm64: fix memory layout as per changes in v4.6 kernel (by + Pratyush Anand) b6fe70c + + o Bugfix + - [PATCH 1/2] sadump: fix segmentation fault on sadump-related formats (by + HATAYAMA Daisuke) 0ba14bc + - [PATCH 2/2] sadump: fix wrong progress report on sadump formats (by + HATAYAMA Daisuke) d5d268b + - [PATCH] Fix module init base and size offset for kernel v4.5 (by + Guenther Hutzl) 32dd468 + - [PATCH] Fix uninitialized file descriptors for parallel dump (by Atsushi + Kumagai) 1474dd4 + - [PATCH] x86_64: Set zero to phys_base for the kernel older than 2.6.22 + (by Atsushi Kumagai) 114060b + + o Cleanup + - [PATCH] Add more descriptions of multi-threads feature (by Zhou Wenjian) + 2af8d6a + - [PATCH v2] Cleanup: Use a negative number for uninitialized file + descriptors (by Petr Tesarik) 8b8fa9f + - [PATCH v3 1/3] open_dump_bitmap: open bitmap file in non-cyclic case (by + Martin Wilck) a8d8657 + - [PATCH v3 2/3] move call to open_dump_bitmap() to after call to + initial() (by Martin Wilck) 3696c40 + - [PATCH v3 3/3] close_dump_bitmap: simplify logic (by Martin Wilck) + c1c53f8 + - [PATCH v2 1/2] Adapt code to get value of phys_base (by Baoquan He) + acdbb1d + - [PATCH V2 1/4] x86_64: Calculate page_offset from pt_load (by Pratyush + Anand) 0c9dd01 + - [PATCH V2 2/4] x86_64: translate all VA to PA using page table values + (by Pratyush Anand) c41e33c + - [PATCH V2 3/4] x86_64: kill is_vmalloc_addr_x86_64() (by Pratyush Anand) + 8419f4d + - [PATCH V2 4/4] x86_64: kill some unused initialization (by Pratyush + Anand) ecb3719 + - [PATCH v2 2/2] Clean up unused KERNEL_IMAGE_SIZE (by Atsushi Kumagai) + 0068010 + + * Debian specific changes : + - d/control: + Update Vcs-Git field to new URL + Add lsb-base dependency to kdump-tools to avoid lintian error + - Fix Readme.Debian : + Replace nmi_watchdog=1 to nmi_watchdog=panic for x86 and x86_64 arch + (Closes: 824094) + Mention Magic SysRq key (Closes: 793753) + + -- Louis Bouchard <louis.bouchard@ubuntu.com> Thu, 05 Jan 2017 11:07:16 +0100 + +makedumpfile (1:1.6.0-4) unstable; urgency=medium + + * Turn hardcoded timeo and retrans NFS options into parameters that + can be modified in /etc/default/kdump-tools. Also use the NFS defaults + (timeo=600, retrans=3) for these parameters. Make those values visible + in the 'show' command if NFS is configured (Closes: 847920) + + * Add translation file for : + [ Chris Leick <c.leick@vollbio.de> ] + - German (Closes: 842494) + + -- Louis Bouchard <louis.bouchard@ubuntu.com> Mon, 12 Dec 2016 12:32:29 +0100 + +makedumpfile (1:1.6.0-3) sid; urgency=medium + + * d/p/0003-PATCH-v2-Support-_count-_refcount-rename-in-struct-p.patch, + d/p/0004-fix-readpage_elf-attempt-to-read-non-existent-page.patch + Fix makedumpfile failure on 4.8 kernels. + - Makedumpfile will exit on error with the following message : + get_mem_map: Can't distinguish the memory type. (LP: #1626269) + - Fix readpage_elf: Attempt to read non-existent page errors after + previous patch is applied (Closes: #842019) + + [ Robert Collins ] + * Support Hyper-V hypervisors. + Per https://support.microsoft.com/en-us/kb/2858695 the ata_piix driver + will attempt to create a second connection to the hypervisor + while the original kernel is still connected, which fails.(Closes: #824525) + + * Add translation files for : + [ Adriano Rafael Gomes ] + - Brazilian Portuguese (Closes: #834935) + [ Frans Spiesschaert ] + - Dutch (Closes: #834609) + [ Jean-Pierre Giraud ] + - French (Closes: #832006) + + [ Rinat ] + * Fix double-quote handling in /proc/cmdline + Parsing of the cmdline would fail if double-quotes are encountered + in /proc/cmdine (i.e. like when things like "acpi_osi=!Windows 2012" + are found in the cmdline). (Closes: #835600) + + * Raise debian compatibility level to 9 + * Fix spelling error in debian/control + + -- Louis Bouchard <louis.bouchard@ubuntu.com> Mon, 07 Nov 2016 11:56:10 +0100 + +makedumpfile (1:1.6.0-2.1) unstable; urgency=medium + + * Non-maintainer upload. + * Import fixes from ubuntu + * Remove hugepages/hugepagesz from kdump's cmdline. (LP: #1634132) + - Chris J Arges <chris.j.arges@ubuntu.com> + * Build on arm64. LP: #1238110, Closes: 791963 + - <doko@ubuntu.com> + + -- Riku Voipio <riku.voipio@linaro.org> Fri, 28 Oct 2016 16:06:52 +0300 + +makedumpfile (1:1.6.0-2) sid; urgency=medium + + * define_stampdir() : Loop on hostname -I for 5 sec to get IP address + if HOSTTAG=ip. The network stack may not be ready when kdump-config runs. + Give it some time before reverting HOSTTAG to hostname if an IP address + cannot be found. (LP: #1599561) + + * debian/rules : drop the dh_installinit override + Uses a syntax which is no longer supported and generate an error on + install. (LP: #1599491) + + -- Louis Bouchard <louis.bouchard@ubuntu.com> Fri, 15 Jul 2016 17:25:33 +0200 + +makedumpfile (1:1.6.0-1) sid; urgency=medium + + * New upstream version includes : + o Exclude page structures of non-dumped pages + - Add the new option "-e" to exclude the page structures which correspond + to excluded pages. This option will bring a great performance, but it + will harm analyticity a little bit. Please see the note below: + + NOTE: If you specify this option, crash will show the message below + and the 'kmem' command will not work. + + This dumpfile is incomplete because the page structures associated + with excluded pages may also be excluded. This may cause the crash + session to fail entirely, may cause commands to fail (most notably + the "kmem" command), or may result in unpredictable runtime behavior. + + Now this option supports only x86_64. + + o Support new kernels + - The supported kernel is updated to 4.5 in this version. + + Changelog: + o New feature + - [PATCH V7] Exclude page structures of non-dumped pages. (by Cliff Wickman) 46176a9 + - [PATCH 1/4] ARM64: Refactor code to support multiple page level. (by Pratyush Anand) 28a4729 + - [PATCH 2/4] ARM64: Decide VA Bits on the basis of _stext symbol value. (by Pratyush Anand) a93301d + - [PATCH 3/4] ARM64: Fix KVBASE. (by Pratyush Anand) ec85257 + - [PATCH 4/4] ARM64: Fix for ARM64 3 level translation tables. (by Sameer Goel) c92a63d + + o Bugfix + - [PATCH] Fix bitmap buffer release code. (by Atsushi Kumagai) 7556e69 + - [PATCH 1/3] Keep segment memory size when re-filtering ELF dumps (by Petr Tesarik) 606fe8c + - [PATCH 2/3] Mark unstored ELF pages as filtered (by Petr Tesarik) 1cdabcd + - [PATCH 3/3] Rewrite readpage_elf (by Petr Tesarik) 7a7cebc + - [PATCH] Looking for page.compound_order/compound_dtor to exclude hugepages + (by Atsushi Kumagai) 5bc1f52 + - [PATCH] Skip examining compound tail pages (by Atsushi Kumagai) 13b4233 + - [PATCH] arm64: fix two level pmd calculation (by Pratyush Anand) 6759c72 + - [PATCH] Fix module core base and size offset for kernel v4.5 (by Pratyush Anand) fa6a75a + - [PATCH] Fix deleted macro by mistake for ia64 (by Atsushi Kumagai) cfe652e + - [PATCH] Fix boundary value bug for checking memory holes (by Atsushi Kumagai) 11a6dae + - [PATCH] Skip null entries to walk page tables correctly (by Atsushi Kumagai) ecf7a13 + - [PATCH] Fix read data corruption for multi thread feature. (by Atsushi Kumagai) ae848e8 + + o Cleanup + - [PATCH] Remove useless definitions of return value. (by Atsushi Kumagai) 3d32567 + - [PATCH] Clean up the in-accurate message printing about mmap (by Baoquan He) 2b8c001 + - [PATCH v8] Improve the performance of --num-threads -d 31 (by Zhou Wenjian) dfa2447 + - [PATCH] Fix compilation warning (by Pratyush Anand) 7dda810 + - [PATCH] Fix compilation warnings for x86_64 (by Atsushi Kumagai) 27b5fb5 + - [PATCH] Fix man page to add -p option (by Atsushi Kumagai) e444aad + - [PATCH] Fix compilation warning (by Andrey Skvortsov) 484c6b1 + + * Debian specific enhancements : + [kdump-tools] Add missing unit to crashkernel parameter + [d/p/0001-Remove-libebl-linkage.patch] Adapt to new upstream vers. + + * Debian specific modifications dropped : + d/p/0003-support-kernel-4.2.patch] Fixed upstream + + -- Louis Bouchard <louis.bouchard@ubuntu.com> Fri, 10 Jun 2016 11:33:13 +0200 + +makedumpfile (1:1.5.9-7) sid; urgency=medium + + * [d/rules] Lower kexec-tools dependency to -2 + The ubuntu merge will happen on an 1:2.0.10-2 version so it cannot + depends on -3. + + -- Louis Bouchard <louis.bouchard@ubuntu.com> Tue, 31 May 2016 14:36:07 +0200 + +makedumpfile (1:1.5.9-6) sid; urgency=medium + + * [ Juerg Haefliger <juerg.haefliger@hp.com> ] + + Limit the number of dumps kept on the local machine + + Introduce a new config variable KDUMP_NUM_DUMPS that specifies how + many dumps should be kept on the machine. This can be use to prevent + running out of disk space. It is ignored if remote dumping (ssh or nfs) + is enabled. If there are too many dump files, older dumps are purged but + only after the current dump operation succeeded. + + * [ Linn Crosetto <linn@hp.com> ] + + kdump-config: add support for UEFI Secure Boot + + kdump-config needs to query the state of UEFI Secure Boot in order to correctly + use kexec to boot the crash kernel. Specifically, kexec needs the "-s" option + to use the kexec_file_load system call to validate the image before loading it. + (Closes: #823003) + + * [Hari Bathini <hbathini@linux.vnet.ibm.com>] + + Fix networked kdump failure to reach remote server. Avoids + "Network is unreachable" message when trying to do remote dumps on either + SSH or NFS. (LP: #1571590) + + * Add support for architecture-specific crashkernel param + + On Debian, the crashkernel boot parameter is left undefined. On Ubuntu + it was defined in the kexec-tools package, modified specifically. + + This parameter is now defined by the kdump-tools package and uses an + architecture-specific file containing the definition. A generic symlink + called /etc/default/grub.d/kdump-tools.cfg points to the architecture + specific file. + + The default values are : + + - All but ppc64el : 128M + - ppc64el : 2G-4G:320M,4G-32G:512M,32G-64G:1024M,64G-128G:2048M,128G-:4096M@32M + + (LP: #1567539) + On s390x architecture, the crashkernel parameter is added to the + /etc/zipl.conf file. + + /etc/default/kdump-tools is also modified to use the cio_ignore parameter + when kexec loads the crash kernel (LP: #1570775) + + -- Louis Bouchard <louis.bouchard@ubuntu.com> Tue, 26 May 2016 15:28:43 +0200 + +makedumpfile (1:1.5.9-5) sid; urgency=medium + + [ Hendrik Brueckner ] + * Build makedumpfile for s390x (Closes: #710674) + * Enable LZO compression for makedumpfile + + -- Louis Bouchard <louis.bouchard@ubuntu.com> Wed, 10 Feb 2016 10:14:37 +0100 + +makedumpfile (1:1.5.9-4) sid; urgency=medium + + * Allow for symlinks to be created for vmlinux files : On Power8 + architecture, systems are booting from a vmlinux file. The symlink + /var/lib/kdump/vmlinuz has to point to this file. (LP: #1536904) + + * Add functionality to create symlinks for older kernels : If kdump + is installed on systems with more than one kernel package, the smaller + initrd.img file will only be created for the latest kernel. Adding the + 'symlinks' functionality will allow for the creation of symlinks to + older kernels. If the smaller initrd.img file is missing in /var/lib/kdump + it will be created beforehand. This will be preempted if kdump is already + loaded. (LP: #1537714) + + * Fix kdump-config manpage : add documentation for the propagate option. + (LP: #1538148) + + * Improve manpage for kdump-config + + -- Louis Bouchard <louis.bouchard@ubuntu.com> Tue, 26 Jan 2016 15:30:48 +0100 + +makedumpfile (1:1.5.9-3) sid; urgency=medium + + * debian/patches/0003-support-kernel-4.2.patch : + Fix packaging AGAIN so the patch is correctly applied. + Previous upload missed it somehow. + + -- Louis Bouchard <louis.bouchard@ubuntu.com> Wed, 09 Dec 2015 15:53:54 +0100 + +makedumpfile (1:1.5.9-2) sid; urgency=medium + + * debian/patches/0003-support-kernel-4.2.patch : + Fix packaging error so the patch is correctly applied + + -- Louis Bouchard <louis.bouchard@ubuntu.com> Mon, 07 Dec 2015 15:58:42 +0100 + +makedumpfile (1:1.5.9-1) sid; urgency=medium + + * New upstream version includes : + o Parallel compression + - Add the new option "--num-threads" to enable parallel compression + for faster processing. This option intends parallel compression + while --split intends parallel i/o, they try to solve different + bottlenecks. + + o Change the way to choose the non-cyclic mode + - Add the new option "--work-dir" to specify the directory used to + store the bitmap. This is the alternative to the combination of + --non-cyclic and TMPDIR. + + o Support new kernels + - The supported kernel is updated to 4.2 in this version. + + Changelog: + o New feature + - [PATCH] Support ARM64. (by Pratyush Anand) 94d47d1 + - [PATCH 1/2] Enable compressed dump formats for Xen. (by Petr Tesarik) 349a0ed + - [PATCH 2/2] Remove notes about ELF being the only available format for Xen dumps. + (by Petr Tesarik) 5cab480 + - [PATCH v5 01/10] Add readpage_kdump_compressed_parallel. (by Qiao Nuohan) 5fab021 + - [PATCH v5 02/10] Add mappage_elf_parallel. (by Qiao Nuohan) edca232 + - [PATCH v5 03/10] Add readpage_elf_parallel. (by Qiao Nuohan) 7f15b41 + - [PATCH v5 04/10] Add read_pfn_parallel. (by Qiao Nuohan) a7243fe + - [PATCH v5 05/10] Add function to initial bitmap for parallel use. (by Qiao Nuohan) 56a6bc4 + - [PATCH v5 06/10] Add filter_data_buffer_parallel. (by Qiao Nuohan) 2a7cb9f + - [PATCH v5 07/10] Add write_kdump_pages_parallel to allow parallel process. (by Qiao Nuohan) c2595d9 + - [PATCH v5 08/10] Initial and free data used for parallel process. (by Qiao Nuohan) 4538848 + - [PATCH v5 09/10] Make makedumpfile available to read and compress pages parallelly. + (by Qiao Nuohan) b265102 + - [PATCH v5 10/10] Add usage and manual about multiple threads process. (by Qiao Nuohan) b18a8a6 + + o Bugfix + - [PATCH] Correct vmap_area_list support for i386 and ppc32. (by Atsushi Kumagai) 4194d7b + - [PATCH] Free pages aren't removed in non-cyclic mode. (by Atsushi Kumagai) d64cf7f + - [PATCH v2] Fix a bug in generating incomplete kdump core. (by Zhou Wenjian) 9cee495 + - [PATCH] Remove the double free of sph. (by Chao Fan) 72dec41 + - [PATCH 1/2] sadump: Change bit order. (by HATAYAMA Daisuke) 5f15256 + - [PATCH 2/2] sadump: Perform explicit zero page filtering. (by HATAYAMA Daisuke) 19b3a91 + + o Cleanup + - [PATCH 01/13] Organize bitmap structure for cyclic logic. (by Atsushi Kumagai) 5fc24bf + - [PATCH 02/13] Add option to specify working directory for the bitmap. (by Atsushi Kumagai) 5c5a8b8 + - [PATCH 03/13] Integrate the entry point of is_dumpable(). (by Atsushi Kumagai) 5c8c680 + - [PATCH 04/13] Integrate the main logic of writing kdump file. (by Atsushi Kumagai) d18796d + - [PATCH 05/13] Communalize the function for creating 1st bitmap. (by Atsushi Kumagai) b00a7b0 + - [PATCH 06/13] Remove the old logic of writing kdump pages. (by Atsushi Kumagai) 4d55542 + - [PATCH 07/13] Integrate filtering process for ELF path. (by Atsushi Kumagai) 679a818 + - [PATCH 08/13] Remove the old logic of writing ELF pages. (by Atsushi Kumagai) 672354b + - [PATCH 09/13] Adjust --mem-usage path to the new code. (by Atsushi Kumagai) 57153b0 + - [PATCH 10/13] Adjust --split/--reassemble path to the new code. (by Atsushi Kumagai) 95435de + - [PATCH 11/13] Adjust refiltering path to the new code. (by Atsushi Kumagai) c7fb41c + - [PATCH 12/13] Adjust sadump path to the new code. (by Atsushi Kumagai) edd2bf2 + - [PATCH 13/13] Remove --non-cyclic option. (by Atsushi Kumagai) a117ae9 + - [PATCH] Optimise the function reserve_diskspace. (by Zhou Wenjian) 3605073 + - [PATCH v2] Add description of pages lost by ENOSPACE in IMPLEMENTATION. (by Zhou Wenjian) 0e20f33 + - [PATCH 1/2] Enable compressed dump formats for Xen. (by Petr Tesarik) 349a0ed + - [PATCH 2/2] Remove notes about ELF being the only available format for Xen dumps. + (by Petr Tesarik) 5cab480 + - [PATCH v2] Code changes to satisfy the coverity scan. (by Chao Fan) 0c65e38 + - [PATCH] Improve performance for parallel compression with zlib. (by Atsushi Kumagai) 3ef6629 + + * Debian specific enhancements : + + - kdump-tools now make use of smaller initrd.img files created in + /var/lib/kdump. This avoid optential OOM when the size of the initrd.img + becomes larger (LP: #1496317). Implementation details are : + + o New kernel hooks are added to create smaller initrd.img files when new + kernel packages are installed : + /etc/kernel/postrm.d/kdump-tools + /etc/kernel/postinst.d/kdump-tools + + o kdump-config is responsible for the maintenance of symbolic links used + to point to the appropriate vmlinuz & initrd files. Link maintenance + is done at each boot by kdump-config. New links will point to the + files named after the running kernel. + + o The KDUMP_KERNEL and KDUMP_INITRD configuration variables are now + now enabled and use the symbolic links : + /var/lib/kdump/vmlinuz + /var/lib/kdump/initrd.img + + o kdump-config has been adapted to show the symbolic link information + + - kdump-tools is now enabled by default. When installed a prompt will + propose to override the default value. + + -- Louis Bouchard <louis.bouchard@ubuntu.com> Tue, 24 Nov 2015 12:38:06 +0100 + +makedumpfile (1:1.5.8-4) sid; urgency=medium + + * Add cherry-pick of commits b859e0a, f1cea98, 3cc296c, 70ce1a2, + 0423186 and 9e18e42 that were missed between 1.5.7-5 and 1.5.8-1 + (Closes: #793485) + + -- Louis Bouchard <louis.bouchard@ubuntu.com> Mon, 27 Jul 2015 16:23:48 +0200 + +makedumpfile (1:1.5.8-3) sid; urgency=medium + + * Makes sysVinit script execution contitional to the + use of upstart. Closes: 789058 + + -- Louis Bouchard <louis.bouchard@ubuntu.com> Wed, 17 Jun 2015 15:10:42 +0200 + +makedumpfile (1:1.5.8-2) sid; urgency=medium + + * Add upstart job for systems supporting upstart + Closes: 788313 + + -- Louis Bouchard <louis.bouchard@ubuntu.com> Tue, 09 Jun 2015 11:11:02 +0200 + +makedumpfile (1:1.5.8-1) sid; urgency=medium + + * New upstream version includes : + o Fair I/O workload assignment for --split + - Add the new option "--splitblock-size" to specify the permissible + difference of each splitted dumpfile size. Please note that the + difference can be larger than the specified size since this feature + doesn't care about zero page filtering. + + o Make incomplete dumpfile readable + - DUMP_DH_COMPRESSED_INCOMPLETE or DUMP_ELF_INCOMPLETE flag will be set + in the header of dumpfiles if ENOSPC occurs. The flags make crash utility + attempt analyzing the dumpfile even it is known to be incomplete. + + o Support new kernels + - The supported kernel is updated to 3.19 in this version. + + Changelog: + o New feature + - [PATCH v2] Get MODULES_VADDR by KERNEL_IMAGE_SIZE for x86_64. + (by Baoquan He) 56649f7 + - [PATCH v4 1/4] Make get_elf64_phdr()/get_elf32_phdr() public. + (by Wang Xiao) 3182be9 + - [PATCH v4 2/4] Make the incomplete dumpfile generated by ENOSPC + error analyzable. + (by Wang Xiao) e39216f + - [PATCH v4 3/4] Implementation of dealing with kdump-compressed + dumpfile with ENOSPC error. (by Wang Xiao) 76025d3 + - [PATCH v4 4/4] Fix reassemble_kdump_header(). + (by Zhou Wenjian) 45a1885 + - [PATCH v3] Enable --mem-usage for s390x. + (by Michael Holzheu) 2e452d7 + - [PATCH v5 1/5] Add support for splitblock. + (by Zhou Wenjian) c7825d4 + - [PATCH v5 2/5] Add tools for reading and writing from splitblock + table. (by Zhou Wenjian) 11dcbfe + - [PATCH v5 3/5] Add module of generating table. + (by Zhou Wenjian) 28e367c + - [PATCH v5 4/5] Add module of calculating start_pfn and end_pfn in + each dumpfile. + (by Zhou Wenjian) 2b74c02 + - [PATCH v5 5/5] Add support for --splitblock-size. + (by Zhou Wenjian) 3352179 + - [PATCH] sadump: Support more than 16TB physical memory space. + (by HATAYAMA Daisuke) 37afcd5 + + o Bugfix + - [PATCH] Use file offset in initialize_mmap(). + (by Petr Tesarik) f822608 + + o Cleanup + - [PATCH] Initialize symbols early for old kernels. + (by Atsushi Kumagai) 99850a1 + - [PATCH v2] Introduce stub method for machine dependent parts. + (by Atsushi Kumagai) bf0bbf9 + - [PATCH] Read vmcoreinfo as early as possible. + (by Atsushi Kumagai) 21631da + - [PATCH] Bring get_kcore_dump_loads() backward. + (by Atsushi Kumagai) c1d9e15 + - [PATCH 1/2] Add description of elf dump file. + (by Zhou Wenjian) 4074bb6 + - [PATCH 2/2] Add description of incomplete dump file. + (by Zhou Wenjian) b343067 + - [PATCH] Cleanup: Add some comments for ELF format. + (by Atsushi Kumagai) 4a59bd6 + - [PATCH 1/2] Modify the description of the dump level. + (by Atsushi Kumagai) 3599df6 + - [PATCH 2/2] Change the part of the pfn counter for page cache. + (by Atsushi Kumagai) 7b55569 + - [PATCH v3 1/7] cache: get rid of search loop in cache_add(). + (by Petr Tesarik) e068ea2 + - [PATCH v3 2/7] cache: allow to return a page to the pool. + (by Petr Tesarik) f2b30c6 + - [PATCH v3 3/7] cache: do not allocate from the pending list. + (by Petr Tesarik) ff592e6 + - [PATCH v3 4/7] cache: add hit/miss statistics to the final report. + (by Petr Tesarik) 7405a60 + - [PATCH v3 5/7] cache: allocate buffers in one big chunk. + (by Petr Tesarik) 65899d0 + - [PATCH v3 6/7] cache: allow arbitrary size of cache entries. + (by Petr Tesarik) 5881f23 + - [PATCH v3 7/7] cache: store mapped regions directly in the cache. + (by Petr Tesarik) 1acd75f + - [PATCH] Update email addresses of mainteners. + (by Atsushi Kumagai) febff05 + + -- Louis Bouchard <louis.bouchard@ubuntu.com> Tue, 28 Apr 2015 11:38:27 +0200 + +makedumpfile (1:1.5.7-4) experimental; urgency=medium + + * Enable kdump-tools to work as a systemd service + + -- Louis Bouchard <louis.bouchard@ubuntu.com> Thu, 04 Dec 2014 17:45:43 +0100 + +makedumpfile (1.5.7-3) unstable; urgency=medium + + [Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>] + * Add possibility to find vmlinux for ppc64el arch + Closes: #763688 + + -- Louis Bouchard <louis.bouchard@ubuntu.com> Fri, 14 Nov 2014 15:56:15 +0100 + +makedumpfile (1.5.7-2) unstable; urgency=medium + + [Lee Schermerhorn] + * Add '-F' [flatten] to makedumpefile args for remote kdump vi ssh. + Closes: #768317 + + -- Louis Bouchard <louis.bouchard@ubuntu.com> Mon, 10 Nov 2014 16:51:04 +0100 + +makedumpfile (1.5.7-1) unstable; urgency=medium + + * New upstream version includes : + - Show the memory usage of 1st kernel : Add the new option + "--mem-usage" to show the memory usage at a given moment + in 1st kernel. This will be helpful to estimate the + appropriate storage size to store a filtered dumpfile, + thanks Baoquan. + + - hugepage filtering : Both THPs and hugetlbfs pages are now + excluded as user pages. As for hugetlbfs, this feature + will be enabled for linux-3.16 or later. + + - Support new kernels + The supported kernel is updated to 3.16 in this version. + + * Debian specific enhancements : + - Networked kernel dumps + The kdump-tools script is now able to send the output of + makedumpfile to a remote server using either SSH or NFS + protocols. + - Add myself as the new maintainer + + -- Louis Bouchard <louis.bouchard@ubuntu.com> Thu, 18 Sep 2014 13:21:55 +0200 + +makedumpfile (1.5.6-2) unstable; urgency=medium + + * [ Juerg Haefliger <juerg.haefliger@hp.com> ] + Make the dumping of dmesg configurable + + Dumping the dmesg buffer has shown to be problematic when kernels + change. This patch introduces a new config variable that can turn + the dmesg dump off. The default behaviour unchanged, i.e., the + dmesg buffer is dumped. + Closes: 747173 + + -- Louis Bouchard <louis.bouchard@ubuntu.com> Fri, 23 May 2014 12:33:24 +0200 + +makedumpfile (1.5.6-1) unstable; urgency=medium + + [ Louis Bouchard ] + * New upstream version + + * Add x32 armel armhf and ppa64el to Achitecture to close the delta with + Ubuntu + + -- Louis Bouchard <louis.bouchard@ubuntu.com> Tue, 29 Apr 2014 16:07:03 +0200 + +makedumpfile (1.5.5-2) unstable; urgency=low + + * Drop debug kernel requirement from kdump-config + + [Konstantin Khlebnikov] + Starting from 2.6.24 kernel provides vmcoreinfo right in vmcore, + so makedumpfile can produce filtered dumps without vmlinux or slecial vmcoreinfo. + Closes: #638849 + + * debian/kdump-config : Define Timestamp only once in variable and reuse + + -- Louis Bouchard <louis.bouchard@ubuntu.com> Wed, 15 Jan 2014 10:29:34 +0100 + +makedumpfile (1.5.5-1) unstable; urgency=low + + [ Louis Bouchard ] + * New upstream version + - Reworked debian/patches to use DEP3 + - Use install statement from upstream Makefile + + -- Louis Bouchard <louis.bouchard@ubuntu.com> Thu, 19 Dec 2013 11:31:10 +0100 + +makedumpfile (1.5.4-1) unstable; urgency=low + + [Louis Bouchard] + * New upstream version + + -- Louis Bouchard <louis.bouchard@ubuntu.com> Tue, 16 Jul 2013 16:05:09 +0200 + +makedumpfile (1.5.3-1) unstable; urgency=low + + [ Louis Bouchard ] + * New upstream version + - Drop 0003-PATCH-dump-dmesg-fix-for-post-3.5-kernels.patch + (included upstream) + - Rebase 0002-Use-install-instead-of-cp-in-Makefile.patch + + -- John Wright <jsw@debian.org> Sun, 31 Mar 2013 20:45:37 -0700 + +makedumpfile (1.5.1-1) unstable; urgency=low + + * Merge of new upstream version 1.5.1 + * Add --dmesg-fix from upstream 1.5.2 for kernels 3.5 + and above + * Add creation of /var/crash/dmesg.{timestamp} by kdump-config + + -- Louis Bouchard <louis.bouchard@canonical.com> Tue, 05 Feb 2013 09:55:43 +0100 + +makedumpfile (1.5.0-1) unstable; urgency=low + + * New upstream version 1.5.0 + + -- Louis Bouchard <louis.bouchard@ubuntu.com> Mon, 17 Sep 2012 15:55:39 +0200 + +makedumpfile (1.4.4-1) unstable; urgency=low + + * New upstream version + + -- John Wright <jsw@debian.org> Mon, 16 Jul 2012 04:01:21 -0600 + +makedumpfile (1.4.3-1) unstable; urgency=low + + [ Louis Bouchard ] + * Update packaging for upstream version 1.4.3 + + [ John Wright ] + * Add Louis Bouchard to Uploaders. Thanks! + + -- John Wright <jsw@debian.org> Sun, 10 Jun 2012 00:34:07 -0700 + +makedumpfile (1.4.0-1) unstable; urgency=low + + * New upstream version + * Drop makedumpfile-static package, since makedumpfile depends on + libebl, which is no longer available statically, and nobody is + depending on makedumpfile-static anyway + + -- John Wright <jsw@debian.org> Sun, 22 Jan 2012 16:49:51 -0800 + +makedumpfile (1.3.7-2) unstable; urgency=low + + * Cherry-pick upstream commits: + - [PATCH] BUGFIX: Avoid SIGSEGV when specifying -V option. + (5b8c2da75cbdb230019a3b956793fb768055b977) + - [PATCH] Copy correct nr_cpus info to dumpfile during re-filtering. + (c4f1c98a9827c1c0e41772c1954940fbf1b48048) + * kdump-tools.init: Don't exit with failure status except for bad + usage. This way, even if /etc/default/kdump-tools has USE_KDUMP=1 + but the kernel command line or debug kernels are not set up, + installation of a new version of the package will not leave it + unconfigured. (Closes: #623470) + + -- John Wright <jsw@debian.org> Tue, 26 Apr 2011 20:05:16 -0700 + +makedumpfile (1.3.7-1) unstable; urgency=low + + [ John Wright ] + * New upstream version + * kdump-config: Clean up kernel command-line argument stripping + * kdump-tools.init: Remove a stray "$" in the usage statement + (Closes: #581116) + + [ dave medberry ] + * kdump-config: Convert 3 log_failure_msg to a log_warning_msg + (Closes: #594411) + + -- John Wright <jsw@debian.org> Sun, 17 Apr 2011 21:03:04 -0700 + +makedumpfile (1.3.5-1) unstable; urgency=low + + * New upstream version + * Preserve upstream's original makedumpfile.8 in clean target + * kdump-config: Fix a typo + * Switch to the "3.0 (quilt)" source format + - Remove unneeded Build-Depends on quilt + * Update kdump-tools.README.Debian to reflect that recent kernels + don't need a crash kernel start address + * Apply patch from Petter Reinholdtsen to fix incorrect dependencies + in kdump-tools.init (Closes: #569685) + * Indicate support for Linux 2.6.32 + - Although upstream hasn't updated its LATEST_VERSION macro, this + version works without modification on Linux 2.6.32. Squelch a + warning that a 2.6.32 kernel is not supported. + * Backport upstream commit 4a16bd39866093f4949f8e9dc183fa2321bda22d + - Fix buffer overflow when writing dh->signature + + -- John Wright <jsw@debian.org> Wed, 03 Mar 2010 17:17:35 -0700 + +makedumpfile (1.3.4-1) unstable; urgency=low + + * New upstream version. + - Remove debian/patches/02-Add_x86_64_linux-2.6.31.patch - already + included upstream + * Upload to Debian. Changes from Ubuntu: + - Switch to quilt from dpatch + - Set myself as the maintainer + - Don't ignore make clean errors + - Update to debhelper compatibility level 7 and simplify the rules + file by using dh + - Install the manpage with maximum compression + - Update Standards-Version to 3.8.2, adding a README.source + explaining the quilt patch setup + - Add ${perl:Depends} to Depends, since we ship a perl script + - Add Vcs-Git and Vcs-Browser fields to debian/control + - Clarify the copyright description + - Provide a dynamically linked binary in the makedumpfile package, + and a static binary in the makedumpfile-static package + - Add lintian overrides relating to makedumpfile-static being + statically linked + - Remove unused Build-Depends on zip + - Build a kdump-tools package that includes an init script and tools + to configure kdump + + -- John Wright <jsw@debian.org> Thu, 12 Nov 2009 19:03:18 -0700 + +makedumpfile (1.3.3-0ubuntu4) karmic; urgency=low + + * debian/patches/02-Add_x86_64_linux-2.6.31.patch: + - apply patch by Ken'ichi Ohmichi to support 2.6.31 on + amd64 (kernel memory layout changed) + + -- Michael Vogt <michael.vogt@ubuntu.com> Thu, 16 Jul 2009 09:18:33 +0200 + +makedumpfile (1.3.3-0ubuntu3) karmic; urgency=low + + * debian/rules, debian/control: + - add dpatch + * debian/patches/01_fix_makefile: + - fix make install target + + -- Michael Vogt <michael.vogt@ubuntu.com> Tue, 23 Jun 2009 13:14:10 +0200 + +makedumpfile (1.3.3-0ubuntu2) karmic; urgency=low + + * fix FTBFS due to missing man dir + + -- Michael Vogt <michael.vogt@ubuntu.com> Tue, 23 Jun 2009 09:21:08 +0200 + +makedumpfile (1.3.3-0ubuntu1) karmic; urgency=low + + * New upstream release + * depends on latest libdw-dev (the previous version does + not ship the required static lib) + + -- Michael Vogt <michael.vogt@ubuntu.com> Mon, 22 Jun 2009 16:19:42 +0200 + +makedumpfile (1.2.9-0ubuntu3) intrepid; urgency=low + + * Add missing build dependency "zip" to fix FTBFS. + + -- Martin Pitt <martin.pitt@ubuntu.com> Wed, 08 Oct 2008 15:11:25 +0200 + +makedumpfile (1.2.9-0ubuntu2) intrepid; urgency=low + + * Corrected FTBFS caused by a mistake in the makefile + + -- Michael Casadevall <sonicmctails@gmail.com> Mon, 06 Oct 2008 02:01:26 -0400 + +makedumpfile (1.2.9-0ubuntu1) intrepid; urgency=low + + * New upstream version (LP: #271956) + * Support ia64 discontigmem kernels of linux-2.6.20+. + * Support x86_64 linux-2.6.27 kernel. + * Add "--vtop" option for debugging. + * Add the debugging message for ia64 pgtable. + * Get information from vmcoreinfo of /proc/vmcore even if -x/-i option. + * Add free() for error handling. + * Fix NOT_FOUND value of SIZE(nodemask_t). + * Use the terminal sizes of 80 for the IMPLEMENTATION file. (Bernhard Walle) + * Use static allocation instead of malloc(). + * Add get_num_dumpable() function. + * Remove the unused pointer. + * Remove the unused code. + * Make the ELF methods simple. + * Merge the same code in write_elf_pages(). + * Add "void" to some arguments. + * Separate the dependency code to machine and linux version. + * Cleanup vaddr_to_paddr() function. + + -- Kevin Worth <kworth@gmail.com> Thu, 18 Sep 2008 10:34:45 -0700 + +makedumpfile (1.2.6-0ubuntu3) intrepid; urgency=low + + * Added lpia to architectures. + + -- Ben Collins <ben.collins@canonical.com> Tue, 08 Jul 2008 10:51:37 -0400 + +makedumpfile (1.2.6-0ubuntu2) intrepid; urgency=low + + * Get rid of prerm and postinst from packaging, they were empty. + * Added copyright for packaging. + * Added copyright for ppc64.c to debian/copyright + * Check return value of read(), gets rid of warnings. + + -- Ben Collins <ben.collins@canonical.com> Wed, 02 Jul 2008 09:18:36 -0400 + +makedumpfile (1.2.6-0ubuntu1) intrepid; urgency=low + + * Initial release + * Use _LARGEFILE_SOURCE and _LARGEFILE64_SOURCE instead of + _FILE_OFFSET_BITS=64 for correct compilation. + * Added initramfs hook to install makedumpfile into initrd + + -- Ben Collins <ben.collins@canonical.com> Wed, 18 Jun 2008 18:15:32 -0400 + diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..2b3c7ad --- /dev/null +++ b/debian/control @@ -0,0 +1,40 @@ +Source: makedumpfile +Section: devel +Priority: optional +Maintainer: Louis Bouchard <louis.bouchard@ubuntu.com> +Uploaders: dann frazier <dannf@debian.org>, + Thadeu Lima de Souza Cascardo <cascardo@debian.org> +Standards-Version: 3.9.8 +Build-Depends: debhelper (>= 9.20160709), + libelf-dev, + libz-dev, + libdw-dev (>= 0.141-2ubuntu1), + libbz2-dev, + liblzo2-dev, + po-debconf +Vcs-Git: https://salsa.debian.org/debian/makedumpfile.git +Vcs-Browser: https://salsa.debian.org/debian/makedumpfile + +Package: makedumpfile +Architecture: i386 amd64 powerpc ia64 x32 arm64 armel armhf ppc64el s390x +Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends} +Recommends: crash, kexec-tools +Replaces: kdump-tools (<< 1.3.4-1~) +Description: VMcore extraction tool + This program is used to extract a subset of the memory available either + via /dev/mem or /proc/vmcore (for crashdumps). It is used to get memory + images without extra unneeded information (zero pages, userspace programs, + etc). + +Package: kdump-tools +Architecture: i386 amd64 powerpc ia64 x32 arm64 armel armhf ppc64el s390x +Depends: ${shlibs:Depends}, ${misc:Depends}, ${dist:Depends}, makedumpfile, + debconf, bsdmainutils, lsb-base (>= 3.0-6), file, ucf, linux-base +Recommends: initramfs-tools-core +Description: scripts and tools for automating kdump (Linux crash dumps) + kdump-tools provides an init script and a configuration script for + automating the use of kdump. It uses the makedumpfile utility to + reduce the size of the /proc/vmcore file based on user preferences. + . + After installing, please see /usr/share/doc/kdump-tools/README.Debian + for information on enabling and configuring kdump. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..23c72f7 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,34 @@ +This package was debianized by Ben Collins <ben.collins@canonical.com> on +Thu, 19 Jun 2008 12:03:09 -0400 + +It was downloaded from: +http://sourceforge.net/projects/makedumpfile + +All files in this package are licensed under the GPL, version 2 or +later. + +Copyrights as follows: + +debian/kdump-config, debian/kdump-config.8, debian/kdump-tools.5: + * Copyright (C) 2007-2009 Hewlett-Packard Development Company, L.P. + All rights reserved. + +diskdump_mod: + * Copyright (C) 2004, 2005 David Anderson + * Copyright (C) 2004, 2005 Red Hat, Inc. All rights reserved. + * Copyright (C) 2005 FUJITSU LIMITED + * Copyright (C) 2005 NEC Corporation + + +ppc64.c: + * Created by: Sachin Sant (sachinp@in.ibm.com) + * Copyright (C) IBM Corporation, 2006. All rights reserved + + +Copyright on the rest: + + * Copyright (C) 2006, 2007, 2008, 2009 NEC Corporation + + +On Debian GNU systems, the complete text of the GNU General Public +License version 2 can be found in `/usr/share/common-licenses/GPL-2'. diff --git a/debian/kdump-config.8 b/debian/kdump-config.8 new file mode 100644 index 0000000..56ec3ce --- /dev/null +++ b/debian/kdump-config.8 @@ -0,0 +1,302 @@ +.\" +.TH "kdump-config" "8" "January 2016" "kdump-tools v1.5.9" "Linux System Administrator's Manual" +.\" +.\" # --------------------------------------------------------------------------- +.\" +.SH NAME +kdump-config \- configure kdump, check status, or save a vmcore file +.\" +.\" # --------------------------------------------------------------------------- +.\" +.SH SYNOPSIS +.HP 6 +.B kdump-config { help | test | show | status | load | unload | savecore | propagate | symlinks {kernel-version} } +.\" +.\" # --------------------------------------------------------------------------- +.\" +.SH DESCRIPTION +.PP + +.B kdump-config +manages the kdump feature of the Linux kernel. +When a kdump enabled kernel panics, it immediately boots into a clean +kernel called the kdump kernel. The memory image of the panicked kernel +will be presented in +.I /proc/vmcore +while the kdump kernel (or "capture kernel") is running. + +.B kdump-config +loads the kdump kernel into the current kernel +and after a kdump, captures the vmcore image via kdump kernel. +.B kdump-config +can take advantage of the +.B linux-image-$(uname -r)-dbg +package and will try to use +.B makedumpfile +to capture the vmcore. The +.B crash +tool can then be used to analyze the vmcore at a later time. + +.B kdump-config +exits with 0 on success and 1 on failure. +.\" +.\" # --------------------------------------------------------------------------- +.\" +.SH COMMANDS +.TP +.B help +Print a usage summary. +.TP +.B test +Determine the parameters that would be used to load the kdump kernel, +but do not load the kdump kernel. Useful for evaluating your configuration +settings. +.TP +.B show +Show current parameters and the saved kexec command from the last +.BR "kdump-config load" . +.TP +.B status +Evaluate +.I /sys/kernel/kexec_crash_loaded +or +.I /sys/kernel/fadump_register +depending on the dump mode and print a corresponding message. +.TP +.B load +Load the kdump kernel or register if using firmware assisted dump (fadump) +.TP +.B unload +Unload the kdump kernel or unregister if using firmware assisted dump (fadump) +.TP +.B savecore +If +.I /proc/vmcore +exists, save it using makedumpfile. +.TP +.B propagate +Sends public ssh key to remote host for passwordless connection +.TP +.B symlinks {kernel-version} +Verify and create +.BR vmlinuz +and +.BR initrd.img +links in +.I /var/lib/kdump +according to the provided kernel version. If the target +.BR initrd.img +file is absent, it will create it. + +.\" +.\" # --------------------------------------------------------------------------- +.\" +.SH FILES +.TP 15 +.I /etc/init.d/kdump-tools +init script to automatically load a kdump kernel, or save a vmcore and reboot. +.TP 15 +.I /etc/default/kdump-tools +configuration file +.TP 15 +.I /var/crash/kernel_link +a link to the current debug kernel +.TP 15 +.I /var/crash/kexec_cmd +the last kexec_cmd executed by +.B kdump-config +.TP 15 +.I /var/lib/kdump/vmlinuz +Symbolic link pointing to the current kernel file in +.I /boot +.TP 15 +.I /var/lib/kdump/initrd.img +Symbolic link pointing to the +.B initrd.img +file with the current kernel version in +.I /boot +.\" +.\" # --------------------------------------------------------------------------- +.\" +.SH DIAGNOSTICS +.TP +.B USE_KDUMP is not set or zero +The variable +.I USE_KDUMP +in the file +.I /etc/default/kdump-tools + is 0. To use kdump, edit the file and change the value to 1. +.\" +.TP +.B kdump is not supported by this kernel +The file +.I /sys/kernel/kexec_crash_loaded +does not exist. This means that the +currently running kernel either was not configured to support kdump, or that +a crashkernel= commandline parameter was not used when the currently running +kernel booted. +.\" +.TP +.B no crashkernel= parameter in the kernel cmdline +a crashkernel= commandline parameter was not used when the currently +running kernel booted. You will need to add a crashkernel= parameter +to your +.IR /etc/lilo.conf , +.I /etc/elilo.conf +or grub +.I /boot/grub/menu.lst +file and reboot, before kdump will work. See installed READMEs for suggestions. +.\" +.TP +.B KDUMP_KERNEL does not exist: $KDUMP_KERNEL +A KDUMP_KERNEL was specified in +.IR /etc/default/kdump-tools , +but it cannot be found. +.\" +.TP +.B KDUMP_INITRD does not exist: $KDUMP_INITRD +A KDUMP_INITRD was specified in +.IR /etc/default/kdump-tools , +but it cannot be found. +.\" + +.RS 0 +.nf +.B no KDUMP_KERNEL in $KDUMP_DEFAULTS and +.B can't find a kdump package directory in /usr/lib +.fi +.RS +no kdump kernel could be found. +.RE +.RE + +.RS 0 +.nf +.B found a linux-kdump package in $KDUMP_PKG_DIR +.B but can't find a kdump kernel in $KDUMP_PKG_DIR +.fi +.RS +this indicates a broken linux-kdump package installation. +.RE +.RE + +.RS 0 +.nf +.B no kdump initrd image: $KDUMP_INITRD +.B an initrd will not be used +.fi +.RS +this indicates that although a kdump kernel was found, +a corresponding initrd was not found. +.RE +.RE +.\" +.TP +.B kdump kernel relocation address does not match crashkernel= parameter +For non-relocatable architectures, the kdump kernel must be built with +a predetermined start address. This message indicates that the start +address of the kdump kernel and the start address in the crashkernel= +parameter do not match. +.\" +.TP +.B failed to load kdump kernel +kexec reported that it could not load the kdump kernel. +.\" +.TP +.B failed to unload kdump kernel +kexec reported that it could not unload the kdump kernel. +Run 'kexec -u' directly for more detail. +.\" +.TP +.B makedumpfile failed, falling back to 'cp' +this message is printed if the +.B kdump-tools +init script attempts to save a +.I /proc/vmcore +file using makedumpfile and the save fails. +.\" +.TP +.B failed to save vmcore in $KDUMP_STAMPDIR +this message indicates that makedumpfile +and the fallback method of using cp has failed. This usually occurs +if pathnames are wrong or if the disk is full. +.TP +.B Invalid argument : missing kernel version +The +.B symlinks +command was used with a kernel version that is not installed on this server +.TP +.B Invalid symlink : {symbolic link} +The listed symbolic link is absent, broken or pointing to the wrong version +.TP +.B Cannot change symbolic links when kdump is loaded +The defined symbolic links are already in use. You must unload kdump before +using the +.B symlinks +command +.TP +.B Unable to locate kernel hook +The +.B kdump-tools +script responsible for the creation of smaller initrd.img files is +absent from +.I /usr/kernel/postinst.d +.TP +.B Invalid kernel version : {kernel version} +The kernel version given to the +.B symlinks +command does not exist +.TP +.B fadump is not configured in this kernel. +The Firmware Assisted Dump (fadump) facility is not available on this platform +.TP +.B SSH and NFS cannot be defined concurrently +Both variables are defined in /etc/default/kdump-tools. You must choose one +or the other as configuration option. +.TP +.B Unable to mount remote NFS directory {directory}. Cannot save core +The remote NFS server does not authorize this server to mount the directory +to save the crash dump. +.TP +.B Unable to write to the remote NFS directory {directory}. Cannot save core +The remote NFS directory can be mounted but this server cannot write files to +it. +.TP +.B makedumpfile --dump-dmesg failed. dmesg content will be unavailable +The command to capture the content of the dmesg buffer failed. It will not +be available in the crash directory +.TP +.B Unable to reach remote server {server}. No reason to continue +.B kdump-tools +is configured for remote dump but the remote server cannot be reached. +.TP +.B makedumpfile scp failed. The vmcore file will not be available +The +.B makedumpfile +command was successful but the resulting file could not be copied over SSH +to the remote server. +.TP +.B Remote ssh dump is not configured. No reason to propagate" +The +.B propagate +command was used but kdump is not configured for remote dump. +.\" +.\" # --------------------------------------------------------------------------- +.\" +.SH SEE ALSO +.PP +.I /usr/share/doc/kdump-tools/README +.br +.I /usr/share/doc/kdump-tools/README.Debian +.br +.BR kdump-tools (5), +.BR kexec (8), +.BR crash (8), +.BR gdb (1), +.BR makedumpfile (8) +.\" +.\" # --------------------------------------------------------------------------- +.\" +.SH AUTHOR +.PP +Written by Terry Loftin <terry.loftin@hp.com> and Louis Bouchard <louis.bouchard@ubuntu.com> diff --git a/debian/kdump-config.in b/debian/kdump-config.in new file mode 100755 index 0000000..a1c3b4e --- /dev/null +++ b/debian/kdump-config.in @@ -0,0 +1,960 @@ +#!/bin/bash + +# kdump-config +# Copyright (C) 2007-2009 Hewlett-Packard Development Company, L.P. +# Written by Terry Loftin <terry.loftin@hp.com> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +# kdump-config +# a shell script utility to manage: +# * loading a kdump kernel +# * unloading a kdump kernel +# * saving a vmcore kdump kernel +# * determining the status of kdump +# * propagate ssh key to remote host + +PATH=/bin:/usr/bin:/sbin:/usr/sbin +NAME=${NAME:="kdump-config"} + +. /lib/lsb/init-functions +. /lib/init/vars.sh + +# Global Setup +KDUMP_DEFAULTS=/etc/default/kdump-tools +[ -r $KDUMP_DEFAULTS ] && . $KDUMP_DEFAULTS + +KEXEC=/sbin/kexec +[ -e $KEXEC ] || exit 1; + +KVER=`uname -r` +ARCH=`uname -m` + +# Set up defaults +KDUMP_SYSCTL=${KDUMP_SYSCTL:="kernel.panic_on_oops=1"} +KDUMP_COREDIR=${KDUMP_COREDIR:=/var/crash} +KDUMP_DUMP_DMESG=${KDUMP_DUMP_DMESG:=1} +KDUMP_DIR="/var/lib/kdump" +KDUMP_NUM_DUMPS=${KDUMP_NUM_DUMPS:=0} +NFS_TIMEO=${NFS_TIMEO:=600} +NFS_RETRANS=${NFS_RETRANS:=3} +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" +[ -d $KDUMP_COREDIR ] || mkdir -p $KDUMP_COREDIR ; + +IOMEM_ADDR=`grep -i "Crash kernel" /proc/iomem | sed "s/-..*//" | sed "s/^[ 0]*/0x/"` + +# Constants +vmcore_file=/proc/vmcore +sys_kexec_crash=/sys/kernel/kexec_crash_loaded +sys_fadump_enabled=/sys/kernel/fadump_enabled +sys_fadump_registered=/sys/kernel/fadump_registered +kexec_cmd_file=$KDUMP_COREDIR/kexec_cmd + +# DUMP_MODE = kdump/fadump +# The default dump mode is kdump. +DUMP_MODE="kdump" + +# If /sys/kernel/fadump_enabled is set to `1`, use fadump as dump mechanism +if [ -e $sys_fadump_enabled ] && [ `cat $sys_fadump_enabled` -eq 1 ]; then + DUMP_MODE="fadump" +fi + +# Utility Functions +# +function kdump_help() +{ +cat <<EOHELP +Usage: +kdump-config {help|test|show|status|load|unload|savecore|propagate|symlinks kernel-version}" + help - print this page + test - Do a dry-run of kdump kernel load command by showing + the kernels and parameters that will be used and echo'ing + the kexec command. The kexec command will not be executed. + If using fadump, check if required sysfs directories exist. + show - Show dump mode, status, any current parameters. + Show kexec command for kdump. + status - evaluate /sys/kernel/{kexec_crash_loaded,fadump_registered} + depending on dump mode. Print appropriate message + load - Locate the kdump kernel, debug kernel, and establish links for + makedumpfile. Then load the kdump kernel using kexec + If using fadump, register. + unload - unload the kdump kernel using kexec + If using fadump, unregister. + savecore - use previously made links to save /proc/vmcore + propagate - Send public ssh key to remote host for passwordless connection + symlinks - Verify and create vmlinuz and initrd.img links in /var/lib/kdump + according to the provided kernel version. If the target + initrd.img file is absent, it will create it. +EOHELP +} + +function kdump_show() +{ + echo "DUMP_MODE: $DUMP_MODE" + echo "USE_KDUMP: $USE_KDUMP" + echo "KDUMP_SYSCTL: $KDUMP_SYSCTL" + echo "KDUMP_COREDIR: $KDUMP_COREDIR" + if [ "$DUMP_MODE" == "kdump" ]; then + echo "crashkernel addr: $IOMEM_ADDR" + fi + if [ -h "$KDUMP_KERNEL" ];then + echo " "$(file $KDUMP_KERNEL) + else + echo " "$KDUMP_KERNEL + fi + echo "kdump initrd: " + if [ -h "$KDUMP_INITRD" ];then + echo " "$(file $KDUMP_INITRD) + else + echo " "$KDUMP_INITRD + fi + + if [ -n "$SSH" ];then + echo "SSH: $SSH" + SSH_KEY="${SSH_KEY:=/root/.ssh/kdump_id_rsa}" + echo "SSH_KEY: $SSH_KEY" + fi + if [ -n "$NFS" ]; then + echo "NFS: $NFS" + echo "NFS_TIMEO: ${NFS_TIMEO:=600}" + echo "NFS_RETRANS ${NFS_RETRANS:=3}" + fi + + if [ -n "$SSH" ] || [ -n "$NFS" ]; then + HOSTTAG="${HOSTTAG:=ip}" + echo "HOSTTAG: $HOSTTAG" + fi + + if [ "$DUMP_MODE" == "fadump" ]; then + if [ -e $sys_fadump_registered ] && + [ `cat $sys_fadump_registered` -eq 1 ] ; then + echo "current state: ready to fadump"; + else + echo "current state: Not ready to fadump"; + fi + return 0 + fi + + if [ -e $sys_kexec_crash -a `cat $sys_kexec_crash` -eq 1 ] ; then + echo "current state: ready to kdump"; + else + echo "current state: Not ready to kdump"; + fi + echo + echo "kexec command:" + echo -n " " + if [ -e $kexec_cmd_file ] ; then + cat $kexec_cmd_file ; + else + echo "no kexec command recorded" + fi +} + +function kdump_test() +{ + echo "USE_KDUMP: $USE_KDUMP" + echo "KDUMP_SYSCTL: $KDUMP_SYSCTL" + echo "KDUMP_COREDIR: $KDUMP_COREDIR" + echo "crashkernel addr: $IOMEM_ADDR" + echo "kdump kernel addr: $KDUMP_ADDR" + echo "kdump kernel:" + if [ -h "$KDUMP_KERNEL" ];then + echo " "$(file $KDUMP_KERNEL) + else + echo " "$KDUMP_KERNEL + fi + echo "kdump initrd: " + if [ -h "$KDUMP_INITRD" ];then + echo " "$(file $KDUMP_INITRD) + else + echo " "$KDUMP_INITRD + fi + echo "kexec command to be used:" + echo " $KEXEC_CMD" +} + +# Check if symlinks are correctly set according to the +# kernel version passed as argument, if $KDUMP_DIR +# is used to store smaller initrd.img files (Ubuntu only) +# Returns: 0/1 (success/broken,absent or wrong version) +# +function check_symlink() +{ +symlink=$1 +kern_version=$2 + + if [ -h "$KDUMP_DIR/$symlink" ];then + linkedfile=$(file "$KDUMP_DIR/$symlink" | rev | cut -d" " -f1 | rev) + if [ -e "$linkedfile" ];then + version=$(basename $linkedfile) + if [ ${version%%-*} == "vmlinux" ];then + version=${version#vmlinux-} + else + version=${version#$symlink-} + fi + if [ ${version} == $kern_version ]; then + return 0 + fi + fi + fi + return 1 +} + +# Create a symlink +function create_symlink() +{ +link=$1 +kernel_version=$2 + + log_action_msg "Creating symlink $KDUMP_DIR/${link}" + if [ $link == "vmlinuz" ];then + ln -fs /boot/${link%?}?-${kernel_version} $KDUMP_DIR/$link + else + ln -fs $KDUMP_DIR/${link}-${kernel_version} $KDUMP_DIR/$link + fi +} + +# If $KDUMP_DIR is used to hold smaller initrd.img, +# verify if the proper symlinks are in place for +# initrd.img and vmlinuz/vmlinux. +# If no link is found, the links are broken or pointing +# to the wrong version, new links are created. +# Nothing is created if DRY_RUN = true. Only reporting +# is done. +# Returns: none. prints warnings or exit +# Creates: $KDUMP_DIR/vmlinuz $KDUMP_DIR/initrd.img +function manage_symlinks() +{ + if [ -d "$KDUMP_DIR" ];then + for symlink in initrd.img vmlinuz;do + check_symlink $symlink $KVER + ret=$? + if [ $ret == 1 ];then + log_failure_msg "Invalid symlink : $KDUMP_DIR/$symlink" + if [ ! $DRY_RUN ];then + create_symlink $symlink $KVER + fi + fi + done + fi + return 0 +} + +# check_fadump_support: Other miscellaneous checks go here: +# 1: if USE_KDUMP is 0, don't set up fadump. +# 2: -e /sys/kernel/fadump_registered indicates that this kernel +# thinks it supports fadump +# +# Returns: none. prints warnings or exit +function check_fadump_support() +{ + if [ -z "$USE_KDUMP" -o "$USE_KDUMP" == "0" ] ; then + log_failure_msg "$KDUMP_DEFAULTS: USE_KDUMP is not set or zero" + [ ! $DRY_RUN ] && exit 1; + fi + if [ ! -e $sys_fadump_registered ]; then + log_failure_msg "fadump is not configured in this kernel." + log_failure_msg "Try passing \"fadump=on\" to enable fadump" + [ ! $DRY_RUN ] && exit 1; + fi + if [ -n "$NFS" ] && [ -n "$SSH" ];then + log_failure_msg "\$SSH and \$NFS cannot be defined concurrently" + [ ! $DRY_RUN ] && exit 1; + fi +} + +# check_kdump_support: Other miscellaneous checks go here: +# 1: if USE_KDUMP is 0, don't set up kdump. +# 2: -e /sys/kernel/kexec_crash loaded indicates that this kernel +# thinks it supports kdump +# 3: the current kernel should have booted with a crashkernel= command +# line parameter. +# +# Returns: none. prints warnings or exit +function check_kdump_support() +{ + if [ -z "$USE_KDUMP" -o "$USE_KDUMP" == "0" ] ; then + log_failure_msg "$KDUMP_DEFAULTS: USE_KDUMP is not set or zero" + [ ! $DRY_RUN ] && exit 1; + fi + if [ ! -e $sys_kexec_crash ] ; then + log_failure_msg "kdump is not supported by this kernel" + [ ! $DRY_RUN ] && exit 1; + fi + CRASHKERNEL=`grep -i crashkernel= /proc/cmdline`; + if [ -z "$CRASHKERNEL" ] ; then + log_failure_msg "no crashkernel= parameter in the kernel cmdline" + [ ! $DRY_RUN ] && exit 1; + fi + if [ -n "$NFS" ] && [ -n "$SSH" ];then + log_failure_msg "\$SSH and \$NFS cannot be defined concurrently" + [ ! $DRY_RUN ] && exit 1; + fi +} + +# check_relocatable: check if the given kernel config is relocatable +# Arguments: +# 1: the config file to check +# Returns: 0 if the given kernel config indicates a relocatable kernel. +# 1 otherwise. +function check_relocatable() +{ + if [ "$ARCH" = "ia64" ]; then + # Linux is always relocatable on ia64 + return 0 + elif grep -q 'CONFIG_RELOCATABLE=y' $1; then + return 0 + else + return 1 + fi +} + +function check_securelevel() +{ + local sl_path="/sys/kernel/security/securelevel" + if [ ! -f "$sl_path" ]; then + return 1 + fi + + if [ "$(cat "$sl_path")" = "1" ]; then + return 0 + fi + + return 1 +} + + +function check_secure_boot() +{ + local sb_path sm_file sb sm + + sb_path=$(find /sys/firmware/efi/efivars -name SecureBoot-* 2>/dev/null) + sm_path=$(find /sys/firmware/efi/efivars -name SetupMode-* 2>/dev/null) + + if [ -f "$sb_path" ] && [ -f "$sm_path" ]; then + sb=$(hexdump -v -e '/1 "%d\ "' $sb_path|cut -d' ' -f 5) + sm=$(hexdump -v -e '/1 "%d\ "' $sm_path|cut -d' ' -f 5) + + if [ "$sb" = "1" ] && [ "$sm" = "0" ]; then + return 0 + fi + fi + + return 1 +} + +# Find the kexec/kdump kernel and possibly a corresponding initrd. +# A kdump kernel does not need to match the `uname -r` of the booted kernel. +# +# Use the following priorites in determining the kdump kernel: +# 1. An explicit Kdump kernel in the defaults file overrides all +# 2. Use the current running kernel if it is relocatable. +# 3. Give up. Note, a kdump kernel is required. +# +# Returns: 0/1 (success/fail) +# Returns: none. prints warnings or exit +# Sets: KDUMP_KERNEL, KDUMP_INITRD +function locate_kdump_kernel() +{ + # 1: User may have specified the KDUMP_KERNEL and KDUMP_INITRD + # explicitly. Test for existance and either use it or fail. + if [ -n "$KDUMP_KERNEL" ] ; then + if [ ! -e "$KDUMP_KERNEL" ] ; then + log_failure_msg "$KDUMP_DEFAULTS: KDUMP_KERNEL does not exist: $KDUMP_KERNEL" + [ ! $DRY_RUN ] && exit 1; + elif [ -n "$KDUMP_INITRD" -a ! -e "$KDUMP_INITRD" ] ; then + log_failure_msg "$KDUMP_DEFAULTS: KDUMP_INITRD does not exist: $KDUMP_INITRD" + [ ! $DRY_RUN ] && exit 1; + fi + return 0; + fi + + # 2: The currently running kernel may be relocatable. If so, then + # use the currently running kernel as the crash kernel. + if check_relocatable /boot/config-$KVER; then + if [ -f /boot/vmlinuz-$KVER ]; then + KDUMP_KERNEL=/boot/vmlinuz-$KVER + elif [ -f /boot/vmlinux-$KVER ]; then + KDUMP_KERNEL=/boot/vmlinux-$KVER + else + KDUMP_KERNEL= + fi + if [ -f /boot/initrd.img-$KVER ]; then + KDUMP_INITRD=/boot/initrd.img-$KVER + else + KDUMP_INITRD= + fi + KDUMP_ADDR="relocatable" + return 0; + fi + + # If the kdump kernel is not relocatable, we need to make sure it was + # built to start at the crashkernel= address. IOMEM_ADDR is already + # set... + if [ -z "$KDUMP_CONFIG" ] ; then return 0 ; fi + + if check_relocatable $KDUMP_CONFIG; then + KDUMP_ADDR="relocatable" + else + KDUMP_ADDR=`grep CONFIG_PHYSICAL_START $KDUMP_CONFIG | sed "s/CONFIG_PHYSICAL_START=//"` + # compare the two + if [ "$KDUMP_ADDR" != "$IOMEM_ADDR" ] ; then + log_failure_msg "kdump kernel relocation address does not match crashkernel parameter" + [ ! $DRY_RUN ] && exit 1; + return 1; + fi + fi + + return 0; +} + +# Register firmware-assisted dump as the dump mechanism +# Returns: none. prints warnings or exit +function fadump_register() +{ + # set fadump registered sys node to `1` to register fadump + if [ "`cat $sys_fadump_registered`" -ne 1 ]; then + echo 1 > $sys_fadump_registered + fi + rc=`cat $sys_fadump_registered` + if [ $rc -ne 1 ] ; then + log_failure_msg "fadump registering failed" + logger -t $NAME "fadump registering failed" + [ ! $DRY_RUN ] && exit 1; + fi + + log_success_msg "fadump registered successfully" + logger -t $NAME "fadump registered successfully" + + # Last step: make sure panic_on_oops is enabled + PANIC_ON_OOPS=`/sbin/sysctl kernel.panic_on_oops | cut -d" " -f3` + if [ $PANIC_ON_OOPS != "1" ] ; then + sysctl -w kernel.panic_on_oops=1 >/dev/null + fi +} + +# Returns: none. prints warnings or exit +function fadump_unregister() +{ + # set fadump registered sys node to `0` to un-register fadump + if [ "`cat $sys_fadump_registered`" -ne 0 ]; then + echo 0 > $sys_fadump_registered + fi + rc=`cat $sys_fadump_registered` + if [ $rc -ne 0 ] ; then + log_failure_msg "fadump un-registering failed" + logger -t $NAME "fadump un-registering failed" + [ ! $DRY_RUN ] && exit 1; + fi + + log_success_msg "fadump un-registered successfully" + logger -t $NAME "fadump un-registered successfully" +} + +function kdump_create_symlinks() +{ +kernel_version=$1 + + if [ -e $sys_kexec_crash -a `cat $sys_kexec_crash` -eq 1 ] ; then + log_failure_msg "Cannot change symbolic links when kdump is loaded" + exit 1 + fi + + if [ -e /boot/vmlinu[xz]-${kernel_version} ];then + create_symlink vmlinuz $kernel_version + + if [ -f $KDUMP_DIR/initrd.img-${kernel_version} ]; then + create_symlink initrd.img ${kernel_version} + else + if [ -x $KDUMP_KERNEL_HOOK ];then + $KDUMP_KERNEL_HOOK $kernel_version + create_symlink initrd.img $kernel_version + else + log_failure_msg "Unable to locate kernel hook" + fi + fi + else + log_failure_msg "Invalid kernel version : $kernel_version" + fi +} +# +# Load the already determined kdump kernel and kdump initrd using kexec +# 1: A KDUMP_CMDLINE in the defaults file overrides all. +# 2: Use /proc/cmdline +# a. strip out the crashkernel= parameter. +# b. strip out the abm= parameter. +# c. append KDUMP_CMDLINE_APPEND from defaults file +# Sets: KEXEC_CMD +# Returns: none. prints warnings or exit +function kdump_load() +{ + # assemble the kexec command used to load the kdump kernel + KEXEC_CMD="$KEXEC -p" + + if check_secure_boot || check_securelevel; then + KEXEC_CMD="$KEXEC_CMD -s" + fi + + # Different kernel types allow/require different options: + # The only special case here is that x86, x86_64 elf style + # binaries require the --args-linux argument. + if [ "$ARCH" != "ia64" ] ; then + ELF_TST=`file $KDUMP_KERNEL | grep ELF` + if [ -n "$ELF_TST" ] ; then + KEXEC_CMD="$KEXEC_CMD --args-linux" + fi + fi + + # KDUMP_KEXEC_ARGS, if non-empty, comes from the defaults file. + if [ -n "$KDUMP_KEXEC_ARGS" ] ; then + KEXEC_CMD="$KEXEC_CMD $KDUMP_KEXEC_ARGS" + fi + + # Assemble the --commmand-line: + if [ -z "$KDUMP_CMDLINE" ] ; then + KDUMP_CMDLINE=`cat /proc/cmdline | \ + sed -r -e 's/(^| )crashkernel=[^ ]*//g' \ + -e 's/(^| )hugepages=[^ ]*//g' \ + -e 's/(^| )hugepagesz=[^ ]*//g' \ + -e 's/(^| )abm=[^ ]*//g' \ + -e 's/"/\\\\"/'g` + fi + KDUMP_CMDLINE="$KDUMP_CMDLINE $KDUMP_CMDLINE_APPEND" + KEXEC_CMD="$KEXEC_CMD --command-line=\"$KDUMP_CMDLINE\"" + + # Assemble the --initrd: + if [ -e "$KDUMP_INITRD" ] ; then + KEXEC_CMD="$KEXEC_CMD --initrd=$KDUMP_INITRD" + fi + + # Finally, add the kernel: + KEXEC_CMD="$KEXEC_CMD $KDUMP_KERNEL" + + if [ $DRY_RUN ] ; then return 0; fi + + eval $KEXEC_CMD + + if [ $? == 0 ]; then + log_success_msg "loaded kdump kernel" + logger -t $NAME "$KEXEC_CMD" + logger -t $NAME "loaded kdump kernel" + echo "$KEXEC_CMD" >$kexec_cmd_file + else + log_failure_msg "failed to load kdump kernel" + logger -t $NAME "failed to load kdump kernel" + [ ! $DRY_RUN ] && exit 1; + fi + + # Last step: make sure panic_on_oops is enabled + PANIC_ON_OOPS=`/sbin/sysctl kernel.panic_on_oops | cut -d" " -f3` + if [ $PANIC_ON_OOPS != "1" ] ; then + sysctl -w kernel.panic_on_oops=1 >/dev/null + fi + +} + +# Returns: none. prints warnings or exit +function kdump_unload() +{ + if check_secure_boot || check_securelevel; then + $KEXEC -s -p -u + else + $KEXEC -p -u + fi + + if [ $? == 0 ]; then + log_success_msg "unloaded kdump kernel" + logger -t $NAME "unloaded kdump kernel" + else + log_failure_msg "failed to unload kdump kernel" + logger -t $NAME "failed to unload kdump kernel" + [ ! $DRY_RUN ] && exit 1; + fi +} + +# +# Return the name of the subdirectory to store core file. +# Will add hostname/IP according to the value of +# HOSTTAG if networked dump is selected + +function define_stampdir() +{ + STAMP=$1 + HOSTTAG="${HOSTTAG:=ip}" + + if [ -z "$SSH" ] && [ -z "$NFS" ]; then + echo "$KDUMP_COREDIR/$STAMP" + elif [ "$HOSTTAG" = "hostname" ];then + echo "$KDUMP_COREDIR/$(hostname)-$STAMP" + else + # Looping to give time to network to settle + typeset -i counter=0 + while (( counter < 5));do + THIS_HOST="$(hostname -I)" + set -- $THIS_HOST + THIS_HOST=$1 + if [ -z "$THIS_HOST" ]; then + sleep 1 + ((counter+=1)) + else + break + fi + done + if [ -z "$THIS_HOST" ]; then + # Send log msg to stderr to avoid polluting + # the result of the function + log_failure_msg "Unable to get IP from network" >&2 + log_action_msg "Reverting to HOSTTAG=hostname" >&2 + THIS_HOST="$(hostname)" + fi + echo "$KDUMP_COREDIR/$THIS_HOST-$STAMP" + fi +} + + +# Saving the vmcore: +# Our priorities are: +# 1. If the makedumpfile config link is valid, use that +# 2. else if the vmlinux link is valid, use that +# 3. else fallback to using: makedumpfile -d 1 -c +# 4. else use cp +# +# Returns: 0/1 (success/fail) +# Sets: KDUMP_STAMPDIR, KDUMP_COREFILE +function kdump_save_core() +{ + KDUMP_STAMP=`date +"%Y%m%d%H%M"` + KDUMP_STAMPDIR=$(define_stampdir $KDUMP_STAMP) + KDUMP_CORETEMP="$KDUMP_STAMPDIR/dump-incomplete" + KDUMP_COREFILE="$KDUMP_STAMPDIR/dump.$KDUMP_STAMP" + KDUMP_DMESGFILE="$KDUMP_STAMPDIR/dmesg.$KDUMP_STAMP" + + # If we use NFS, verify that we can mount the FS + # + 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=$? + 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" + return 1; + fi + + # FS is mounted, see if we can write to it + # + mkdir -p $KDUMP_STAMPDIR + ERROR=$? + + if [ $ERROR -ne 0 ];then + log_failure_msg "$NAME: Unable to write to the remote NFS directory $NFS. Cannot save core" + logger -t $NAME "Unable to write to the remote NFS directory $NFS. Cannot save core" + umount $KDUMP_COREDIR + UMNT_ERROR=$? + if [ $UMNT_ERROR -ne 0 ];then + log_failure_msg "$NAME: Unable to cleanly unmount the NFS file system" + logger -t $NAME "Unable to cleanly unmount the NFS file system" + fi + else + log_action_msg "Dumping to NFS mountpoint $NFS/$KDUMP_STAMP" + logger -t $NAME "Dumping to NFS mountpoint $NFS/$KDUMP_STAMP" + fi + else + mkdir -p $KDUMP_STAMPDIR + fi + + log_action_msg "running makedumpfile $MAKEDUMP_ARGS $vmcore_file $KDUMP_CORETEMP" + makedumpfile $MAKEDUMP_ARGS $vmcore_file $KDUMP_CORETEMP + ERROR=$? + if [ $ERROR -ne 0 ] ; then + log_failure_msg "$NAME: makedumpfile failed, falling back to 'cp'" + logger -t $NAME "makedumpfile failed, falling back to 'cp'" + KDUMP_CORETEMP="$KDUMP_STAMPDIR/vmcore-incomplete" + KDUMP_COREFILE="$KDUMP_STAMPDIR/vmcore.$KDUMP_STAMP" + cp $vmcore_file $KDUMP_CORETEMP + ERROR=$? + fi + + # did we succeed? + if [ $ERROR == 0 ]; then + mv $KDUMP_CORETEMP $KDUMP_COREFILE + log_success_msg "$NAME: saved vmcore in $KDUMP_STAMPDIR" + logger -t $NAME "saved vmcore in $KDUMP_STAMPDIR" + sync + else + log_failure_msg "$NAME: failed to save vmcore in $KDUMP_STAMPDIR" + logger -t $NAME "failed to save vmcore in $KDUMP_STAMPDIR" + fi + + # dump the dmesg buffer + if [ "$KDUMP_DUMP_DMESG" -eq 1 ] ; then + log_action_msg "running makedumpfile --dump-dmesg $vmcore_file $KDUMP_DMESGFILE" + makedumpfile --dump-dmesg $vmcore_file $KDUMP_DMESGFILE + ERROR=$? + if [ $ERROR -ne 0 ] ; then + log_failure_msg "$NAME: makedumpfile --dump-dmesg failed. dmesg content will be unavailable" + logger -t $NAME "makedumpfile --dump-dmesg failed. dmesg content will be unavailable" + fi + + # did we succeed? + if [ $ERROR == 0 ]; then + log_success_msg "$NAME: saved dmesg content in $KDUMP_STAMPDIR" + logger -t $NAME "saved dmesg content in $KDUMP_STAMPDIR" + sync + else + log_failure_msg "$NAME: failed to save dmesg content in $KDUMP_STAMPDIR" + logger -t $NAME "failed to save dmesg content in $KDUMP_STAMPDIR" + fi + fi + + # limit the number of dumps kept on the local machine + if [ -z "${NFS}" -a $ERROR == 0 -a $KDUMP_NUM_DUMPS -gt 0 ] ; then + num_dumps=$(ls -1dv $KDUMP_COREDIR/2* | wc -l) + if [ $num_dumps -gt $KDUMP_NUM_DUMPS ] ; then + purge_num=$((num_dumps - KDUMP_NUM_DUMPS)) + purge_dir=$(ls -1dv $KDUMP_COREDIR/2* | head -$purge_num | tr "\n" " ") + log_action_msg "Too many dumps, purging: $purge_dir" + logger -t $NAME "Too many dumps, purging: $purge_dir" + rm -rf $purge_dir + fi + fi + + # If we use NFS, umount the remote FS + # + if [ -n "$NFS" ];then + umount $KDUMP_COREDIR + UMNT_ERROR=$? + if [ $UMNT_ERROR -ne 0 ] ; then + log_failure_msg "$NAME: Unable to cleanly unmount the NFS file system" + logger -t $NAME "Unable to cleanly unmount the NFS file system" + fi + fi + + return $ERROR +} + +function kdump_save_core_to_ssh() +{ + KDUMP_SSH_KEY="${SSH_KEY:=/root/.ssh/kdump_id_rsa}" + KDUMP_REMOTE_HOST="$SSH" + + KDUMP_STAMP=`date +"%Y%m%d%H%M"` + KDUMP_STAMPDIR=$(define_stampdir $KDUMP_STAMP) + + KDUMP_CORETEMP="$KDUMP_STAMPDIR/dump-incomplete" + 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" + return 1 + fi + + # Add '-F' [flatten] to MAKEDUMP_ARGS, if not there: + [ "${MAKEDUMP_ARGS#-F*}" != "${MAKEDUMP_ARGS}" ] || MAKEDUMP_ARGS="${MAKEDUMP_ARGS} -F" + log_action_msg "sending makedumpfile $MAKEDUMP_ARGS $vmcore_file to $KDUMP_REMOTE_HOST : $KDUMP_CORETEMP" + makedumpfile $MAKEDUMP_ARGS $vmcore_file | ssh -i $KDUMP_SSH_KEY $KDUMP_REMOTE_HOST dd of=$KDUMP_CORETEMP + ERROR=$? + if [ $ERROR -ne 0 ] ; then + log_failure_msg "$NAME: makedumpfile failed, falling back to 'scp'" + logger -t $NAME "makedumpfile failed, falling back to 'scp'" + KDUMP_CORETEMP="$KDUMP_STAMPDIR/vmcore-incomplete" + KDUMP_COREFILE="$KDUMP_STAMPDIR/vmcore.$KDUMP_STAMP" + scp -i $KDUMP_SSH_KEY $vmcore_file $KDUMP_REMOTE_HOST:$KDUMP_CORETEMP + if [ $? -ne 0 ];then + log_failure_msg "$NAME: makedumpfile scp failed. The vmcore file will not be available" + logger -t $NAME "makedumpfile scp failed. The vmcore file will not be available" + else + ERROR=0 + fi + else + ERROR=0 + fi + + # did we succeed? + if [ $ERROR -ne 0 ]; then + log_failure_msg "$NAME: failed to save vmcore in $KDUMP_REMOTE_HOST:$KDUMP_STAMPDIR" + logger -t $NAME "failed to save vmcore in $KDUMP_REMOTE_HOST:$KDUMP_STAMPDIR" + sync + else + ssh -i $KDUMP_SSH_KEY $KDUMP_REMOTE_HOST mv $KDUMP_CORETEMP $KDUMP_COREFILE + log_success_msg "$NAME: saved vmcore in $KDUMP_REMOTE_HOST:$KDUMP_STAMPDIR" + logger -t $NAME "saved vmcore in $KDUMP_REMOTE_HOST:$KDUMP_STAMPDIR" + fi + + # dump the dmesg buffer + if [ "$KDUMP_DUMP_DMESG" -eq 1 ] ; then + log_action_msg "running makedumpfile --dump-dmesg $vmcore_file $KDUMP_TMPDMESG" + makedumpfile --dump-dmesg $vmcore_file $KDUMP_TMPDMESG + ERROR=$? + if [ $ERROR -ne 0 ] ; then + log_failure_msg "$NAME: makedumpfile --dump-dmesg failed. dmesg content will be unavailable" + logger -t $NAME "makedumpfile --dump-dmesg failed. dmesg content will be unavailable" + else + scp -i $KDUMP_SSH_KEY $KDUMP_TMPDMESG $KDUMP_REMOTE_HOST:$KDUMP_DMESGFILE + ERROR=$? + fi + + # did we succeed? + if [ $ERROR == 0 ]; then + log_success_msg "$NAME: saved dmesg content in $KDUMP_REMOTE_HOST:$KDUMP_STAMPDIR" + logger -t $NAME "saved dmesg content in $KDUMP_REMOTE_HOST:$KDUMP_STAMPDIR" + return 0; + else + log_failure_msg "$NAME: failed to save dmesg content in $KDUMP_REMOTE_HOST:$KDUMP_STAMPDIR" + logger -t $NAME "failed to save dmesg content in $KDUMP_REMOTE_HOST:$KDUMP_STAMPDIR" + return 1; + fi + fi +} + +function kdump_propagate() +{ + KDUMP_SSH_KEY="${SSH_KEY:=/root/.ssh/kdump_id_rsa}" + KDUMP_REMOTE_HOST="$SSH" + + # ssh key propagation is only needed + # if remote ssh dump is configured + if [ -z "$KDUMP_REMOTE_HOST" ];then + log_failure_msg "$NAME: Remote ssh dump is not configured. No reason to propagate" + logger -t $NAME "Remote ssh dump is not configured. No reason to propagate" + return 1; + fi + + # Verify if the provided key exists and create it if needed + if [ -f "$KDUMP_SSH_KEY" ];then + echo "Using existing key $KDUMP_SSH_KEY" + else + echo "Need to generate a new ssh key..." + /usr/bin/ssh-keygen -t rsa -f $KDUMP_SSH_KEY -N "" 2>&1 > /dev/null + fi + + KDUMP_SSH_USER=${KDUMP_REMOTE_HOST%@*} + KDUMP_SSH_TARGET=${KDUMP_REMOTE_HOST#*@} + + ssh-copy-id -i $KDUMP_SSH_KEY $KDUMP_SSH_USER@$KDUMP_SSH_TARGET &>/dev/null + ERROR=$? + + if [ $ERROR -ne 0 ];then + log_failure_msg "$NAME: $KDUMP_SSH_KEY failed to be sent to $KDUMP_REMOTE_HOST" + logger -t $NAME "$KDUMP_SSH_KEY failed to be sent to $KDUMP_REMOTE_HOST" + return 1; + else + logger -t $NAME "propagated ssh key $KDUMP_SSH_KEY to server $KDUMP_REMOTE_HOST" + echo "propagated ssh key $KDUMP_SSH_KEY to server $KDUMP_REMOTE_HOST" + return 0; + fi + +} + + + +case "$1" in + test) + DRY_RUN="true" + if [ "$DUMP_MODE" == "fadump" ]; then + check_fadump_support + else + check_kdump_support; + manage_symlinks; + locate_kdump_kernel; + kdump_load; + kdump_test + fi + ;; + show) + DRY_RUN="true" + if [ "$DUMP_MODE" == "fadump" ]; then + check_fadump_support; + else + check_kdump_support; + fi + 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 + ;; + unload) + if [ "$DUMP_MODE" == "fadump" ]; then + fadump_unregister + else + kdump_unload + fi + ;; + status) + if [ "$DUMP_MODE" == "fadump" ]; then + check_fadump_support + if [ `cat $sys_fadump_registered` -eq 1 ] ; then + echo "current state : ready to fadump"; + else + echo "current state : Not ready to fadump"; + fi + else + DRY_RUN=true + check_kdump_support; + manage_symlinks; + if [ `cat $sys_kexec_crash` -eq 1 ] ; then + echo "current state : ready to kdump"; + else + echo "current state : Not ready to kdump"; + fi + fi + exit 0; + ;; + savecore) + if ! [ -z $SSH ];then + kdump_save_core_to_ssh + else + kdump_save_core + fi + exit $? + ;; + propagate) + kdump_propagate; + ;; + symlinks) + if [ -z $2 ];then + log_failure_msg "Invalid argument : missing kernel version" + else + kdump_create_symlinks $2 + fi + ;; + help|-h*|--h*) + kdump_help + ;; + *) + echo "Usage: $0 {help|test|show|status|load|unload|savecore|propagate|symlinks kernel-version}" + exit 1 + ;; +esac + +exit 0 diff --git a/debian/kdump-tools.5.in b/debian/kdump-tools.5.in new file mode 100644 index 0000000..7cadc6f --- /dev/null +++ b/debian/kdump-tools.5.in @@ -0,0 +1,360 @@ +.\" +.TH "kdump-tools.conf" "5" "February 2015" "kdump-tools v1.1.4" "Linux System Administrator's Manual" +.SH NAME +kdump-tools.conf \- configuration file for the kdump-tools init script +.SH SYNOPSIS +.TP +.B /etc/default/kdump-tools +.SH DESCRIPTION +.PP +.B kdump-tools +manages the kdump feature of the Linux kernel. The +.I /etc/default/kdump-tools +file contains local configuration settings of kdump. +.PP +This file is sourced into a shell script, so it's format should be consistent +with shell scripting. +.\" +.\" # --------------------------------------------------------------------------- +.\" +.SH OPTIONS +.TP +.B USE_KDUMP +Controls whether or not +.B kdump-tools +will take any action. +If not set or 0, the +.B kdump-tools +init script will not run. +.TP +.B KDUMP_SYSCTL +Controls when a panic occurs, using the +.BR sysctl (8) +interface. Each time a kdump kernel is loaded, +.RI \*(lq "sysctl -w $KDUMP_SYSCTL" \*(rq +is also executed, thus allowing the system adiminstrator +to maintain customizable conditions for a kdump. +The contents of this variable should be the +.RI \*(lq "variable=value ..." \*(rq +portion of the +.RI \*(lq "sysctl -w" \*(rq +command. If not set, +.RI \*(lq "kernel.panic_on_oops=1" \*(rq +will be used. This feature can be disabled by setting +.br +.B KDUMP_SYSCTL=\*(lq \*(rq + +See +.BR sysctl (8) +for more info. +.\" +.\" # --------------------------------------------------------------------------- +.\" +.TP +.B KDUMP_KERNEL +A full pathname to a kdump kernel (the kernel that is kexec'd at crash time +in a reserved memory area, exposing the old kernel's memory for dumping). If +not set, +.B kdump-config +will use the boot kernel as the kdump kernel if it is relocatable; otherwise +you must set +.B KDUMP_KERNEL +in order for +.B kdump-tools +to work. +.TP +.B KDUMP_INITRD +A full pathname to the kdump initrd (if used). If +.I KDUMP_KERNEL +is set and +.I KDUMP_INITRD +is not set, a warning message will be printed, and an initrd will not be used. +.\" +.\" # --------------------------------------------------------------------------- +.\" +.TP +.B KDUMP_COREDIR +Full path to a directory where the vmcore will be saved. +Date stamped subdirectories are created each time a vmcore file is processed. +If not set, +.I /var/crash +will be used. +.TP +.B KDUMP_FAIL_CMD +This variable specifies a command to run if the vmcore save fails. +If not set, no special action is taken. +.TP +.B KDUMP_DUMP_DMESG +This variable controls if the dmesg buffer is dumped. +If not set or set to 1, the dmesg buffer is dumped. +If set to 0, the dmesg buffer is not dumped. +.TP +.B KDUMP_NUM_DUMPS +This variable specifies how many dump files should be kept on the local machine. +If not set or set to 0, no special action is taken. If set to >1 and there are +too many dump files on the machine, older dumps are removed. The cleanup action +is only taken after a successful dump. This variable is ignored if remote dumping +is enabled. +.\" +.\" +.\" +.\" +.TP +.B MAKEDUMP_ARGS +Extra arguments passed to +.BR makedumpfile (8). +If not set, +.RI \*(lq "-c -d 31" \*(rq +will be used. This tells makedumpfile to use compression, +and reduce the corefile to in-use kernel pages only. See +.BR makedumpfile (8) +for details. +.\" +.\" # --------------------------------------------------------------------------- +.\" +.TP +.B KDUMP_KEXEC_ARGS +Additional arguments to the kexec command used to load the kdump kernel. +.TP +.B KDUMP_CMDLINE +Normally, the current kernel commandline is obtained from +.IR /proc/cmdline . +Set this variable to override +.IR /proc/cmdline . +.TP +.B KDUMP_CMDLINE_APPEND +Additional arguments to append to the command line for the kdump kernel. +If not set, +.RI \*(lq "@KDUMP_CMDLINE_APPEND@" \*(rq +will be used. +.TP +.B SSH +username and hostname of the remote server that will receive the dump +and dmesg files. +.I username@hostname +format must be used. +.TP +.B SSH_KEY +Full path of the ssh private key to be used to login to the remote server. +Use +.RI \*(lq "kdump-config propagate" \*(rq +to send the public key to the remote server. +If not set, the default +.I /root/.ssh/kdump_id_rsa +will be used +.TP +.B HOSTTAG +Select if hostname of IP address will be used as a prefix to the +timestamped directory when sending files to the remote server. +If not set, +.RI \*(lq "ip" \*(rq +will be used. +.TP +.B NFS +Hostname and mount point of the NFS server configured to receive the crash dump. +The syntax must be HOSTNAME:MOUNTPOINT (e.g. +.I remote:/var/crash +) +.\" +.\" # --------------------------------------------------------------------------- +.\" +.SH USAGE +.PP +.B kdump-tools +is as automated as can be at this point but there are some +prerequisites to using it. Additionally, some manual configuration +is still required. +.PP +By default, kernel dumps are stored locally on the system. +.B kdump-tools +can be configured to store the kernel dumps on a remote server accessible +through the network. +.SS Manual Configuration +.IP 1. +.B USE_KDUMP +is set to 0 by default. To enable +.BR kdump-tools , +edit the +.I /etc/default/kdump-tools +configuration file and set +.BR USE_KDUMP=1 . +.\" +.\" +.IP 2. +.B Kernel Command line parameters +\- the kernel must be booted with a +.IR crashkernel = +command line parameter. Some example crashkernel parameters: +.nf + ia64: \fIcrashkernel=384M\fR + x86: \fIcrashkernel=128M\fR + x86_64: \fIcrashkernel=256M\fR +.fi + +Some users may also want to add +.I nmi_watchdog=1 +on certain systems. The nmi watchdog will cause the kernel to panic +(and kdump) if a system hang is detected. + +The kernel command line parameter is generally set in one of these files: +.IR /etc/default/grub , +.IR /boot/grub/menu.lst , +.IR /etc/elilo.conf , +or +.IR /etc/lilo.conf . +If the command line parameter is changed, a reboot is required in +order for it to take effect. +.\" +.\" +.IP 3. +.B Architectural considerations +.RS +.IP A) +.B +x86 && PAE && memory > 4 Gigabytes +\- use +.I +KDUMP_KEXEC_ARGS="--elf64-core-headers" +.IP B) +.B +x86 and x86_64 +\- Some systems can take advantage of the nmi watchdog. Add +.I +nmi_watchdog=1 +to the boot commandline to turn on the watchdog. +The nmi interrupt will call panic if activated. +.IP C) +.B +ia64 +\- Some systems may need +.IR KDUMP_KEXEC_ARGS="--noio" . +Use this if the system hangs after a panic, but before the kdump kernel +begins to boot. +.RE +.\" +.\" +.SS Networked kernel dump Configuration +.IP 1. +Either use +.B SSH +or +.B NFS +to choose which protocol to use to remotely access the target server. +.IP 2 +For +.B SSH +.I username@hostname +needs to be provided along with an appropriate +.B SSH_KEY +definition or use +.RI \*(lq "kdump-config propagate" \*(rq +to propagate a new default ssh key. +.PP +.IP 3 +For +.B NFS +the remote server name must be provided along with the directory where +files are to be copied. +.SS Prerequisites +.IP 1. +.B Boot Kernel Configuration +\- The boot kernel must be configured with +.IR CONFIG_KEXEC=y +and, if it is also to be used as the kdump kernel, +.IR CONFIG_CRASHDUMP=y . + +For ia64, only makedumpfile level 1 will work if the +memory model selected is +.IR CONFIG_DISCONTIG . +.IR CONFIG_SPARSEMEM +is recommended instead. +.\" +.\" +.IP 2. +.B Kdump Kernel Configuration +\- The kdump kernel must be relocated or relocatable. ia64 is relocatable by +default, but x86, x86_64, and powerpc must be built with +.IR CONFIG_RELOCATABLE=y . +Other architectures may require a predermined start location via +.IR CONFIG_PHYSICAL_START . +If the boot kernel is relocatable, +.B kdump-tools +will automatically use that kernel. +Otherwise, a relocatable or relocated kernel will need to be provided. +The kdump kernel can be specified in the +.I /etc/default/kdump-tools +file. +Set the +.B KDUMP_KERNEL +variable and if necessary the +.B KDUMP_INITRD +variable to point to the provided kernel and its initrd. + +The kdump kernel must be configured with: +.B CONFIG_CRASH_DUMP=y +.\" +.\" # --------------------------------------------------------------------------- +.\" +.SH EXAMPLES +.PP +Also panic and kdump on oom: +.RS +KDUMP_SYSCTL="kernel.panic_on_oops=1 vm.panic_on_oom=1" +.RE +.PP +Use this option on x86 systems with PAE and more than 4 gig of memory: +.RS +KDUMP_KEXEC_ARGS="--elf64-core-headers" +.RE +.PP +This option starts a shell if +.B kdump-tools +cannot save the vmcore file: +.RS +KDUMP_FAIL_CMD="/bin/bash; reboot -f" +.RE +.\" +.\" # --------------------------------------------------------------------------- +.\" +.SH FILES +.TP 25 +.I /etc/init.d/kdump-tools +an init script to automatically load a kdump kernel, or save a vmcore and reboot. +.TP 25 +.I /etc/default/kdump-tools +the +.B kdump-tools +configuration file +.TP 25 +.I /var/crash/kernel_link +a link to the current debug kernel +.TP 25 +.I /var/crash/kexec_cmd +the last kexec_cmd executed by +.B kdump-config +.\" +.\" # --------------------------------------------------------------------------- +.\" +.SH DIAGNOSTICS +.PP +See +.BR kdump-config (8) +for explanations of various error messages. +.\" +.\" # --------------------------------------------------------------------------- +.\" +.SH SEE ALSO +.PP +.I /usr/share/doc/kdump-tools/README +.br +.I /usr/share/doc/kdump-tools/README.Debian +.br +.BR kdump-config (8), +.BR kexec (8), +.BR sysctl (8), +.BR makedumpfile (8), +.BR crash (8), +.BR gdb (1), +.SH AUTHOR +.PP +Terry Loftin <terry.loftin@hp.com> diff --git a/debian/kdump-tools.README.Debian b/debian/kdump-tools.README.Debian new file mode 100644 index 0000000..faef2d8 --- /dev/null +++ b/debian/kdump-tools.README.Debian @@ -0,0 +1,70 @@ +The kdump-tools package provides init scripts and configuration files to +use kdump. + +It is as automated as can be at this point, but some manual configuration +may still be required. Specifically: + +1. Kernel Configuration + You must boot a kernel that was configured with: + CONFIG_KEXEC=y + CONFIG_CRASH_DUMP=y + For ia64, you also need: + CONFIG_SPARSEMEM=y + For the resulting dump to be useful, you probably also want: + CONFIG_DEBUG_INFO=y + + If you use CONFIG_DISCONTIG, then you can only use makedumpfile level + 1 (omit zero pages). + +2. Kdump Kernel + You must have a kdump kernel, which is either relocatable or built to + start at a non-default address (which you must also set in the kernel + command-line parameter, see below). Linux on ia64 is always + relocatable; recent x86, x86_64, and powerpc kernels have an option + for this: + CONFIG_RELOCATABLE=y + If your architecture does not support this option, you must build it + with a non-default CONFIG_PHYSICAL_START option. + + If your boot kernel is relocatable, kdump-config will use it as the + kdump kernel. Otherwise, you will have to provide one. Once you + have a relocatable crash kernel, set KDUMP_KERNEL and if necessary + KDUMP_INITRD in the /etc/default/kdump-tools file. + + The kdump kernel needs to be configured with: + CONFIG_CRASH_DUMP=y + +3. Kernel Command line parameter + You must boot your kernel with a 'crashkernel=' command line parameter, + for example: + + crashkernel=128M + + That will reserve 128 MB of memory for the kdump kernel to use in case + of a crash. See Documentation/kdump/kdump.txt in the Linux source for + more advanced crashkernel parameter syntax. + + You may also want to add 'nmi_watchdog=1' on certain systems. + +4. Local Configuration + The /etc/default/kdump-tools file can be modified to reflect your + setup, if automatic detection fails, or if you need specific + architectural settings. + +5. Architectural considerations + A) x86 && PAE && memory > 4 Gigabytes + will need to use KDUMP_KEXEC_ARGS="--elf64-core-headers" + + B) x86 and x86_64 + Some systems can take advantage of the nmi watchdog. Add + nmi_watchdog=panic to the boot commandline to turn on the watchdog. + The nmi interrupt will call panic if activated. + + C) ia64 + some systems may need KDUMP_KEXEC_ARGS="--noio". Use this + if the system hangs after a panic, but before the kdump kernel + begins to boot. +6. Magic SysRq key can be used to trigger a crash + You can manually trigger a kernel crash by using the magic SysRq + key. SysRq usage is described in details in the kernel documentation + (https://www.kernel.org/doc/html/latest/admin-guide/sysrq.html) diff --git a/debian/kdump-tools.conf.in b/debian/kdump-tools.conf.in new file mode 100644 index 0000000..97cccb4 --- /dev/null +++ b/debian/kdump-tools.conf.in @@ -0,0 +1,104 @@ +# kdump-tools configuration +# --------------------------------------------------------------------------- +# USE_KDUMP - controls kdump will be configured +# 0 - kdump kernel will not be loaded +# 1 - kdump kernel will be loaded and kdump is configured +# KDUMP_SYSCTL - controls when a panic occurs, using the sysctl +# interface. The contents of this variable should be the +# "variable=value ..." portion of the 'sysctl -w ' command. +# If not set, the default value "kernel.panic_on_oops=1" will +# be used. Disable this feature by setting KDUMP_SYSCTL=" " +# Example - also panic on oom: +# KDUMP_SYSCTL="kernel.panic_on_oops=1 vm.panic_on_oom=1" +# +USE_KDUMP=1 +#KDUMP_SYSCTL="kernel.panic_on_oops=1" + + +# --------------------------------------------------------------------------- +# Kdump Kernel: +# KDUMP_KERNEL - A full pathname to a kdump kernel. +# KDUMP_INITRD - A full pathname to the kdump initrd (if used). +# If these are not set, kdump-config will try to use the current kernel +# and initrd if it is relocatable. Otherwise, you will need to specify +# these manually. +KDUMP_KERNEL=/var/lib/kdump/vmlinuz +KDUMP_INITRD=/var/lib/kdump/initrd.img + + +# --------------------------------------------------------------------------- +# vmcore Handling: +# KDUMP_COREDIR - local path to save the vmcore to. +# KDUMP_FAIL_CMD - This variable can be used to cause a reboot or +# start a shell if saving the vmcore fails. If not set, "reboot -f" +# is the default. +# Example - start a shell if the vmcore copy fails: +# KDUMP_FAIL_CMD="echo 'makedumpfile FAILED.'; /bin/bash; reboot -f" +# KDUMP_DUMP_DMESG - This variable controls if the dmesg buffer is dumped. +# If unset or set to 1, the dmesg buffer is dumped. If set to 0, the dmesg +# buffer is not dumped. +KDUMP_COREDIR="/var/crash" +#KDUMP_FAIL_CMD="reboot -f" +#KDUMP_DUMP_DMESG= +# KDUMP_NUM_DUMPS - This variable controls how many dump files are kept on +# the machine to prevent running out of disk space. If set to 0 or unset, +# the variable is ignored and no dump files are automatically purged. +KDUMP_COREDIR="/var/crash" +#KDUMP_FAIL_CMD="reboot -f" +#KDUMP_DUMP_DMESG= +#KDUMP_NUM_DUMPS= + + +# --------------------------------------------------------------------------- +# Makedumpfile options: +# MAKEDUMP_ARGS - extra arguments passed to makedumpfile (8). The default, +# if unset, is to pass '-c -d 31' telling makedumpfile to use compression +# and reduce the corefile to in-use kernel pages only. +#MAKEDUMP_ARGS="-c -d 31" + + +# --------------------------------------------------------------------------- +# Kexec/Kdump args +# KDUMP_KEXEC_ARGS - Additional arguments to the kexec command used to load +# the kdump kernel +# Example - Use this option on x86 systems with PAE and more than +# 4 gig of memory: +# KDUMP_KEXEC_ARGS="--elf64-core-headers" +# KDUMP_CMDLINE - The default is to use the contents of /proc/cmdline. +# Set this variable to override /proc/cmdline. +# KDUMP_CMDLINE_APPEND - Additional arguments to append to the command line +# for the kdump kernel. If unset, it defaults to +# "@KDUMP_CMDLINE_APPEND@" +#KDUMP_KEXEC_ARGS="" +#KDUMP_CMDLINE="" +#KDUMP_CMDLINE_APPEND="@KDUMP_CMDLINE_APPEND@" + +# --------------------------------------------------------------------------- +# Architecture specific Overrides: + +# --------------------------------------------------------------------------- +# Remote dump facilities: +# SSH - username and hostname of the remote server that will receive the dump +# and dmesg files. +# SSH_KEY - Full path of the ssh private key to be used to login to the remote +# server. use kdump-config propagate to send the public key to the +# remote server +# HOSTTAG - Select if hostname of IP address will be used as a prefix to the +# timestamped directory when sending files to the remote server. +# 'ip' is the default. +# NFS - Hostname and mount point of the NFS server configured to receive +# the crash dump. The syntax must be {HOSTNAME}:{MOUNTPOINT} +# (e.g. remote:/var/crash) +# NFS_TIMEO - Timeout before NFS retries a request. See man nfs(5) for details. +# NFS_RETRANS - Number of times NFS client retries a request. See man nfs(5) for details. +# SSH="<user at server>" +# +# SSH_KEY="<path>" +# +# HOSTTAG="hostname|[ip]" +# +# NFS="<nfs mount>" +# +# NFS_TIMEO="600" +# +# NFS_RETRANS="3" diff --git a/debian/kdump-tools.config b/debian/kdump-tools.config new file mode 100755 index 0000000..25fc602 --- /dev/null +++ b/debian/kdump-tools.config @@ -0,0 +1,25 @@ +#!/bin/sh -e +CONFFILE=/etc/default/kdump-tools + +# Source debconf library. +. /usr/share/debconf/confmodule + +CONFIG_MODE="$1" + +# Only pickup existing value if we are reconfiguring +# otherwise keep the value provided by dh_input +if test -e "$CONFFILE" -a "$CONFIG_MODE" != "configure"; then + . "$CONFFILE" + + # Guard against admin writing silly things into the + # config file... + if test "$USE_KDUMP" != "1" -a "$USE_KDUMP" != "true" ; then + db_set kdump-tools/use_kdump "false" + else + db_set kdump-tools/use_kdump "true" + fi +fi + +# Setup and select the configuration mode +db_input high kdump-tools/use_kdump || true +db_go diff --git a/debian/kdump-tools.grub.arm64 b/debian/kdump-tools.grub.arm64 new file mode 100644 index 0000000..d73038f --- /dev/null +++ b/debian/kdump-tools.grub.arm64 @@ -0,0 +1 @@ +GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT crashkernel=2G-4G:320M,4G-32G:512M,32G-64G:1024M,64G-128G:2048M,128G-:4096M" diff --git a/debian/kdump-tools.grub.default b/debian/kdump-tools.grub.default new file mode 100644 index 0000000..b020433 --- /dev/null +++ b/debian/kdump-tools.grub.default @@ -0,0 +1 @@ +GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT crashkernel=384M-:128M" diff --git a/debian/kdump-tools.grub.ppc64el b/debian/kdump-tools.grub.ppc64el new file mode 100644 index 0000000..924cedf --- /dev/null +++ b/debian/kdump-tools.grub.ppc64el @@ -0,0 +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" diff --git a/debian/kdump-tools.init b/debian/kdump-tools.init new file mode 100755 index 0000000..43fe7f6 --- /dev/null +++ b/debian/kdump-tools.init @@ -0,0 +1,76 @@ +#! /bin/sh + +### BEGIN INIT INFO +# Provides: kdump-tools +# Required-Start: $syslog $time $local_fs $remote_fs $network +# Required-Stop: $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: +# Short-Description: kdump +# Description: init script to load a kdump kernel or save vmcores +### END INIT INFO + +PATH=/bin:/usr/bin:/sbin:/usr/sbin +NAME="kdump-tools" +DESC="kdump-tools" +export NAME + +. /lib/lsb/init-functions +. /lib/init/vars.sh + +VMCORE_FILE=/proc/vmcore +KDUMP_SCRIPT=/usr/sbin/kdump-config +KDUMP_DEFAULTS=/etc/default/kdump-tools +[ -r $KDUMP_DEFAULTS ] && . $KDUMP_DEFAULTS + +[ $USE_KDUMP -ne 0 ] || exit 0; + +case "$1" in + start) + if init_is_upstart; then + exit 1 + fi + # + # If we have a /proc/vmcore, then we just kdump'ed + # + if [ -e $VMCORE_FILE -a -s $VMCORE_FILE ]; then + echo -n "Starting $DESC: " + $KDUMP_SCRIPT savecore + if [ $? -ne 0 -a -n "$KDUMP_FAIL_CMD" ] ; then + $KDUMP_FAIL_CMD ; + else + date -R ; + reboot -f ; + fi + # + # Else, we've just booted and need to load the kdump kernel + # + else + echo -n "Starting $DESC: " + $KDUMP_SCRIPT load + fi + ;; + stop) + if init_is_upstart; then + exit 1 + fi + echo -n "Stopping $DESC: " + $KDUMP_SCRIPT unload + ;; + status) + $KDUMP_SCRIPT status + ;; + restart|force-reload) + if init_is_upstart; then + exit 1 + fi + # alias the required 'force-reload' option + $KDUMP_SCRIPT unload + $KDUMP_SCRIPT load + ;; + *) + echo "Usage: $0 {start|stop|status|restart|force-reload}" + exit 1 +esac + +exit 0 diff --git a/debian/kdump-tools.install b/debian/kdump-tools.install new file mode 100644 index 0000000..ad9d805 --- /dev/null +++ b/debian/kdump-tools.install @@ -0,0 +1,3 @@ +debian/kdump-config /usr/sbin +debian/kdump-tools.conf /usr/share/kdump-tools/ +debian/50-kdump-tools.rules /lib/udev/rules.d/ diff --git a/debian/kdump-tools.maintscript.default b/debian/kdump-tools.maintscript.default new file mode 100644 index 0000000..f9753eb --- /dev/null +++ b/debian/kdump-tools.maintscript.default @@ -0,0 +1,2 @@ +mv_conffile /etc/default/grub.d/kdump-tools.default /etc/default/grub.d/kdump-tools.cfg 1:1.6.1-2~ kdump-tools +rm_conffile /etc/default/grub.d/kdump-tools..ppc64el 1:1.6.1-2~ kdump-tools diff --git a/debian/kdump-tools.maintscript.ppc64el b/debian/kdump-tools.maintscript.ppc64el new file mode 100644 index 0000000..88bd8fa --- /dev/null +++ b/debian/kdump-tools.maintscript.ppc64el @@ -0,0 +1,2 @@ +mv_conffile /etc/default/grub.d/kdump-tools..ppc64el /etc/default/grub.d/kdump-tools.cfg 1:1.6.1-2~ kdump-tools +rm_conffile /etc/default/grub.d/kdump-tools.default 1:1.6.1-2~ kdump-tools diff --git a/debian/kdump-tools.manpages b/debian/kdump-tools.manpages new file mode 100644 index 0000000..9ce3f8f --- /dev/null +++ b/debian/kdump-tools.manpages @@ -0,0 +1,2 @@ +debian/kdump-config.8 +debian/kdump-tools.5 diff --git a/debian/kdump-tools.postinst b/debian/kdump-tools.postinst new file mode 100755 index 0000000..4fd51e7 --- /dev/null +++ b/debian/kdump-tools.postinst @@ -0,0 +1,95 @@ +#! /bin/sh + +set -e + +update_param() { + . $INITCONFFILE + eval old=\"'$'$1\" + eval new=\"'$'new_$1\" + + if test "$old" = "$new"; then + return + fi + + if test -z "$old"; then + grep -Eq "^ *$1=" "$INITCONFFILE" || echo "$1=" \ + >> "$INITCONFFILE" + fi + + sed -e "s/^ *$1=.*/$1=$new/" < $INITCONFFILE > $INITCONFFILE.$$ + mv -f $INITCONFFILE.$$ $INITCONFFILE +} + +# summary of how this script can be called: +# * <postinst> `configure' <most-recently-configured-version> +# * <old-postinst> `abort-upgrade' <new version> +# * <conflictor's-postinst> `abort-remove' `in-favour' <package> +# <new-version> +# * <deconfigured's-postinst> `abort-deconfigure' `in-favour' +# <failed-install-package> <version> `removing' +# <conflicting-package> <version> +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +case "$1" in + configure) +# ------------------------- Debconf questions start --------------------- + # Handle debconf + . /usr/share/debconf/confmodule + db_get kdump-tools/use_kdump || RET=true + if [ "${RET}" = "true" ]; then + new_USE_KDUMP="1" + else + new_USE_KDUMP="0" + fi +# ------------------------- Debconf questions end --------------------- + + INITCONFFILE=`mktemp /etc/default/kdump-tools.XXXXXX` + cp -pf /usr/share/kdump-tools/kdump-tools.conf $INITCONFFILE + update_param USE_KDUMP + + # Customize crashkernel= value according to architecture + ARCH="$(arch)" + DEF_PRESET="384M-:128M" + case "$ARCH" in + s390x) + HAS_CRASHKERNEL="$(grep crashkernel /etc/zipl.conf)" || true + if test -z "$HAS_CRASHKERNEL"; then + sed -i "s|^\s*parameters\s*=\s*\"\?|&crashkernel=${DEF_PRESET} |" /etc/zipl.conf + zipl + fi + CIO_IGNORE="$(cio_ignore -u -k)" + sed -i "s/\#KDUMP_CMDLINE_APPEND/KDUMP_CMDLINE_APPEND/" $INITCONFFILE + sed -i "/KDUMP_CMDLINE_APPEND/{s|\"$| ${CIO_IGNORE}\"|}" $INITCONFFILE + ;; + esac + + ucfr kdump-tools /etc/default/kdump-tools + UCF_FORCE_CONFFMISS=1 ucf --debconf-ok $INITCONFFILE /etc/default/kdump-tools + rm -f $INITCONFFILE + sync /etc/default/kdump-tools + + # create smaller initrd.img files for kdump use + /etc/kernel/postinst.d/kdump-tools $(uname -r) > /dev/null 2>&1 + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +if [ -x /usr/sbin/update-grub ] && [ -e /boot/grub/grub.cfg ]; then + update-grub +fi + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/kdump-tools.postrm b/debian/kdump-tools.postrm new file mode 100755 index 0000000..1f078af --- /dev/null +++ b/debian/kdump-tools.postrm @@ -0,0 +1,34 @@ +#! /bin/sh + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. + +set -e + +#DEBHELPER# + +case "$1" in + remove) + if test -e /etc/zipl.conf;then + sed -i "s/ crashkernel=.*M//" /etc/zipl.conf + zipl + fi + if [ -x /usr/sbin/update-grub ] && [ -e /boot/grub/grub.cfg ]; then + update-grub + fi + ;; + purge) + rm -rf /var/lib/kdump + if which ucf > /dev/null 2>&1; then + ucf --purge /etc/default/kdump-tools + ucfr -p kdump-tools /etc/default/kdump-tools + fi + rm -f /etc/default/kdump-tools + for i in new old dist; do + rm -f /etc/default/kdump-tools.ucf-$i + done + ;; +esac + diff --git a/debian/kdump-tools.preinst b/debian/kdump-tools.preinst new file mode 100644 index 0000000..7f99b11 --- /dev/null +++ b/debian/kdump-tools.preinst @@ -0,0 +1,44 @@ +#!/bin/sh +# preinst script for kdump-tools +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * <new-preinst> `install' +# * <new-preinst> `install' <old-version> +# * <new-preinst> `upgrade' <old-version> +# * <old-preinst> `abort-upgrade' <new-version> +# for details, see https://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + install|upgrade) + # If in place, undo the symlink transition introduced in 1:1.5.9-6 + oldversion="$2" + if [ -n "$oldversion" ] && dpkg --compare-versions $oldversion lt 1:1.6.1-2~; then + cfglink="/etc/default/grub.d/kdump-tools.cfg" + cfgtarget="/etc/default/grub.d/kdump-tools.default" + if [ -h "$cfglink" ] && [ "$(readlink $cfglink)" = "$cfgtarget" ]; then + rm "$cfglink" + fi + fi + ;; + + abort-upgrade) + ;; + + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/kdump-tools.service b/debian/kdump-tools.service new file mode 100644 index 0000000..880a592 --- /dev/null +++ b/debian/kdump-tools.service @@ -0,0 +1,15 @@ +[Unit] +Description=Kernel crash dump capture service +Wants=network-online.target +After=network-online.target + +[Service] +Type=oneshot +StandardOutput=syslog+console +EnvironmentFile=/etc/default/kdump-tools +ExecStart=/etc/init.d/kdump-tools start +ExecStop=/etc/init.d/kdump-tools stop +RemainAfterExit=yes + +[Install] +WantedBy=multi-user.target diff --git a/debian/kdump-tools.templates b/debian/kdump-tools.templates new file mode 100644 index 0000000..0a09df6 --- /dev/null +++ b/debian/kdump-tools.templates @@ -0,0 +1,7 @@ +Template: kdump-tools/use_kdump +Type: boolean +Default: true +_Description: Should kdump-tools be enabled by default? + If you choose this option, the kdump-tools mechanism will be + enabled. A reboot is still required in order to enable the + crashkernel kernel parameter. diff --git a/debian/kdump-tools.upstart b/debian/kdump-tools.upstart new file mode 100644 index 0000000..fd3ba73 --- /dev/null +++ b/debian/kdump-tools.upstart @@ -0,0 +1,46 @@ +# kdump-tools + +description "kdump-tools" +author "Louis Bouchard <louis.bouchard@ubuntu.com>" + +start on starting rc-sysinit +stop on runlevel [!2345] + +console output + +task + +script + PATH=/bin:/usr/bin:/sbin:/usr/sbin + + . /lib/lsb/init-functions + . /lib/init/vars.sh + + VMCORE_FILE=/proc/vmcore + KDUMP_SCRIPT=/usr/sbin/kdump-config + KDUMP_DEFAULTS=/etc/default/kdump-tools + [ -r $KDUMP_DEFAULTS ] && . $KDUMP_DEFAULTS + + [ ${USE_KDUMP:-0} -ne 0 ] || exit 0; + + # + # If we have a /proc/vmcore, then we just panic'd + # + if [ -e $VMCORE_FILE -a -s $VMCORE_FILE ]; then + $KDUMP_SCRIPT savecore + if [ $? -ne 0 -a -n "$KDUMP_FAIL_CMD" ] ; then + $KDUMP_FAIL_CMD ; + else + # + # Since we panic'd, reboot to a normal system + # + date -R ; + reboot -f ; + fi + # + # Else, we've just booted and need to load the kdump kernel + # + else + $KDUMP_SCRIPT load + fi +end script diff --git a/debian/kernel-postinst-generate-initrd b/debian/kernel-postinst-generate-initrd new file mode 100755 index 0000000..57905bf --- /dev/null +++ b/debian/kernel-postinst-generate-initrd @@ -0,0 +1,74 @@ +#!/bin/sh -e + +version="$1" +kdumpdir="/var/lib/kdump" + +[ -x /usr/sbin/mkinitramfs ] || exit 0 + +# passing the kernel version is required +if [ -z "${version}" ]; then + echo >&2 "W: kdump-tools: ${DPKG_MAINTSCRIPT_PACKAGE:-kdump-tools package} did not pass a version number" + exit 2 +fi + +if ! linux-version list | grep "${version}" > /dev/null ; then + exit 0 +fi + +# exit if kernel does not need an initramfs +if [ "$INITRD" = 'No' ]; then + exit 0 +fi + +# avoid running multiple times +if [ -n "$DEB_MAINT_PARAMS" ]; then + eval set -- "$DEB_MAINT_PARAMS" + if [ -z "$1" ] || [ "$1" != "configure" ]; then + exit 0 + fi +fi + +# We need a modified copy of initramfs-tools directory +# with MODULES=dep in initramfs.conf +if [ ! -d "$kdumpdir" ];then + mkdir "$kdumpdir" || true +fi +# Force re-creation of $kdumpdir/initramfs-tools +# in case the source has changed since last time +# we ran +if [ -d "$kdumpdir/initramfs-tools" ];then + rm -Rf $kdumpdir/initramfs-tools || true +fi +cp -pr /etc/initramfs-tools "$kdumpdir" || true + +initramfsdir="$kdumpdir/initramfs-tools" + +# Add scsi_dh_* modules if in use otherwise +# kexec reboot on multipath will fail +# (LP: #1635597) +for I in $(lsmod | grep scsi_dh | cut -d" " -f1);do + echo "${I}" >> $initramfsdir/modules +done + +sed -e 's/MODULES=.*/MODULES=dep/' /etc/initramfs-tools/initramfs.conf > "$initramfsdir/initramfs.conf" || true +if ! [ -e "$initramfsdir/initramfs.conf" ];then + echo >&2 "W: kdump-tools: Unable to create $initramfsdir/initramfs.conf" + exit 2 +fi + +# Cleaning up existing initramfs with same version +# as mkinitramfs do not have a force option +if [ -e "$kdumpdir/initrd.img-${version}" ];then + rm -f "$kdumpdir/initrd.img-${version}" || true +fi + +# we're good - create initramfs. +echo "kdump-tools: Generating $kdumpdir/initrd.img-${version}" +if mkinitramfs -d "$initramfsdir" -o "$kdumpdir/initrd.img-${version}.new" "${version}";then + mv "$kdumpdir/initrd.img-${version}.new" "$kdumpdir/initrd.img-${version}" +else + mkinitramfs_return="$?" + rm -f "${initramfs}.new" + echo "update-initramfs: failed for ${initramfs} with $mkinitramfs_return." >&2 + exit $mkinitramfs_return +fi diff --git a/debian/kernel-postrm-delete-initrd b/debian/kernel-postrm-delete-initrd new file mode 100755 index 0000000..424d6a2 --- /dev/null +++ b/debian/kernel-postrm-delete-initrd @@ -0,0 +1,31 @@ +#!/bin/sh -e + +version="$1" +kdumpdir="/var/lib/kdump" + +[ -x /usr/sbin/update-initramfs ] || exit 0 + +# passing the kernel version is required +if [ -z "${version}" ]; then + echo >&2 "W: kdump-tools: ${DPKG_MAINTSCRIPT_PACKAGE:-kernel package} did not pass a version number" + exit 0 +fi + +# exit if custom kernel does not need an initramfs +if [ "$INITRD" = 'No' ]; then + exit 0 +fi + +# avoid running multiple times +if [ -n "$DEB_MAINT_PARAMS" ]; then + eval set -- "$DEB_MAINT_PARAMS" + if [ -z "$1" ] || [ "$1" != "remove" ]; then + exit 0 + fi +fi + +# delete initramfs +echo "kdump-tools: Removing $kdumpdir/initrd.img-${version}" +if [ -e "$kdumpdir/initrd.img-${version}" ];then + rm -f "$kdumpdir/initrd.img-${version}" || true +fi diff --git a/debian/makedumpfile.install b/debian/makedumpfile.install new file mode 100644 index 0000000..0267bef --- /dev/null +++ b/debian/makedumpfile.install @@ -0,0 +1 @@ +usr/bin/* /usr/bin diff --git a/debian/makedumpfile.manpages b/debian/makedumpfile.manpages new file mode 100644 index 0000000..7a97847 --- /dev/null +++ b/debian/makedumpfile.manpages @@ -0,0 +1,2 @@ +makedumpfile.8 +makedumpfile.conf.5 diff --git a/debian/patches/0001-Remove-libebl-linkage.patch b/debian/patches/0001-Remove-libebl-linkage.patch new file mode 100644 index 0000000..7c66947 --- /dev/null +++ b/debian/patches/0001-Remove-libebl-linkage.patch @@ -0,0 +1,16 @@ +Description: Remove libebl from link options +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/Makefile ++++ b/Makefile +@@ -52,7 +52,7 @@ + SRC_ARCH = arch/arm.c arch/arm64.c arch/x86.c arch/x86_64.c arch/ia64.c arch/ppc64.c arch/s390x.c arch/ppc.c arch/sparc64.c + OBJ_ARCH=$(patsubst %.c,%.o,$(SRC_ARCH)) + +-LIBS = -ldw -lbz2 -lebl -ldl -lelf -lz ++LIBS = -ldw -lbz2 -ldl -lelf -lz + ifneq ($(LINKTYPE), dynamic) + LIBS := -static $(LIBS) + endif diff --git a/debian/patches/0002-adapt-makefile-to-debian.patch b/debian/patches/0002-adapt-makefile-to-debian.patch new file mode 100644 index 0000000..7b53f3c --- /dev/null +++ b/debian/patches/0002-adapt-makefile-to-debian.patch @@ -0,0 +1,36 @@ +Index: makedumpfile-1.5.9/Makefile +=================================================================== +--- makedumpfile-1.5.9.orig/Makefile 2015-11-24 12:59:52.503286944 +0100 ++++ makedumpfile-1.5.9/Makefile 2015-11-24 12:59:52.499286944 +0100 +@@ -80,26 +80,18 @@ + + makedumpfile: $(SRC_BASE) $(OBJ_PART) $(OBJ_ARCH) + $(CC) $(CFLAGS) $(LDFLAGS) $(OBJ_PART) $(OBJ_ARCH) -rdynamic -o $@ $< $(LIBS) +- echo .TH MAKEDUMPFILE 8 \"$(DATE)\" \"makedumpfile v$(VERSION)\" \"Linux System Administrator\'s Manual\" > temp.8 +- grep -v "^.TH MAKEDUMPFILE 8" $(VPATH)makedumpfile.8 >> temp.8 +- mv temp.8 makedumpfile.8 +- gzip -c ./makedumpfile.8 > ./makedumpfile.8.gz +- echo .TH MAKEDUMPFILE.CONF 5 \"$(DATE)\" \"makedumpfile v$(VERSION)\" \"Linux System Administrator\'s Manual\" > temp.5 +- grep -v "^.TH MAKEDUMPFILE.CONF 5" $(VPATH)makedumpfile.conf.5 >> temp.5 +- mv temp.5 makedumpfile.conf.5 +- gzip -c ./makedumpfile.conf.5 > ./makedumpfile.conf.5.gz + + eppic_makedumpfile.so: extension_eppic.c + $(CC) $(CFLAGS) $(LDFLAGS) -shared -rdynamic -o $@ extension_eppic.c -fPIC -leppic -ltinfo + + clean: +- rm -f $(OBJ) $(OBJ_PART) $(OBJ_ARCH) makedumpfile makedumpfile.8.gz makedumpfile.conf.5.gz ++ rm -f $(OBJ) $(OBJ_PART) $(OBJ_ARCH) makedumpfile + + install: +- install -m 755 -d ${DESTDIR}/usr/sbin ${DESTDIR}/usr/share/man/man5 ${DESTDIR}/usr/share/man/man8 ${DESTDIR}/etc +- install -m 755 -t ${DESTDIR}/usr/sbin makedumpfile $(VPATH)makedumpfile-R.pl +- install -m 644 -t ${DESTDIR}/usr/share/man/man8 makedumpfile.8.gz +- install -m 644 -t ${DESTDIR}/usr/share/man/man5 makedumpfile.conf.5.gz ++ install -m 755 -d ${DESTDIR}/usr/bin ${DESTDIR}/usr/share/man/man5 ${DESTDIR}/usr/share/man/man8 ${DESTDIR}/etc ++ install -m 755 -t ${DESTDIR}/usr/bin makedumpfile makedumpfile-R.pl ++ install -m 644 -t ${DESTDIR}/usr/share/man/man8 makedumpfile.8 ++ install -m 644 -t ${DESTDIR}/usr/share/man/man5 makedumpfile.conf.5 + install -m 644 -D $(VPATH)makedumpfile.conf ${DESTDIR}/etc/makedumpfile.conf.sample + mkdir -p ${DESTDIR}/usr/share/makedumpfile-${VERSION}/eppic_scripts + install -m 644 -t ${DESTDIR}/usr/share/makedumpfile-${VERSION}/eppic_scripts/ $(VPATH)eppic_scripts/* diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..8d0f986 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1,2 @@ +0001-Remove-libebl-linkage.patch +0002-adapt-makefile-to-debian.patch diff --git a/debian/po/POTFILES.in b/debian/po/POTFILES.in new file mode 100644 index 0000000..ff63d8a --- /dev/null +++ b/debian/po/POTFILES.in @@ -0,0 +1 @@ +[type: gettext/rfc822deb] kdump-tools.templates diff --git a/debian/po/da.po b/debian/po/da.po new file mode 100644 index 0000000..f6f73c5 --- /dev/null +++ b/debian/po/da.po @@ -0,0 +1,33 @@ +# Danish translation makedumpfile. +# Copyright (C) 2017 makedumpfile & nedenstående oversættere. +# This file is distributed under the same license as the makedumpfile package. +# Joe Hansen (joedalton2@yahoo.dk), 2017. +# +msgid "" +msgstr "" +"Project-Id-Version: makedumpfile\n" +"Report-Msgid-Bugs-To: makedumpfile@packages.debian.org\n" +"POT-Creation-Date: 2016-06-10 12:46+0200\n" +"PO-Revision-Date: 2017-03-04 17:30+01:00\n" +"Last-Translator: Joe Hansen <joedalton2@yahoo.dk>\n" +"Language-Team: Danish <debian-l10n-danish@lists.debian.org>\n" +"Language: da\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../kdump-tools.templates:1001 +msgid "Should kdump-tools be enabled by default?" +msgstr "Skal kdump-tools være aktiveret som standard?" + +#. Type: boolean +#. Description +#: ../kdump-tools.templates:1001 +msgid "" +"If you choose this option, the kdump-tools mechanism will be enabled. A " +"reboot is still required in order to enable the crashkernel kernel parameter." +msgstr "" +"Hvis du vælge denne indstilling, så vil kdump-tools-mekanismen være aktiveret. " +"En genstart er stadig krævet for at aktivere kerneparameteren crashkernel." diff --git a/debian/po/de.po b/debian/po/de.po new file mode 100644 index 0000000..cbb0e28 --- /dev/null +++ b/debian/po/de.po @@ -0,0 +1,35 @@ +# German translation of the makedumpfile template. +# Copyright (C) 2006, 2007, 2008, 2009 NEC Corporation. +# Copyright (C) of this file Chris Leick <c.leick@vollbio.de> 2016. +# This file is distributed under the same license as the makedumpfile package. +# +msgid "" +msgstr "" +"Project-Id-Version: makedumpfile 1.6.0-2\n" +"Report-Msgid-Bugs-To: makedumpfile@packages.debian.org\n" +"POT-Creation-Date: 2016-06-10 12:46+0200\n" +"PO-Revision-Date: 2016-10-28 20:34+0100\n" +"Last-Translator: Chris Leick <c.leick@vollbio.de>\n" +"Language-Team: de <debian-l10n-german@lists.debian.org>\n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + + +#. Type: boolean +#. Description +#: ../kdump-tools.templates:1001 +msgid "Should kdump-tools be enabled by default?" +msgstr "Sollen die »kdump-tools« standardmäßig aktiviert werden?" + +#. Type: boolean +#. Description +#: ../kdump-tools.templates:1001 +msgid "" +"If you choose this option, the kdump-tools mechanism will be enabled. A " +"reboot is still required in order to enable the crashkernel kernel parameter." +msgstr "" +"Falls Sie diese Option auswählen, wird der »kdump-tools«-Mechanismus " +"aktiviert. Ein Systemneustart ist immer noch erforderlich, um die " +"Crashkernel-Kernel-Parameter zu aktivieren." diff --git a/debian/po/fr.po b/debian/po/fr.po new file mode 100644 index 0000000..e6410e8 --- /dev/null +++ b/debian/po/fr.po @@ -0,0 +1,36 @@ +# Translation of makedumpfile debconf templates to French +# Copyright (C) 2016 Debian French l10n team <debian-l10n-french@lists.debian.org> +# This file is distributed under the same license as the makedumpfile package. +# +# Jean-Pierre Giraud <jean-pierregiraud@neuf.fr>, 2016. +msgid "" +msgstr "" +"Project-Id-Version: makedumpfile\n" +"Report-Msgid-Bugs-To: makedumpfile@packages.debian.org\n" +"POT-Creation-Date: 2016-06-10 12:46+0200\n" +"PO-Revision-Date: 2016-07-04 22:44+0100\n" +"Last-Translator: Jean-Pierre Giraud <jean-pierregiraud@neuf.fr>\n" +"Language-Team: French <debian-l10n-french@lists.debian.org>\n" +"Language: fr_FR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Lokalize 2.0\n" + +#. Type: boolean +#. Description +#: ../kdump-tools.templates:1001 +msgid "Should kdump-tools be enabled by default?" +msgstr "Activer kdump-tools par défaut ?" + +#. Type: boolean +#. Description +#: ../kdump-tools.templates:1001 +msgid "" +"If you choose this option, the kdump-tools mechanism will be enabled. A " +"reboot is still required in order to enable the crashkernel kernel parameter." +msgstr "" +"Si vous choisissez cette option, le mécanisme de kdump-tools sera activé. " +"Un redémarrage est nécessaire afin d'activer le paramètre crashkernel " +"du noyau." diff --git a/debian/po/nl.po b/debian/po/nl.po new file mode 100644 index 0000000..e94a230 --- /dev/null +++ b/debian/po/nl.po @@ -0,0 +1,37 @@ +# Dutch translation of makedumpfile debconf templates. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the makedumpfile package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# Frans Spiesschaert <Frans.Spiesschaert@yucom.be>, 2016. +# +msgid "" +msgstr "" +"Project-Id-Version: makedumpfile\n" +"Report-Msgid-Bugs-To: makedumpfile@packages.debian.org\n" +"POT-Creation-Date: 2016-06-10 12:46+0200\n" +"PO-Revision-Date: 2016-08-01 21:14+0200\n" +"Last-Translator: Frans Spiesschaert <Frans.Spiesschaert@yucom.be>\n" +"Language-Team: Debian Dutch l10n Team <debian-l10n-dutch@lists.debian.org>\n" +"Language: nl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Gtranslator 2.91.6\n" + +#. Type: boolean +#. Description +#: ../kdump-tools.templates:1001 +msgid "Should kdump-tools be enabled by default?" +msgstr "Moet kdump-tools standaard aangezet worden?" + +#. Type: boolean +#. Description +#: ../kdump-tools.templates:1001 +msgid "" +"If you choose this option, the kdump-tools mechanism will be enabled. A " +"reboot is still required in order to enable the crashkernel kernel parameter." +msgstr "" +"Indien u voor deze optie kiest, zal het kdump-tools-mechanisme standaard " +"gebruikt worden. Een herstart blijft nog altijd nodig om de kernelparameter " +"crashkernel te activeren." diff --git a/debian/po/pt_BR.po b/debian/po/pt_BR.po new file mode 100644 index 0000000..b3d0841 --- /dev/null +++ b/debian/po/pt_BR.po @@ -0,0 +1,35 @@ +# Debconf translations for makedumpfile. +# Copyright (C) 2016 THE makedumpfile'S COPYRIGHT HOLDER +# This file is distributed under the same license as the makedumpfile package. +# Adriano Rafael Gomes <adrianorg@arg.eti.br>, 2016. +# +msgid "" +msgstr "" +"Project-Id-Version: makedumpfile\n" +"Report-Msgid-Bugs-To: makedumpfile@packages.debian.org\n" +"POT-Creation-Date: 2016-06-10 12:46+0200\n" +"PO-Revision-Date: 2016-07-23 19:43-0300\n" +"Last-Translator: Adriano Rafael Gomes <adrianorg@arg.eti.br>\n" +"Language-Team: Brazilian Portuguese <debian-l10n-portuguese@lists.debian." +"org>\n" +"Language: pt_BR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../kdump-tools.templates:1001 +msgid "Should kdump-tools be enabled by default?" +msgstr "O kdump-tools deve ser habilitado por padrão?" + +#. Type: boolean +#. Description +#: ../kdump-tools.templates:1001 +msgid "" +"If you choose this option, the kdump-tools mechanism will be enabled. A " +"reboot is still required in order to enable the crashkernel kernel parameter." +msgstr "" +"Se você escolher essa opção, o mecanismo kdump-tools será habilitado. Uma " +"reinicialização do sistema ainda é necessária para habilitar o parâmetro " +"crashkernel do kernel." diff --git a/debian/po/pt_PT.po b/debian/po/pt_PT.po new file mode 100644 index 0000000..5fedbaf --- /dev/null +++ b/debian/po/pt_PT.po @@ -0,0 +1,35 @@ +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the makedumpfile package. +# +# Rui Branco - DebianPT <ruipb@debianpt.org>, 2018. +msgid "" +msgstr "" +"Project-Id-Version: makedumpfile\n" +"Report-Msgid-Bugs-To: makedumpfile@packages.debian.org\n" +"POT-Creation-Date: 2016-06-10 12:46+0200\n" +"PO-Revision-Date: 2018-05-09 19:11+0000\n" +"Last-Translator: Rui Branco - DebianPT <ruipb@debianpt.org>\n" +"Language-Team: Portuguese <traduz@debianpt.org>\n" +"Language: pt\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. Type: boolean +#. Description +#: ../kdump-tools.templates:1001 +msgid "Should kdump-tools be enabled by default?" +msgstr "Deverá o kdump-tools ser activado por omissão?" + +#. Type: boolean +#. Description +#: ../kdump-tools.templates:1001 +msgid "" +"If you choose this option, the kdump-tools mechanism will be enabled. A " +"reboot is still required in order to enable the crashkernel kernel parameter." +msgstr "" +"Se escolher esta opção, o mecanismo do kdump-tools será activado. Uma " +"reinicialização será no entanto necessária para activar o parâmetro" +"crashkernel do kernel." + diff --git a/debian/po/ru.po b/debian/po/ru.po new file mode 100644 index 0000000..df55550 --- /dev/null +++ b/debian/po/ru.po @@ -0,0 +1,36 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the makedumpfile package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: makedumpfile\n" +"Report-Msgid-Bugs-To: makedumpfile@packages.debian.org\n" +"POT-Creation-Date: 2016-06-10 12:46+0200\n" +"PO-Revision-Date: 2017-11-30 00:39+0500\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.0.4\n" +"Last-Translator: Lev Lamberov <dogsleg@debian.org>\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +"Language: ru\n" + +#. Type: boolean +#. Description +#: ../kdump-tools.templates:1001 +msgid "Should kdump-tools be enabled by default?" +msgstr "Следует ли включить kdump-tools по умолчанию?" + +#. Type: boolean +#. Description +#: ../kdump-tools.templates:1001 +msgid "" +"If you choose this option, the kdump-tools mechanism will be enabled. A " +"reboot is still required in order to enable the crashkernel kernel parameter." +msgstr "" +"Если вы выберите эту опцию, то механизм kdump-tools будет включён. Чтобы " +"включить параметр ядра crashkernel, требуется перезагрузка." diff --git a/debian/po/templates.pot b/debian/po/templates.pot new file mode 100644 index 0000000..ee439e4 --- /dev/null +++ b/debian/po/templates.pot @@ -0,0 +1,32 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the makedumpfile package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: makedumpfile\n" +"Report-Msgid-Bugs-To: makedumpfile@packages.debian.org\n" +"POT-Creation-Date: 2016-06-10 12:46+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../kdump-tools.templates:1001 +msgid "Should kdump-tools be enabled by default?" +msgstr "" + +#. Type: boolean +#. Description +#: ../kdump-tools.templates:1001 +msgid "" +"If you choose this option, the kdump-tools mechanism will be enabled. A " +"reboot is still required in order to enable the crashkernel kernel parameter." +msgstr "" diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..0043591 --- /dev/null +++ b/debian/rules @@ -0,0 +1,58 @@ +#!/usr/bin/make -f + +DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH) +ifeq ($(shell dpkg-vendor --derives-from Ubuntu && echo yes),yes) + SUBSTVARS = -Vdist:Depends="kexec-tools (>= 1:2.0.10-2)" +else + SUBSTVARS = -Vdist:Depends="kexec-tools" +endif + +KDUMP_CMDLINE_APPEND = nr_cpus=1 systemd.unit=kdump-tools.service +ifeq ($(DEB_HOST_ARCH),arm64) + # pass +else ifeq ($(DEB_HOST_ARCH),ppc64el) + KDUMP_CMDLINE_APPEND += irqpoll noirqdistrib nousb +else + KDUMP_CMDLINE_APPEND += irqpoll nousb ata_piix.prefer_ms_hyperv=0 +endif + +%: + dh $@ --with=systemd + +override_dh_gencontrol: + dh_gencontrol -- $(SUBSTVARS) + +override_dh_auto_build: + dh_auto_build -- LINKTYPE=dynamic USELZO=on + +kdump_cmdline_insert = sed "s/@KDUMP_CMDLINE_APPEND@/$(KDUMP_CMDLINE_APPEND)/" < $< > $@ +debian/kdump-config: debian/kdump-config.in + $(kdump_cmdline_insert) +debian/kdump-tools.conf: debian/kdump-tools.conf.in + $(kdump_cmdline_insert) +debian/kdump-tools.5: debian/kdump-tools.5.in + $(kdump_cmdline_insert) + +override_dh_install: debian/kdump-config debian/kdump-tools.conf debian/kdump-tools.5 + dh_install + install -D -m 755 debian/kernel-postinst-generate-initrd debian/kdump-tools/etc/kernel/postinst.d/kdump-tools + install -D -m 755 debian/kernel-postrm-delete-initrd debian/kdump-tools/etc/kernel/postrm.d/kdump-tools + [ ! -f debian/kdump-tools.grub.$(DEB_HOST_ARCH) ] || \ + install -D -m 644 debian/kdump-tools.grub.$(DEB_HOST_ARCH) debian/kdump-tools/etc/default/grub.d/kdump-tools.cfg + [ -f debian/kdump-tools.grub.$(DEB_HOST_ARCH) ] || \ + install -D -m 644 debian/kdump-tools.grub.default debian/kdump-tools/etc/default/grub.d/kdump-tools.cfg + +override_dh_installdeb: + rm -f debian/kdump-tools.maintscript + [ ! -f debian/kdump-tools.maintscript.$(DEB_HOST_ARCH) ] || \ + ln -s kdump-tools.maintscript.$(DEB_HOST_ARCH) \ + debian/kdump-tools.maintscript + [ -h debian/kdump-tools.maintscript ] || \ + ln -s kdump-tools.maintscript.default \ + debian/kdump-tools.maintscript + dh_installdeb + +override_dh_auto_clean: + rm -f debian/kdump-tools.maintscript + rm -f debian/kdump-config debian/kdump-tools.conf debian/kdump-tools.5 + dh_auto_clean diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian/tests/control b/debian/tests/control new file mode 100644 index 0000000..2397f65 --- /dev/null +++ b/debian/tests/control @@ -0,0 +1,3 @@ +Tests: crash +Restrictions: breaks-testbed, needs-root, isolation-machine, needs-reboot, needs-recommends +Depends: @, file diff --git a/debian/tests/crash b/debian/tests/crash new file mode 100644 index 0000000..a9c9e80 --- /dev/null +++ b/debian/tests/crash @@ -0,0 +1,85 @@ +#!/bin/bash + +function error() +{ + echo "makedumpfile: ERROR: crash test: $@" + exit 1 +} + +function report() +{ + echo "makedumpfile: crash test: $@" +} + +function skip() +{ + echo "makedumpfile: SKIP: crash test: $@" + exit 0 +} + +function wait_for_systemd_service() +{ + TIMEOUT=180 + while + ! systemctl is-active kdump-tools && + ! systemctl is-failed kdump-tools && + [ $TIMEOUT -gt 0 ] ; do + TIMEOUT=$((TIMEOUT - 1)) + done +} + +function get_crash_kernel_size() +{ + if kexec --print-ckr-size > /dev/null 2> /dev/null ; then + kexec --print-ckr-size + elif [ -e /sys/kernel/kexec_crash_size ] ; then + cat /sys/kernel/kexec_crash_size + else + echo 0 + fi +} + +case "$AUTOPKGTEST_REBOOT_MARK" in + "") + report "rebooting to have crashkernel on cmdline" + /tmp/autopkgtest-reboot crashkernel + ;; + crashkernel) + report "checking for crashkernel" + if ! grep crashkernel /proc/cmdline > /dev/null; then + error "no crashkernel option on cmdline" + fi + report "checking crash kernel size" + crksize=`get_crash_kernel_size` + if [ $crksize -eq 0 ]; then + skip "crash kernel size is 0, possibly not enough memory" + fi + report "waiting for kdump-tools systemd service" + wait_for_systemd_service + if systemctl is-failed kdump-tools; then + error "kdump-tools systemd service failed" + fi + report "checking kdump-config status" + if ! kdump-config status | grep ": ready to kdump" > /dev/null; then + error "kdump is not ready" + fi + /tmp/autopkgtest-reboot-prepare crash + echo 1 > /proc/sys/kernel/sysrq + echo c > /proc/sysrq-trigger + ;; + crash) + report "checking for crash file" + found=false + for i in `find /var/crash/ -name dump.*`; do + if file $i | grep 'Kdump compressed dump' > /dev/null; then + report "Found compressed dump at $i" + found=true + else + error "$i is not a compressed dump" + fi + done + if [ "$found" = "false" ]; then + error "Found no compressed dumps" + fi + ;; +esac diff --git a/debian/watch b/debian/watch new file mode 100644 index 0000000..745d519 --- /dev/null +++ b/debian/watch @@ -0,0 +1,3 @@ +version=4 +opts="uversionmangle=s/20061002/1.0.1~/" \ +http://sf.net/makedumpfile .*/makedumpfile-([\d\.]+)@ARCHIVE_EXT@ |