Skip to content

Commit 6145d0c

Browse files
committed
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 <d.koch@accenture.com>
1 parent de7d51a commit 6145d0c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

oracle-linux-image-tools/bin/build-image.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -367,10 +367,9 @@ stage_kickstart() {
367367
image_create() {
368368
common::echo_header "Install Oracle Linux"
369369

370-
# retrieve disk label -- alternatively: isoinfo -d -i
371-
local ISO_LABEL
372-
# shellcheck disable=SC2034,SC2153
373-
ISO_LABEL=$(file "${ISO_PATH}" | sed -e "s/.* '\(.*\)' .*/\1/" -e 's/ /\\x20/g')
370+
# retrieve disk label
371+
# shellcheck disable=SC2034
372+
ISO_LABEL="${ISO_LABEL:-$(file -L "${ISO_PATH}" | sed -e "s/.* '\(.*\)' .*/\1/" -e 's/ /\\x20/g')}"
374373

375374
declare -ga virt_install_args
376375
# Set Serial console

0 commit comments

Comments
 (0)