summaryrefslogtreecommitdiff
path: root/debian/kdump-tools.postinst
diff options
context:
space:
mode:
authorLouis Bouchard <louis.bouchard@ubuntu.com>2016-05-26 17:57:27 +0200
committerLouis Bouchard <louis.bouchard@ubuntu.com>2016-05-27 15:58:14 +0200
commit9f9ded098c39cfcf58d0ca2015c52727622a8309 (patch)
tree98789da99df9ef6a1be8bd1404927bc68670b404 /debian/kdump-tools.postinst
parent24acbef0a24e6e23c75981d47b869f9228066e1f (diff)
[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 <louis.bouchard@ubuntu.com>
Diffstat (limited to 'debian/kdump-tools.postinst')
-rwxr-xr-xdebian/kdump-tools.postinst8
1 files changed, 5 insertions, 3 deletions
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)