From 95ba62e9aeff32a7e00a4e7888b88ffa71fdd9d3 Mon Sep 17 00:00:00 2001 From: Stefano Stabellini Date: Fri, 16 Apr 2021 11:49:44 -0700 Subject: uboot-script-gen: skip DomUs with rootfs instead of exiting Also introduce a new DOMU_NOBOOT option to force a domU not to be started automatically at boot as dom0less guest. Signed-off-by: Stefano Stabellini Reviewed-by: Brian Woods --- README.md | 4 ++++ scripts/uboot-script-gen | 20 ++++++++++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 14cfc8e..0dade3c 100644 --- a/README.md +++ b/README.md @@ -86,6 +86,10 @@ Where: - DOMU_VCPUS[number] is the number of vcpus for the VM, default 1 +- DOMU_NOBOOT[number]: if specified, the DomU is not started + automatically at boot as dom0-less guest. It can still be created + later from Dom0. + - UBOOT_SOURCE and UBOOT_SCRIPT specify the output. They are optional as you can pass -o FILENAME to uboot-script-gen as a command line parameter diff --git a/scripts/uboot-script-gen b/scripts/uboot-script-gen index d878bf6..57cce22 100755 --- a/scripts/uboot-script-gen +++ b/scripts/uboot-script-gen @@ -82,6 +82,11 @@ function device_tree_editing() i=0 while test $i -lt $NUM_DOMUS do + if test "${DOMU_ROOTFS[$i]}" || test "${DOMU_NOBOOT[$i]}" + then + i=$(( $i + 1 )) + continue + fi echo "fdt mknod /chosen domU$i" >> $UBOOT_SOURCE echo "fdt set /chosen/domU$i compatible \"xen,domain\"" >> $UBOOT_SOURCE echo "fdt set /chosen/domU$i \#address-cells <0x2>" >> $UBOOT_SOURCE @@ -323,12 +328,6 @@ do then DOMU_VCPUS[$i]=1 fi - if test "${DOMU_ROOTFS[$i]}" - then - echo "Cannot handle non-ramdisk rootfses for dom0less VMs." - echo "DomUs with rootfses on disk need to be created from dom0 using xl." - exit 1 - fi i=$(( $i + 1 )) done @@ -371,6 +370,15 @@ fi i=0 while test $i -lt $NUM_DOMUS do + if test "${DOMU_ROOTFS[$i]}" || test "${DOMU_NOBOOT[$i]}" + then + if test -z "${DOMU_NOBOOT[$i]}" + then + echo "Skipping DomU[$i]: cannot handle non-ramdisk rootfs for dom0less VMs." + fi + i=$(( $i + 1 )) + continue + fi check_compressed_file_type ${DOMU_KERNEL[$i]} "executable" domU_kernel_addr[$i]=$memaddr load_file ${DOMU_KERNEL[$i]} -- cgit v1.2.3