Skip to content

Commit 9f6de59

Browse files
committed
feat(ci): Conditionally update kernel path based on storage mode
1 parent fdbd03b commit 9f6de59

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

.github/workflows/test-qemu.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,21 @@ jobs:
4444
config=$(echo "$config" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
4545
cargo xtask image download $img
4646
img_name="qemu-${{ matrix.arch }}"
47-
sed -i 's|^kernel_path[[:space:]]*=.*|kernel_path = "/tmp/axvisor/'"$img"'/'"$img_name"'"|' "$config"
48-
echo "Updated kernel_path in $config"
47+
image_location=$(sed -n 's/^image_location[[:space:]]*=[[:space:]]*"\([^"]*\)".*/\1/p' "$config")
48+
49+
case "$image_location" in
50+
"fs")
51+
echo "Filesystem storage mode - no config update needed"
52+
;;
53+
"memory")
54+
sed -i 's|^kernel_path[[:space:]]*=.*|kernel_path = "/tmp/axvisor/'"$img"'/'"$img_name"'"|' "$config"
55+
echo "Memory storage mode - updating kernel_path"
56+
;;
57+
*)
58+
echo "Unknown image_location: $image_location"
59+
exit 1
60+
;;
61+
esac
4962
5063
ROOTFS_IMG_PATH="/tmp/axvisor/$img/rootfs.img"
5164

0 commit comments

Comments
 (0)