diff -Nru makedumpfile-1.6.8/debian/changelog makedumpfile-1.6.8/debian/changelog --- makedumpfile-1.6.8/debian/changelog 2020-12-28 13:42:26.000000000 -0300 +++ makedumpfile-1.6.8/debian/changelog 2021-01-28 18:06:29.000000000 -0300 @@ -1,3 +1,9 @@ +makedumpfile (1:1.6.8-2ubuntu2) hirsute; urgency=low + + * Bump crashkernel size for s390x. (LP: #1877533) + + -- Thadeu Lima de Souza Cascardo Thu, 28 Jan 2021 18:06:29 -0300 + makedumpfile (1:1.6.8-2ubuntu1) hirsute; urgency=low * Merge from Debian unstable. Remaining changes: diff -Nru makedumpfile-1.6.8/debian/kdump-tools.postinst makedumpfile-1.6.8/debian/kdump-tools.postinst --- makedumpfile-1.6.8/debian/kdump-tools.postinst 2020-12-27 12:44:02.000000000 -0300 +++ makedumpfile-1.6.8/debian/kdump-tools.postinst 2021-01-28 18:01:59.000000000 -0300 @@ -22,6 +22,41 @@ mv -f "$INITCONFFILE.$$" "$INITCONFFILE" } +update_zipl() { + + if [ ! -f /etc/zipl.conf ]; then + return; + fi + + DI_PRESET="196M" + OLD_PRESET="384M-:128M" + DEF_PRESET="2G-4G:320M,4G-32G:512M,32G-64G:1024M,64G-128G:2048M,128G-:4096M" + HAS_CRASHKERNEL="$(grep crashkernel /etc/zipl.conf)" || true + + if test -z "$HAS_CRASHKERNEL"; then + sed -i "s|^\s*parameters\s*=\s*\"\?|&crashkernel=${DEF_PRESET} |" /etc/zipl.conf + elif dpkg --compare-versions "$1" lt 1:1.6.7-4ubuntu2; then + + # zipl-installer and some old upgrade paths for s390-tools will add crashkernel=196M. + # Overriding such a default value is preferrable than leaving the system unable to dump + # on default configurations. + # We should do that in both cases of a new install and an upgrade from an earlier version. + sed -i "s/crashkernel=${DI_PRESET}/crashkernel=${DEF_PRESET}/" /etc/zipl.conf + + # If the user has set crashkernel before installing kdump-tools, we should + # keep the users' value. Otherwise, if this is an upgrade from an older version, + # update the crashkernel default value. + if [ -n "$1" ]; then + sed -i "s/crashkernel=${OLD_PRESET}/crashkernel=${DEF_PRESET}/" /etc/zipl.conf + fi + + fi + + if [ -e /usr/sbin/zipl ]; then + /usr/sbin/zipl + fi +} + # summary of how this script can be called: # * `configure' # * `abort-upgrade' @@ -55,14 +90,9 @@ # Customize crashkernel= value according to architecture ARCH="$(arch)" - DEF_PRESET="384M-:128M" case "$ARCH" in s390x) - HAS_CRASHKERNEL="$(grep crashkernel /etc/zipl.conf)" || true - if test -z "$HAS_CRASHKERNEL"; then - sed -i "s|^\s*parameters\s*=\s*\"\?|&crashkernel=${DEF_PRESET} |" /etc/zipl.conf - zipl - fi + update_zipl "$2" CIO_IGNORE="$(cio_ignore -u -k)" sed -i "s/\#KDUMP_CMDLINE_APPEND/KDUMP_CMDLINE_APPEND/" "$INITCONFFILE" sed -i "/KDUMP_CMDLINE_APPEND/{s|\"$| ${CIO_IGNORE}\"|}" "$INITCONFFILE"