mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-10-05 21:15:45 +00:00
scripts: Check if windows image is in the host
Currently script does not exit early if the image/firmware not present in the host. We should not progress further if the images are not pre downloaded. Signed-off-by: Muminul Islam <muislam@microsoft.com>
This commit is contained in:
parent
282134a490
commit
29f924405a
@ -10,6 +10,7 @@ features_build=""
|
|||||||
features_test="--features integration_tests"
|
features_test="--features integration_tests"
|
||||||
|
|
||||||
WIN_IMAGE_FILE="/root/workloads/windows-server-2019.raw"
|
WIN_IMAGE_FILE="/root/workloads/windows-server-2019.raw"
|
||||||
|
OVMF_FW_FILE="/root/workloads/OVMF.fd"
|
||||||
BUILD_TARGET="$(uname -m)-unknown-linux-${CH_LIBC}"
|
BUILD_TARGET="$(uname -m)-unknown-linux-${CH_LIBC}"
|
||||||
CFLAGS=""
|
CFLAGS=""
|
||||||
TARGET_CC=""
|
TARGET_CC=""
|
||||||
@ -18,6 +19,12 @@ TARGET_CC="musl-gcc"
|
|||||||
CFLAGS="-I /usr/include/x86_64-linux-musl/ -idirafter /usr/include/"
|
CFLAGS="-I /usr/include/x86_64-linux-musl/ -idirafter /usr/include/"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Check if the images are present
|
||||||
|
if [[ ! -f ${WIN_IMAGE_FILE} || ! -f ${OVMF_FW_FILE} ]]; then
|
||||||
|
echo "Windows image/firmware not present in the host"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# Use device mapper to create a snapshot of the Windows image
|
# Use device mapper to create a snapshot of the Windows image
|
||||||
img_blk_size=$(du -b -B 512 ${WIN_IMAGE_FILE} | awk '{print $1;}')
|
img_blk_size=$(du -b -B 512 ${WIN_IMAGE_FILE} | awk '{print $1;}')
|
||||||
loop_device=$(losetup --find --show --read-only ${WIN_IMAGE_FILE})
|
loop_device=$(losetup --find --show --read-only ${WIN_IMAGE_FILE})
|
||||||
|
Loading…
Reference in New Issue
Block a user