aboutsummaryrefslogtreecommitdiff
path: root/scripts/uboot-script-gen
diff options
context:
space:
mode:
authorStefano Stabellini2021-04-08 17:23:15 -0700
committerStefano Stabellini2021-05-17 14:49:53 -0700
commit5629a7a4a027bc78a5426bedefb3f9e803b49004 (patch)
treef4a955409903c55ed1479708a3cb6073a82d74d7 /scripts/uboot-script-gen
parent6f1950c30cfec0fee35a6c977166148274f037dd (diff)
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 <stefano.stabellini@xilinx.com> Signed-off-by: Brian Woods <brian.woods@xilinx.com> Reviewed-by: Brian Woods <brian.woods@xilinx.com>
Diffstat (limited to 'scripts/uboot-script-gen')
-rwxr-xr-xscripts/uboot-script-gen12
1 files changed, 9 insertions, 3 deletions
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