From 6145d0cd281b95f88a1582d01ce793fe4954de35 Mon Sep 17 00:00:00 2001 From: DK Date: Wed, 30 Jul 2025 20:54:08 +0000 Subject: [PATCH] Fix ISO_LABEL handling and symlink resolution in ISO detection - Declaring 'local ISO_LABEL' inside a function was shadowing the global environment variable defined in env.properties. This caused unexpected behavior during ISO processing. - When ISO_URL is set to a 'file://' path, a symlink is created in '.cache'. The 'file "${ISO_PATH}"' command was resolving the symlink itself, which interfered with sed processing. - Replaced 'file "${ISO_PATH}"' with 'file -L "${ISO_PATH}"' to follow symlinks and ensure consistent behavior. Signed-off-by: DK --- oracle-linux-image-tools/bin/build-image.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/oracle-linux-image-tools/bin/build-image.sh b/oracle-linux-image-tools/bin/build-image.sh index 7a32aee..a0fb431 100755 --- a/oracle-linux-image-tools/bin/build-image.sh +++ b/oracle-linux-image-tools/bin/build-image.sh @@ -367,10 +367,9 @@ stage_kickstart() { image_create() { common::echo_header "Install Oracle Linux" - # retrieve disk label -- alternatively: isoinfo -d -i - local ISO_LABEL - # shellcheck disable=SC2034,SC2153 - ISO_LABEL=$(file "${ISO_PATH}" | sed -e "s/.* '\(.*\)' .*/\1/" -e 's/ /\\x20/g') + # retrieve disk label + # shellcheck disable=SC2034 + ISO_LABEL="${ISO_LABEL:-$(file -L "${ISO_PATH}" | sed -e "s/.* '\(.*\)' .*/\1/" -e 's/ /\\x20/g')}" declare -ga virt_install_args # Set Serial console