aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorXenia Ragiadakou2022-06-26 21:45:35 +0300
committerStefano Stabellini2022-06-28 17:28:54 -0700
commit8080718b8a8c94841155ead67bfb22cbd8e4840f (patch)
tree28b65247b836590ded9a68e4d7bead651d3ac347 /scripts
parentd7ed86141dfed993c15bc0d81dce0426169a176f (diff)
uboot-script-gen: prevent user mistakes due to DOM0_KERNEL becoming optional
Before enabling true dom0less configuration, the script was failing instantly if DOM0_KERNEL parameter was not specified. This behaviour has changed and this needs to be communicated to the user. Mention in README.md that for dom0less configurations, the parameter DOM0_KERNEL is optional. If DOM0_KERNEL is not set, check that no other dom0 specific parameters are specified by the user. Fail the script early with an appropriate error message, if it was invoked with erroneous configuration settings. Change message "Dom0 kernel is not specified, continue with dom0less setup." to "Dom0 kernel is not specified, continue with true dom0less setup." to refer more accurately to a dom0less setup without dom0. Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/uboot-script-gen21
1 files changed, 14 insertions, 7 deletions
diff --git a/scripts/uboot-script-gen b/scripts/uboot-script-gen
index e85c6ec..085e29f 100755
--- a/scripts/uboot-script-gen
+++ b/scripts/uboot-script-gen
@@ -410,6 +410,20 @@ function find_root_dev()
function xen_config()
{
+ if test -z "$DOM0_KERNEL"
+ then
+ if test "$NUM_DOMUS" -eq "0"
+ then
+ echo "Neither dom0 or domUs are specified, exiting."
+ exit 1
+ elif test "$DOM0_MEM" || test "$DOM0_VCPUS" || test "$DOM0_COLORS" || test "$DOM0_CMD" || test "$DOM0_RAMDISK" || test "$DOM0_ROOTFS"
+ then
+ echo "For dom0less configuration without dom0, no dom0 specific parameters should be specified, exiting."
+ exit 1
+ fi
+ echo "Dom0 kernel is not specified, continue with true dom0less setup."
+ fi
+
if [ -z "$XEN_CMD" ]
then
if [ -z "$DOM0_MEM" ]
@@ -457,13 +471,6 @@ function xen_config()
fi
if test -z "$DOM0_KERNEL"
then
- if test "$NUM_DOMUS" -eq "0"
- then
- echo "Neither dom0 or domUs are specified, exiting."
- exit 1
- fi
- echo "Dom0 kernel is not specified, continue with dom0less setup."
- unset DOM0_RAMDISK
# Remove dom0 specific parameters from the XEN command line.
local params=($XEN_CMD)
XEN_CMD="${params[@]/dom0*/}"