From 9f9ded098c39cfcf58d0ca2015c52727622a8309 Mon Sep 17 00:00:00 2001 From: Louis Bouchard Date: Thu, 26 May 2016 17:57:27 +0200 Subject: [kdump-tools] Implement architecture specific config symlinks Use a symlink called /etc/default/grub.d/kdump-tools.cfg which points to the architecture specific file containing the default. This way, the conffile is only modified if the user decides it and not by our postinst script through the use of sed. Signed-off-by: Louis Bouchard --- debian/kdump-tools.postinst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'debian') diff --git a/debian/kdump-tools.postinst b/debian/kdump-tools.postinst index c8df159..93cda67 100755 --- a/debian/kdump-tools.postinst +++ b/debian/kdump-tools.postinst @@ -38,7 +38,6 @@ case "$1" in # Customize crashkernel= value according to architecture ARCH="$(arch)" DEF_PRESET="384M-:128M" - PPC_PRESET="2G-4G:320M,4G-32G:512M,32G-64G:1024M,64G-128G:2048M,128G-:4096M@32M" case "$ARCH" in s390x) HAS_CRASHKERNEL="$(grep crashkernel /etc/zipl.conf)" || true @@ -54,12 +53,15 @@ case "$1" in fi ;; ppc64el) - sed -i "s/UNCONFIGURED/$PPC_PRESET/" /etc/default/grub.d/kdump-tools.cfg + SUFFIX="$ARCH" ;; *) - sed -i "s/UNCONFIGURED/$DEF_PRESET/" /etc/default/grub.d/kdump-tools.cfg + SUFFIX="default" ;; esac + if ! test -L /etc/default/grub.d/kdump-tools.cfg; then + ln -s /etc/default/grub.d/kdump-tools.$SUFFIX /etc/default/grub.d/kdump-tools.cfg + fi ;; abort-upgrade|abort-remove|abort-deconfigure) -- cgit v1.2.3