From 607a6825f4526de310cc84c9b77f0cb10122ffef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Hor=C3=A1k?= Date: Mon, 23 Jan 2023 12:16:40 +0000 Subject: [PATCH] Revert "Generate /etc/kernel/cmdline if it does not exist" This reverts commit 77693cd7eb3309e9ab592f886b7bafdaa0622664. Although it fixes the situation when a new kernel is being installed in a %post script, it breaks the initial kernel installation, because the BLS snippet doesn't exists yet. --- 20-zipl-kernel.install | 18 +++++------------- s390utils.spec | 5 ++++- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/20-zipl-kernel.install b/20-zipl-kernel.install index a592380..4fadd1d 100755 --- a/20-zipl-kernel.install +++ b/20-zipl-kernel.install @@ -76,24 +76,16 @@ case "$COMMAND" in if [[ ! -f /sbin/new-kernel-pkg || -d "${BLS_DIR}" ]]; then declare -a BOOT_OPTIONS - if [[ ! -f /etc/kernel/cmdline ]]; then - last='' - for entry in "${BLS_DIR}"/*.conf; do - last="$entry" - done - if [[ ! -z "$last" ]]; then - args="$(awk '/options/{$1="";$0=$0;$1=$1;print}' $last)" - echo "$args" > /etc/kernel/cmdline - fi - fi if [[ -f /etc/kernel/cmdline ]]; then read -r -d '' -a BOOT_OPTIONS < /etc/kernel/cmdline fi if ! [[ ${BOOT_OPTIONS[*]} ]]; then - echo "Could not determine the kernel command line parameters." >&2 - echo "Please specify the kernel command line in /etc/kernel/cmdline!" >&2 - exit 1 + read -r -d '' -a line < /proc/cmdline + for i in "${line[@]}"; do + [[ "${i#initrd=*}" != "$i" || "${i#BOOT_IMAGE=*}" != "$i" ]] && continue + BOOT_OPTIONS+=("$i") + done fi [[ -d "$BLS_DIR" ]] || mkdir -m 0700 -p "$BLS_DIR" diff --git a/s390utils.spec b/s390utils.spec index 2d3296a..0523b15 100644 --- a/s390utils.spec +++ b/s390utils.spec @@ -10,7 +10,7 @@ Name: s390utils Summary: Utilities and daemons for IBM z Systems Version: 2.25.0 -Release: 2%{?dist} +Release: 3%{?dist} Epoch: 2 License: MIT ExclusiveArch: s390 s390x @@ -907,6 +907,9 @@ User-space development files for the s390/s390x architecture. %changelog +* Mon Jan 23 2023 Dan Horák - 2:2.25.0-3 +- revert the kernel install script change + * Thu Jan 19 2023 Dan Horák - 2:2.25.0-2 - update kernel install script to write /etc/kernel/cmdline