-
Notifications
You must be signed in to change notification settings - Fork 669
Enable kdump support #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
e6e36fc
Enable kdump support
MateuszMalisz 914a0c4
Add kexec-tools to license exceptions list
MateuszMalisz b90f804
Update kernel-hyperv config
MateuszMalisz 9ae0b00
Update hyperv-kernel config.
MateuszMalisz 2cef824
Add squashfs-tools to license exceptions list
MateuszMalisz e9dc5b7
Update kernel-hyperv signatures
MateuszMalisz 7f2c7b9
Remove surplus kdumpctl
MateuszMalisz b53db7e
Update systemd-bootstrap spec.
MateuszMalisz 4f8ab75
Move information {kexec,squashfs}-tools licenses to LICENSES-MAP.md
MateuszMalisz c6de330
Update cgmanifest
MateuszMalisz 9cd6772
Update toolchain manifest
MateuszMalisz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| { | ||
| "Signatures": { | ||
| "config": "567d5225a65b710d6190d92441e9042c29f045a8aa47b7c3338a1a919030457c", | ||
| "config": "b6b92676da3878a143eff28c60afd63b4fd1abf719a620048a07aea4e699b0f7", | ||
| "linux-msft-5.4.42.tar.gz": "5067bd1b4f8a5dafc0438686f9d55fadae1a1d14a266311f6821bfa9e33781f8" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| { | ||
| "Signatures": { | ||
| "config": "3a63dfebe79b5e3adee4fef50b5e15b0a5bd6417fc4a62def8d73883cc52f03d", | ||
| "config": "a567dbf795e9046a43cdf6b2195fd88da79dc788777cda31974ffba0254eff0a", | ||
| "config_aarch64": "cdd7dda76915a09c17ac8e811f6c81655f89cbdf9b9c6f9cf3e2f7a8638618bc", | ||
| "linux-msft-5.4.42.tar.gz": "5067bd1b4f8a5dafc0438686f9d55fadae1a1d14a266311f6821bfa9e33781f8" | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| SUBSYSTEM=="cpu", ACTION=="add", GOTO="kdump_reload" | ||
| SUBSYSTEM=="cpu", ACTION=="remove", GOTO="kdump_reload" | ||
| SUBSYSTEM=="memory", ACTION=="online", GOTO="kdump_reload" | ||
| SUBSYSTEM=="memory", ACTION=="offline", GOTO="kdump_reload" | ||
|
|
||
| GOTO="kdump_reload_end" | ||
|
|
||
| LABEL="kdump_reload" | ||
|
|
||
| # If kdump is not loaded, calling kdump-udev-throttle will end up | ||
| # doing nothing, but systemd-run will always generate extra logs for | ||
| # each call, so trigger the kdump-udev-throttler only if kdump | ||
| # service is active to avoid unnecessary logs | ||
| RUN+="/bin/sh -c '/usr/bin/systemctl is-active kdump.service || exit 0; /usr/bin/systemd-run --quiet --no-block /usr/lib/udev/kdump-udev-throttler'" | ||
|
|
||
| LABEL="kdump_reload_end" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| #!/bin/bash | ||
|
|
||
| . /etc/sysconfig/kdump | ||
| . /lib/kdump/kdump-lib.sh | ||
|
|
||
| KDUMP_KERNEL="" | ||
| KDUMP_INITRD="" | ||
|
|
||
| check() { | ||
| if [ ! -f /etc/sysconfig/kdump ] || [ ! -f /lib/kdump/kdump-lib.sh ]\ | ||
| || [ -n "${IN_KDUMP}" ] | ||
| then | ||
| return 1 | ||
| fi | ||
| return 255 | ||
| } | ||
|
|
||
| depends() { | ||
| echo "base shutdown" | ||
| return 0 | ||
| } | ||
|
|
||
| prepare_kernel_initrd() { | ||
| KDUMP_BOOTDIR=$(check_boot_dir "${KDUMP_BOOTDIR}") | ||
| if [ -z "$KDUMP_KERNELVER" ]; then | ||
| kdump_kver=`uname -r` | ||
| if [ "$kernel" != "$kdump_kver" ]; then | ||
| dwarn "Using current kernel version '$kdump_kver' for early kdump," \ | ||
| "but the initramfs is generated for kernel version '$kernel'" | ||
| fi | ||
| else | ||
| kdump_kver=$KDUMP_KERNELVER | ||
| fi | ||
| KDUMP_KERNEL="${KDUMP_BOOTDIR}/${KDUMP_IMG}-${kdump_kver}${KDUMP_IMG_EXT}" | ||
| KDUMP_INITRD="${KDUMP_BOOTDIR}/initramfs-${kdump_kver}kdump.img" | ||
| } | ||
|
|
||
| install() { | ||
| prepare_kernel_initrd | ||
| if [ ! -f "$KDUMP_KERNEL" ]; then | ||
| derror "Could not find required kernel for earlykdump," \ | ||
| "earlykdump will not work!" | ||
| return 1 | ||
| fi | ||
| if [ ! -f "$KDUMP_INITRD" ]; then | ||
| derror "Could not find required kdump initramfs for earlykdump," \ | ||
| "please ensure kdump initramfs is generated first," \ | ||
| "earlykdump will not work!" | ||
| return 1 | ||
| fi | ||
|
|
||
| inst_multiple tail find cut dirname hexdump | ||
| inst_simple "/etc/sysconfig/kdump" | ||
| inst_binary "/usr/sbin/kexec" | ||
| inst_binary "/usr/bin/gawk" "/usr/bin/awk" | ||
| inst_script "/lib/kdump/kdump-lib.sh" "/lib/kdump-lib.sh" | ||
| inst_hook cmdline 00 "$moddir/early-kdump.sh" | ||
| inst_binary "$KDUMP_KERNEL" | ||
| inst_binary "$KDUMP_INITRD" | ||
|
|
||
| ln_r "$KDUMP_KERNEL" "${KDUMP_BOOTDIR}/${KDUMP_IMG}-earlykdump${KDUMP_IMG_EXT}" | ||
| ln_r "$KDUMP_INITRD" "${KDUMP_BOOTDIR}/initramfs-earlykdump.img" | ||
|
|
||
| chmod -x "${initdir}/$KDUMP_KERNEL" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| #! /bin/sh | ||
|
|
||
| KEXEC=/sbin/kexec | ||
| standard_kexec_args="-p" | ||
|
|
||
| EARLY_KDUMP_INITRD="" | ||
| EARLY_KDUMP_KERNEL="" | ||
| EARLY_KDUMP_CMDLINE="" | ||
| EARLY_KDUMP_KERNELVER="" | ||
| EARLY_KEXEC_ARGS="" | ||
|
|
||
| . /etc/sysconfig/kdump | ||
| . /lib/dracut-lib.sh | ||
| . /lib/kdump-lib.sh | ||
|
|
||
| prepare_parameters() | ||
| { | ||
| EARLY_KDUMP_CMDLINE=$(prepare_cmdline "${KDUMP_COMMANDLINE}" "${KDUMP_COMMANDLINE_REMOVE}" "${KDUMP_COMMANDLINE_APPEND}") | ||
| KDUMP_BOOTDIR=$(check_boot_dir "${KDUMP_BOOTDIR}") | ||
|
|
||
| EARLY_KDUMP_KERNEL="${KDUMP_BOOTDIR}/${KDUMP_IMG}-earlykdump${KDUMP_IMG_EXT}" | ||
| EARLY_KDUMP_INITRD="${KDUMP_BOOTDIR}/initramfs-earlykdump.img" | ||
| } | ||
|
|
||
| early_kdump_load() | ||
| { | ||
| check_kdump_feasibility | ||
| if [ $? -ne 0 ]; then | ||
| return 1 | ||
| fi | ||
|
|
||
| if is_fadump_capable; then | ||
| echo "WARNING: early kdump doesn't support fadump." | ||
| return 1 | ||
| fi | ||
|
|
||
| check_current_kdump_status | ||
| if [ $? == 0 ]; then | ||
| return 1 | ||
| fi | ||
|
|
||
| prepare_parameters | ||
|
|
||
| EARLY_KEXEC_ARGS=$(prepare_kexec_args "${KEXEC_ARGS}") | ||
|
|
||
| if is_secure_boot_enforced; then | ||
| echo "Secure Boot is enabled. Using kexec file based syscall." | ||
| EARLY_KEXEC_ARGS="$EARLY_KEXEC_ARGS -s" | ||
| fi | ||
|
|
||
| $KEXEC ${EARLY_KEXEC_ARGS} $standard_kexec_args \ | ||
| --command-line="$EARLY_KDUMP_CMDLINE" \ | ||
| --initrd=$EARLY_KDUMP_INITRD $EARLY_KDUMP_KERNEL | ||
| if [ $? == 0 ]; then | ||
| echo "kexec: loaded early-kdump kernel" | ||
| return 0 | ||
| else | ||
| echo "kexec: failed to load early-kdump kernel" | ||
| return 1 | ||
| fi | ||
| } | ||
|
|
||
| set_early_kdump() | ||
| { | ||
| if getargbool 0 rd.earlykdump; then | ||
| echo "early-kdump is enabled." | ||
| early_kdump_load | ||
| else | ||
| echo "early-kdump is disabled." | ||
| fi | ||
|
|
||
| return 0 | ||
| } | ||
|
|
||
| set_early_kdump |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # This file is part of systemd. | ||
| # | ||
| # systemd is free software; you can redistribute it and/or modify it | ||
| # under the terms of the GNU Lesser General Public License as published by | ||
| # the Free Software Foundation; either version 2.1 of the License, or | ||
| # (at your option) any later version. | ||
|
|
||
| [Unit] | ||
| Description=Kdump Vmcore Save Service | ||
| After=initrd.target initrd-parse-etc.service sysroot.mount | ||
| After=dracut-initqueue.service dracut-pre-mount.service dracut-mount.service dracut-pre-pivot.service | ||
| Before=initrd-cleanup.service | ||
| ConditionPathExists=/etc/initrd-release | ||
| OnFailure=emergency.target | ||
| OnFailureJobMode=isolate | ||
|
|
||
| [Service] | ||
| Environment=DRACUT_SYSTEMD=1 | ||
| Environment=NEWROOT=/sysroot | ||
| Type=oneshot | ||
| ExecStart=/bin/kdump.sh | ||
| StandardInput=null | ||
| StandardOutput=syslog | ||
| StandardError=syslog+console | ||
| KillMode=process | ||
| RemainAfterExit=yes | ||
|
|
||
| # Bash ignores SIGTERM, so we send SIGHUP instead, to ensure that bash | ||
| # terminates cleanly. | ||
| KillSignal=SIGHUP |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.