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

[ImageBuilder] [PATCH V2] UBOOT_SOURCE/SCRIPTS variables must always be set


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Luca Miccio <luca.miccio@xxxxxxx>
  • Date: Tue, 19 Nov 2024 07:01:11 -0800
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.12) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none 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=BgX1RG63i7eS+LqYlHg9yb4nVKr5zAHP3y8gE1F5F4A=; b=Ltr08MRltq3eb9oFs6/XuUVnlH5nwUoWgx6Sc18VH5Z3x0LgJEfaw+w28Mi2toRMhFKoT+BS2P/zvmrEnjhMhZtcEDjMezp0Lb+yGbMtpAbgSyZi2KNUo47TeXV+z9pALfBbRtcYCYH2AXoRUiVwpYTmOQPkQivxJCVUYzQwNu6UzYbL5qbr5fRlfcFq/fYdgG2Sk9AYMg0WcoDmT0GSLeHidgmqXeaQN2VrC2sBdmh5/jjNwWA2McSavxpFSlmKHBEIVoo2DHFiAcx38Q9k/DwphQmuJVpPd164vsDwzS01GKl/JE+X7Vls4LRrkwZ182jgFN3+suj+iESNOlkT0g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=l20bwZWr7CU7mN6bCO0ApHpxfq4H1cYv2/9WRupGVa64j5ipe6Tlkc+k3uI3K1Oa3v8duArTxgXHPdZC7YVecWRA4bad21gMClvy05MshUYD6QR4t1IoRFJKO7I87d6Q2gb+0/bkx39Jtx8f5c+XpS4DYdRUWTbNMAJk2bQfYAK3IorbRNwhN5pPRtN/9mYFN+kVIjs3I9lX2Q1MSnsVyNEpJVBnNb/QKXiJlFS0ToLGFnXP0CmD15wgSKuHXYcwLG2XpNDvvVsXkhdh1wLepteEDQBjVyD/dMPdURSj/R0KLJwiGMkTBVMfnc56AkxvImmM4sgKygFpe84y3gPDTw==
  • Cc: <sstabellini@xxxxxxxxxx>
  • Delivery-date: Tue, 19 Nov 2024 15:01:33 +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..fc63702 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_SOURCE%.source}.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®.