mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
scripts: aarch64: replace guestmount for image modification
Replace the use of `guestmount and `guestunmount` with standard tools (losetup, mount) to modify cloud disk image. This eliminates dependency on guestmount which requires /dev/kvm and is not available in MSHV root partition. Signed-off-by: Aastha Rawat <aastharawat@microsoft.com>
This commit is contained in:
@@ -74,10 +74,16 @@ if [ "${TEST_ARCH}" == "aarch64" ]; then
|
||||
if [ ! -d "$FOCAL_OS_RAW_IMAGE_UPDATE_TOOL_ROOT_DIR" ]; then
|
||||
mkdir -p "$FOCAL_OS_RAW_IMAGE_UPDATE_TOOL_ROOT_DIR"
|
||||
fi
|
||||
# Mount the 'raw' image, replace the fio and umount the working folder
|
||||
guestmount -a "$WORKLOADS_DIR/$FOCAL_OS_RAW_IMAGE_UPDATE_TOOL_NAME" -m /dev/sda1 "$FOCAL_OS_RAW_IMAGE_UPDATE_TOOL_ROOT_DIR" || exit 1
|
||||
cp "$WORKLOADS_DIR"/fio "$FOCAL_OS_RAW_IMAGE_UPDATE_TOOL_ROOT_DIR"/usr/bin/fio
|
||||
guestunmount "$FOCAL_OS_RAW_IMAGE_UPDATE_TOOL_ROOT_DIR"
|
||||
# Mount image partition
|
||||
IMG="$WORKLOADS_DIR/$FOCAL_OS_RAW_IMAGE_UPDATE_TOOL_NAME"
|
||||
|
||||
# Update fio binary in the image
|
||||
SRC_FIO_PATH="$WORKLOADS_DIR/fio"
|
||||
DST_FIO_PATH="usr/bin/fio"
|
||||
|
||||
# Mount image partition, copy fio, and unmount
|
||||
chmod +x "$SRC_FIO_PATH"
|
||||
copy_to_image "$IMG" "$FOCAL_OS_RAW_IMAGE_UPDATE_TOOL_ROOT_DIR" "$SRC_FIO_PATH" "$DST_FIO_PATH" || exit
|
||||
fi
|
||||
|
||||
# Prepare linux image (build from source or download pre-built)
|
||||
|
||||
Reference in New Issue
Block a user