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 <javierm@redhat.com>
This commit is contained in:
Javier Martinez Canillas 2018-10-01 17:51:30 +02:00 committed by Dan Horák
parent a8d596d27b
commit 2f4b67cd1e
4 changed files with 11 additions and 4 deletions

View File

@ -98,7 +98,7 @@ case "$COMMAND" in
cp -aT "${KERNEL_DIR}/bls.conf" "${BLS_TARGET}" || exit $? 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,^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,^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 else
mkbls "${KERNEL_VERSION}" \ mkbls "${KERNEL_VERSION}" \
"$(date -u +%Y%m%d%H%M%S -d "$(stat -c '%y' "${KERNEL_DIR}")")" \ "$(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/^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/^version.*/version ${VERSION}${LINUX_DEBUG_VERSION_POSTFIX}/" "${BLS_DEBUG}"
sed -i -e "s/^id.*/${BLSID}/" "${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 fi
exit 0 exit 0

View File

@ -39,7 +39,7 @@ case "$COMMAND" in
if [[ -f "${BLS_RESCUE}" ]] && grep -q '^options.*$kernelopts' "${BLS_RESCUE}"; then 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,^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,^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
fi fi
;; ;;

View File

@ -1,5 +1,9 @@
#!/bin/bash #!/bin/bash
if [[ ! -f /etc/zipl.conf ]]; then
exit 0
fi
COMMAND="$1" COMMAND="$1"
case "$COMMAND" in case "$COMMAND" in

View File

@ -5,7 +5,7 @@ Name: s390utils
Summary: Utilities and daemons for IBM z Systems Summary: Utilities and daemons for IBM z Systems
Group: System Environment/Base Group: System Environment/Base
Version: 2.6.0 Version: 2.6.0
Release: 5%{?dist} Release: 6%{?dist}
Epoch: 2 Epoch: 2
License: MIT License: MIT
ExclusiveArch: s390 s390x ExclusiveArch: s390 s390x
@ -810,6 +810,9 @@ User-space development files for the s390/s390x architecture.
%changelog %changelog
* Mon Oct 01 2018 Dan Horák <dan[at]danny.cz> - 2:2.6.0-6
- Fix kernel-install scripts issues
* Fri Sep 21 2018 Dan Horák <dan[at]danny.cz> - 2:2.6.0-5 * Fri Sep 21 2018 Dan Horák <dan[at]danny.cz> - 2:2.6.0-5
- Makefile cleanups - Makefile cleanups