diff options
Diffstat (limited to 'SOURCES/generate_crashkernel_default.sh')
-rwxr-xr-x | SOURCES/generate_crashkernel_default.sh | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/SOURCES/generate_crashkernel_default.sh b/SOURCES/generate_crashkernel_default.sh new file mode 100755 index 0000000..46d4546 --- /dev/null +++ b/SOURCES/generate_crashkernel_default.sh @@ -0,0 +1,25 @@ +#!/bin/bash +kernelver=$1 && shift +arch=$1 && shift +rootfs=$1 && shift + +output="${rootfs}/lib/modules/${kernelver}/crashkernel.default" + +case $arch in +x86_64|s390*) + ck_cmdline="crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M" + ;; +arm64|aarch64) + ck_cmdline="crashkernel=2G-:448M" + ;; +powerpc|ppc64*) + ck_cmdline="crashkernel=2G-4G:384M,4G-16G:512M,16G-64G:1G,64G-128G:2G,128G-:4G" + ;; +*) + ck_cmdline="" + ;; +esac + +cat > "$output" <<EOF +$ck_cmdline +EOF |