From 2f4b67cd1e034b4d1628859a7a0ef581173f32a0 Mon Sep 17 00:00:00 2001 From: Javier Martinez Canillas Date: Mon, 1 Oct 2018 17:51:30 +0200 Subject: [PATCH] Fix kernel-install scripts issues (#1634803) The 91-zipl.install kernel-install script attempts to execute zipl when a kernel is installed, but this will fail if there isn't a zipl confg file. Also, the kernel-install scripts are using ',' as the sed delimiter when updating the kernel command line options in the BLS fragment file. But it is valid to have that character in a cmdline so instead use '#' for that. Signed-off-by: Javier Martinez Canillas --- 20-zipl-kernel.install | 4 ++-- 52-zipl-rescue.install | 2 +- 91-zipl.install | 4 ++++ s390utils.spec | 5 ++++- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/20-zipl-kernel.install b/20-zipl-kernel.install index 9c87f41..ca582a4 100755 --- a/20-zipl-kernel.install +++ b/20-zipl-kernel.install @@ -98,7 +98,7 @@ case "$COMMAND" in cp -aT "${KERNEL_DIR}/bls.conf" "${BLS_TARGET}" || exit $? sed -i -e "s,^linux.*,linux /boot/vmlinuz-${KERNEL_VERSION},g" "${BLS_TARGET}" sed -i -e "s,^initrd.*,initrd /boot/initramfs-${KERNEL_VERSION}.img,g" "${BLS_TARGET}" - sed -i -e "s,^options.*,options ${BOOT_OPTIONS[*]},g" "${BLS_TARGET}" + sed -i -e "s#^options.*#options ${BOOT_OPTIONS[*]}#g" "${BLS_TARGET}" else mkbls "${KERNEL_VERSION}" \ "$(date -u +%Y%m%d%H%M%S -d "$(stat -c '%y' "${KERNEL_DIR}")")" \ @@ -115,7 +115,7 @@ case "$COMMAND" in sed -i -e "s/^title.*/title ${TITLE}${LINUX_DEBUG_TITLE_POSTFIX}/" "${BLS_DEBUG}" sed -i -e "s/^version.*/version ${VERSION}${LINUX_DEBUG_VERSION_POSTFIX}/" "${BLS_DEBUG}" sed -i -e "s/^id.*/${BLSID}/" "${BLS_DEBUG}" - sed -i -e "s,^options.*,options ${BOOT_OPTIONS[*]}${CMDLINE_LINUX_DEBUG}," "${BLS_DEBUG}" + sed -i -e "s#^options.*#options ${BOOT_OPTIONS[*]}${CMDLINE_LINUX_DEBUG}#" "${BLS_DEBUG}" fi exit 0 diff --git a/52-zipl-rescue.install b/52-zipl-rescue.install index 314b9ab..a2945f7 100755 --- a/52-zipl-rescue.install +++ b/52-zipl-rescue.install @@ -39,7 +39,7 @@ case "$COMMAND" in if [[ -f "${BLS_RESCUE}" ]] && grep -q '^options.*$kernelopts' "${BLS_RESCUE}"; then sed -i -e "s,^linux.*,linux /boot/vmlinuz-0-rescue-${MACHINE_ID},g" "${BLS_RESCUE}" sed -i -e "s,^initrd.*,initrd /boot/initramfs-0-rescue-${MACHINE_ID}.img,g" "${BLS_RESCUE}" - sed -i -e "s,^options.*,options ${BOOT_OPTIONS[*]},g" "${BLS_RESCUE}" + sed -i -e "s#^options.*#options ${BOOT_OPTIONS[*]}#g" "${BLS_RESCUE}" fi fi ;; diff --git a/91-zipl.install b/91-zipl.install index 6b46f82..6205638 100755 --- a/91-zipl.install +++ b/91-zipl.install @@ -1,5 +1,9 @@ #!/bin/bash +if [[ ! -f /etc/zipl.conf ]]; then + exit 0 +fi + COMMAND="$1" case "$COMMAND" in diff --git a/s390utils.spec b/s390utils.spec index 006ccef..eb248c3 100644 --- a/s390utils.spec +++ b/s390utils.spec @@ -5,7 +5,7 @@ Name: s390utils Summary: Utilities and daemons for IBM z Systems Group: System Environment/Base Version: 2.6.0 -Release: 5%{?dist} +Release: 6%{?dist} Epoch: 2 License: MIT ExclusiveArch: s390 s390x @@ -810,6 +810,9 @@ User-space development files for the s390/s390x architecture. %changelog +* Mon Oct 01 2018 Dan Horák - 2:2.6.0-6 +- Fix kernel-install scripts issues + * Fri Sep 21 2018 Dan Horák - 2:2.6.0-5 - Makefile cleanups