Skip to content

Commit d252400

Browse files
committed
bringup_guestfs: fix CUSTOM_INDEX realpath
Ensure $CUSTOM_IMAGE_DIR directory exists before running realpath. Otherwise, realpath returns with an error when used on a file located in a non-existent directory. Example: realpath /tmp/testing /tmp/testing realpath /tmp/testing/file realpath: /tmp/testing/file: No such file or directory mkdir -p /tmp/testing realpath /tmp/testing/file /tmp/testing/file Fixes 5649a0d ("bringup: Use full path when creating custom_source file") Signed-off-by: Daniel Gomez <[email protected]>
1 parent c2797d5 commit d252400

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

scripts/bringup_guestfs.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,8 @@ build_custom_image()
111111
CUSTOM_IMAGE="${CUSTOM_IMAGE_DIR}/${OS_VERSION}.raw"
112112
CUSTOM_IMAGE_OK="${CUSTOM_IMAGE_DIR}.ok"
113113
CUSTOM_SOURCE="/etc/virt-builder/repos.d/kdevops-custom-images-${OS_VERSION}.conf"
114-
CUSTOM_INDEX="$(realpath ${CUSTOM_IMAGE_DIR}/index)"
115-
116114
mkdir -p ${CUSTOM_IMAGE_DIR}
115+
CUSTOM_INDEX="$(realpath ${CUSTOM_IMAGE_DIR}/index)"
117116

118117
if [[ ! -f $CUSTOM_IMAGE && "$CONFIG_GUESTFS_HAS_CUSTOM_RAW_IMAGE_URL" == "y" ]]; then
119118
fetch_custom_image

0 commit comments

Comments
 (0)