From 5629a7a4a027bc78a5426bedefb3f9e803b49004 Mon Sep 17 00:00:00 2001 From: Stefano Stabellini Date: Thu, 8 Apr 2021 17:23:15 -0700 Subject: Introduce multiple partitions support to disk_image Rootfses that should be written to disk as their own partition are called *_ROOTFS instead of *_RAMDISK. This change makes the config file clearer and more consistent. However it changes the current behavior as the Dom0 RAMDISK (not ROOTFS) was written to disk as its own partition before, and now it is not. In the case of uboot-script-gen, dom0less guests cannot access disk partitions yet (missing PV drivers support). Hence, if one or more domU ROOTFSes are specified, print an error and exit. For dom0, base the root= parameter generation on the presence of DOM0_ROOTFS. Signed-off-by: Stefano Stabellini Signed-off-by: Brian Woods Reviewed-by: Brian Woods --- scripts/uboot-script-gen | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'scripts/uboot-script-gen') diff --git a/scripts/uboot-script-gen b/scripts/uboot-script-gen index bc41d1f..d878bf6 100755 --- a/scripts/uboot-script-gen +++ b/scripts/uboot-script-gen @@ -66,7 +66,7 @@ function device_tree_editing() echo "fdt mknod /chosen dom0" >> $UBOOT_SOURCE echo "fdt set /chosen/dom0 compatible \"xen,linux-zimage\" \"xen,multiboot-module\"" >> $UBOOT_SOURCE echo "fdt set /chosen/dom0 reg <0x0 "$dom0_kernel_addr" 0x0 "$dom0_kernel_size">" >> $UBOOT_SOURCE - if test "$LOAD_CMD" = "tftpb" + if test "$DOM0_RAMDISK" then echo "fdt set /chosen xen,dom0-bootargs \"$DOM0_CMD\"" >> $UBOOT_SOURCE if test $dom0_ramdisk_addr != "-" @@ -276,7 +276,7 @@ then fi if [[ ! $DOM0_CMD =~ root= ]] then - if test "$LOAD_CMD" = "tftpb" + if test -z "$DOM0_ROOTFS" then DOM0_CMD="$DOM0_CMD root=/dev/ram0" else @@ -323,6 +323,12 @@ 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 @@ -352,7 +358,7 @@ dom0_kernel_addr=$memaddr load_file $DOM0_KERNEL dom0_kernel_size=$filesize -if test "$DOM0_RAMDISK" && [[ $LOAD_CMD = "tftpb" ]] +if test "$DOM0_RAMDISK" then check_compressed_file_type $DOM0_RAMDISK "cpio archive" dom0_ramdisk_addr=$memaddr -- cgit v1.2.3