mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-29 18:19:02 +00:00
ec5e8461c1
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>
24 lines
475 B
Bash
24 lines
475 B
Bash
#!/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=${KZ}M/" /boot/grub/grub.cfg
|
|
mount /boot -o remount,ro
|
|
fi
|
|
;;
|
|
esac
|