diff options
author | Chen Minqiang <ptpt52@gmail.com> | 2019-07-11 22:34:03 +0800 |
---|---|---|
committer | Daniel Golle <daniel@makrotopia.org> | 2020-03-20 21:45:06 +0000 |
commit | ec5e8461c194346c4341e3e8bb35bc06ad707d47 (patch) | |
tree | 184c2e8ea322728ec0ee126dd4a06336dfaf66cd /package/boot/kexec-tools/files | |
parent | ecef29b29463e7549779e90739e61f8729ccaf09 (diff) | |
download | upstream-ec5e8461c194346c4341e3e8bb35bc06ad707d47.tar.gz upstream-ec5e8461c194346c4341e3e8bb35bc06ad707d47.tar.bz2 upstream-ec5e8461c194346c4341e3e8bb35bc06ad707d47.zip |
x86: make crashdump works
1. KERNEL_CRASH_DUMP should depends on KERNEL_PROC_KCORE (kexec use it)
2. select crashkernel mem size by totalmem
mem <= 256M disable crashkernel by default
mem >= 4G use 256M for crashkernel
mem >= 8G use 512M for crashkernel
default use 128M
3. set BOOT_IMAGE in kdump.init
4. resolve a "Unhandled rela relocation: R_X86_64_PLT32" error
Tested on x86_64
Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
Diffstat (limited to 'package/boot/kexec-tools/files')
-rw-r--r-- | package/boot/kexec-tools/files/kdump.defaults | 14 | ||||
-rwxr-xr-x | package/boot/kexec-tools/files/kdump.init | 2 |
2 files changed, 15 insertions, 1 deletions
diff --git a/package/boot/kexec-tools/files/kdump.defaults b/package/boot/kexec-tools/files/kdump.defaults index 2f15e757bf..62366a2950 100644 --- a/package/boot/kexec-tools/files/kdump.defaults +++ b/package/boot/kexec-tools/files/kdump.defaults @@ -1,10 +1,22 @@ #!/bin/sh +# kB disable if mem low than 256MB +memtotal=`grep MemTotal /proc/meminfo | awk '{print $2}'` +if test $memtotal -le 262144; then + exit 0 +fi +KZ=128 +if test $memtotal -ge 8388608; then + KZ=512 +elif test $memtotal -ge 4194304; then + KZ=256 +fi + case $(uname -m) in i?86|x86_64) if ! grep -q crashkernel /boot/grub/grub.cfg; then mount /boot -o remount,rw - sed -i 's/linux.*/& crashkernel=32M@32M/' /boot/grub/grub.cfg + sed -i "s/linux.*/& crashkernel=${KZ}M/" /boot/grub/grub.cfg mount /boot -o remount,ro fi ;; diff --git a/package/boot/kexec-tools/files/kdump.init b/package/boot/kexec-tools/files/kdump.init index 0955047156..9d0d2fc2fb 100755 --- a/package/boot/kexec-tools/files/kdump.init +++ b/package/boot/kexec-tools/files/kdump.init @@ -3,6 +3,8 @@ START=41 STOP=90 +BOOT_IMAGE=/boot/vmlinuz + EXTRA_COMMANDS="status" EXTRA_HELP=" status Print crashkernel status" |