diff --git a/20-zipl-kernel.install b/20-zipl-kernel.install index 99bfcb9..3487aa2 100755 --- a/20-zipl-kernel.install +++ b/20-zipl-kernel.install @@ -132,8 +132,12 @@ case "$COMMAND" in fi fi - if [ -n "$NEWDEFAULT" ]; then - sed -i -e "s,^default=.*,default=${NEWDEFAULT}," "${ZIPLCFG}" + if [ -n "$NEWDEFAULT" ] && [ -f "${ZIPLCFG}" ]; then + if grep -q "^default=" "${ZIPLCFG}"; then + sed -i -e "s,^default=.*,default=${NEWDEFAULT}," "${ZIPLCFG}" + else + echo "default=${NEWDEFAULT}" >> "${ZIPLCFG}" + fi fi exit 0 @@ -151,8 +155,10 @@ case "$COMMAND" in BLS_TARGET="${BLS_DIR}/${MACHINE_ID}-${KERNEL_VERSION}.conf" BLS_DEBUG="$(echo ${BLS_TARGET} | sed -e "s/${KERNEL_VERSION}/${KERNEL_VERSION}~debug/")" - TITLE="$(grep '^title[ \t]' "${BLS_TARGET}" | sed -e 's/^title[ \t]*//')" - sed -i -e "/^default=${TITLE}/d" "${ZIPLCFG}" + if [ -f "${BLS_TARGET}" ] && [ -f "${ZIPLCFG}" ]; then + TITLE="$(grep '^title[ \t]' "${BLS_TARGET}" | sed -e 's/^title[ \t]*//')" + sed -i -e "/^default=${TITLE}/d" "${ZIPLCFG}" + fi if [[ -f "${BLS_DEBUG}" ]]; then TITLE="$(grep '^title[ \t]' "${BLS_DEBUG}" | sed -e 's/^title[ \t]*//')" diff --git a/s390utils.spec b/s390utils.spec index d231473..95e0777 100644 --- a/s390utils.spec +++ b/s390utils.spec @@ -6,7 +6,7 @@ Name: s390utils Summary: Utilities and daemons for IBM z Systems Version: 2.13.0 -Release: 3%{?dist} +Release: 4%{?dist} Epoch: 2 License: MIT ExclusiveArch: s390 s390x @@ -794,6 +794,9 @@ User-space development files for the s390/s390x architecture. %changelog +* Fri Jul 03 2020 Javier Martinez Canillas - 2:2.13.0-4 +- add a default entry in zipl.conf if there isn't one present (#1698363) + * Tue Jun 09 2020 Jakub Čajka - 2:2.13.0-3 - split off core package with basic functionalities and reduced deps from base sub-package