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

Re: [ImageBuilder] Use LOAD_CMD by default if not specified in load_file()


  • To: Mykola Kvach <xakep.amatop@xxxxxxxxx>
  • From: "Orzel, Michal" <michal.orzel@xxxxxxx>
  • Date: Tue, 9 Sep 2025 11:29:39 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=gmail.com 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=xiWPo5rjWNA/PBVIm8tPUmXe+XE3l74Vgdg0+9VU4WA=; b=WJjXrFpJX+X+Z5BLRMBKViM238swwC27hcmol6YdqTsMATRq7uhgngja+jUiL9W9m6ZosTHZPnMYHpfJcDuCRfCJC83uGFhZZ7b/s4ZccDSq5bKQIwgqGDEWdM+F0C52f/de5gIt56v0tHMCMt/yK1m16HoyebX1csSlfbDOo311YIFDyU84j4EtivEmjjxj0HZjCxuDeUtUh7dfGlb80QP1QsnpHzmha21viPOSw+JYlYzRk6BuoSAd/KboOvlENXQQYlOtiyKxBm43BZqDXJgKKVAfDBmchLUybDwgVxuh34SUQNjUHBHMYoTvp5rU6xgTFqj0aheLBXa0fgwevA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=pAz+JszSFLosjqWukHn4QfgaG1kOwNVOGN/PZDY8Pn6L0fZvNxVYVcKljnL+qzlNvc430f5s1IURApNOeUFUDnAq9XtWlXgAfST2i2NbU+eE9+KGx5AnfujIoXSDauxZ3DxNjhCT6MjGT04JJ4eE2Gn2kUt259k9mk+rvEo6WHO7tjQJ1zxvUXBYMjkQ81b6VekBQmcsUhUOhXFhmtVyIdS/sQ08oQ33mALqhXd+OdJum883WBqljuAZG01JcbvEuC/sWn63kG/vTj1ND6R8pkH3yNgMHDthtYyDVhaUyPeN8FWZWz1o3koeEq5Brd9cMTGD6aTRWK8UrPqLJhYcxw==
  • Cc: <xen-devel@xxxxxxxxxxxxxxxxxxxx>, <sstabellini@xxxxxxxxxx>
  • Delivery-date: Tue, 09 Sep 2025 09:30:02 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


On 09/09/2025 11:22, Mykola Kvach wrote:
> Hi Michal,
> 
> Thank you for the patch and the detailed explanation.
> 
> On Tue, Sep 9, 2025 at 10:42 AM Michal Orzel <michal.orzel@xxxxxxx> wrote:
>>
>> Commit 061d6782756f modified load_file() to take load command as
>> argument but did not change all the invocations (e.g. loading standalone
>> Linux, bitstream, etc.) which broke the output script (load command
>> empty). Fix it by defaulting to LOAD_CMD if not specified.
>>
>> Fixes: 061d6782756f ("Add config option to use separate load commands for 
>> Xen, DOM0 and DOMU binaries")
>> Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>
>> ---
>>  scripts/uboot-script-gen | 6 ++++++
>>  1 file changed, 6 insertions(+)
>>
>> diff --git a/scripts/uboot-script-gen b/scripts/uboot-script-gen
>> index 849b8f939e81..4f9261035d73 100755
>> --- a/scripts/uboot-script-gen
>> +++ b/scripts/uboot-script-gen
>> @@ -736,6 +736,12 @@ function load_file()
>>      local base="$(realpath $PWD)"/
>>      local relative_path=${absolute_path#"$base"}
>>
>> +    # Default to LOAD_CMD if not specified
>> +    if test -z "${load_cmd}"
>> +    then
>> +        load_cmd="${LOAD_CMD}"
>> +    fi
>> +
> 
> I was wondering if we could use a slightly more concise notation here, like:
> : "${load_cmd:=$LOAD_CMD}"
> 
> It does the same thing but is a bit more idiomatic for Bash scripts.
Some time ago, Stefano requested me to use a simpler notation in ImageBuilder,
so that it's immediately clear what the script does. Therefore I followed this
suggestion here as well. I will let him choose what suits the project best.

~Michal




 


Rackspace

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