From 6493dc2601f19b5ee7101ef246b6dd1fb929d9fb Mon Sep 17 00:00:00 2001 From: jcapitao-rh Date: Tue, 28 Apr 2026 14:15:09 +0200 Subject: [PATCH] fix(postprocess): fix shell crash in bootloader preset logic The use of the `&&` operator combined with `set -e` caused the postprocess script to exit with code 1 when `$VERSION_ID` was less than 43. Fixes: https://gitlab.com/fedora/bootc/base-images/-/merge_requests/456 Closes: https://gitlab.com/fedora/bootc/base-images/-/work_items/79 --- minimal/systemd-presets.yaml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/minimal/systemd-presets.yaml b/minimal/systemd-presets.yaml index 4f0d3a4..6bedd4f 100644 --- a/minimal/systemd-presets.yaml +++ b/minimal/systemd-presets.yaml @@ -21,13 +21,15 @@ postprocess: case "$ID" in fedora) - [ "$VERSION_ID" -ge 43 ] && echo "enable bootloader-update.service" >> "$preset_file_name" + if [ "$VERSION_ID" -ge 43 ]; then + echo "enable bootloader-update.service" >> "$preset_file_name" + fi ;; - centos) - [ "$VERSION_ID" -ge 9 ] && echo "enable bootloader-update.service" >> "$preset_file_name" + if [ "$VERSION_ID" -ge 9 ]; then + echo "enable bootloader-update.service" >> "$preset_file_name" + fi ;; - *) ;; esac # Undo RPM scripts enabling units; we want the presets to be canonical