[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ImageBuilder] UBOOT_SOURCE/SCRIPTS variables must always be set


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Luca Miccio <luca.miccio@xxxxxxx>
  • Date: Mon, 18 Nov 2024 06:12:05 -0800
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=softfail (sender ip is 165.204.84.12) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=fail (p=quarantine sp=quarantine pct=100) action=quarantine header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=KIPcYoi1Fs7A/Wu4MhK50YfnJFxQpucwP7BSJ4pohbc=; b=rJKdBeliq+A85VdvxsJJLVyh56ZUHrGD0zPPh/RUSGj0fFmL/nAdC2n6lTgUTqupf6SnBaA+sGBpFdUws4+oibw4JCEuYpaTZtTx17uMG863m0Bn2NOERhRJCWBFoduhd6NVBJSA8AcCYmXRj/Py3p1S0J5MbKG+mxYgLBOpbzEa9Y07/X3PXnzdU3Uti05OpIpXHemtZJ7jhB2ZuOzE5KUGM9s0VYlVDu5GWa9oec/5hb47oRS3IW1O8q7w0hbxwW7pHkjmw5pgSNrVzzUdR89QIUUSdb4SB+pBqQzC/h1IhBVXVh/dI3w48deZ/gBajGAOHQtFVuFu6hWUxa2vVw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=WGDxbQ49SA0PXO44Cr7jndWjw2qAOMx8ScY5aviUcbGPS1qGaTMI+MZbV2sFbyOAvkpC9+HcyUPOOHe0K4BjX9BHYk2v+90MCx+Jpsl4NzzzWdhEeQRaS3O7K9oJyxbWlYrkDyWddnYTW7Az/tkmRnmw9t9a4AbSHSY2AOWXqnnwhUO6XcImp/RxDl5B9p9szwVeQiMk0/kxkdA83hHt4rm1MvUoNJAT8+jtgq0a6rvT5XVsfpZ9PXLSkk7IqPmI6FCRmUb3D72Z537qt9q4cNYgcCc6xcJLW2JUnfiuU99Xcm17vNvnH0dBTrwTVEVX+KKS/dtmJcK6GfUyXVwDVg==
  • Cc: <sstabellini@xxxxxxxxxx>, Luca Miccio <luca.miccio@xxxxxxx>
  • Delivery-date: Mon, 18 Nov 2024 14:12:25 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

The current README incorrectly omits the need for the UBOOT_SOURCE and
UBOOT_SCRIPT variables for uboot-script-gen to function properly.
Moreover, the script silently fails if these variables are not set.
Return an error if the the UBOOT_SCRIPT variable is not set and
correct the documentation accordingly.

Signed-off-by: Luca Miccio <luca.miccio@xxxxxxx>
---
 README.md                |  3 ++-
 scripts/uboot-script-gen | 12 ++++++++++++
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 4fcd908..ae2fdfd 100644
--- a/README.md
+++ b/README.md
@@ -272,7 +272,8 @@ Where:
 
 - 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
+  parameter. It has to be set either in the config file or CLI argument
+  though.
 
 - APPEND_EXTRA_CMDS: is optional and specifies the path to a text file
   containing extra u-boot commands to be added to the boot script before
diff --git a/scripts/uboot-script-gen b/scripts/uboot-script-gen
index dcf5bdb..b07cbf1 100755
--- a/scripts/uboot-script-gen
+++ b/scripts/uboot-script-gen
@@ -1210,6 +1210,18 @@ then
     UBOOT_SCRIPT="$uboot_out_opt".scr
     UBOOT_SOURCE="$uboot_out_opt".source
 fi
+
+if test ! "$UBOOT_SOURCE"
+then
+    echo "UBOOT_SOURCE not set, either specify it in the config or set it with 
the -o option"
+    exit 1
+fi
+
+if test ! "$UBOOT_SCRIPT"
+then
+    UBOOT_SCRIPT="$UBOOT_SCRIPT".scr
+fi
+
 if test "$fit_opt" && ! test "$FIT"
 then
     FIT="${UBOOT_SOURCE%.source}.fit"
-- 
2.34.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.