From nobody Tue Apr 30 17:00:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=oss.nxp.com); dmarc=fail(p=none dis=none) header.from=oss.nxp.com ARC-Seal: i=2; a=rsa-sha256; t=1656597951; cv=pass; d=zohomail.com; s=zohoarc; b=RZt0h1ws0FnakPGeF0+sp9u8IE3hAWeZrKo+2Y7kX38FfthcvtcM4e8fBCPzmmj/KyTGUZ9QSF7ylK1IaXf0zngm2abfZC7clpGkZwaDYsvds38o3a1kkyykqd+tJ0oatyT30IFbxu/7LiayG6kGEhEX9hR3KCKz0cIip8czsiE= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1656597951; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7giP8A1iOXK4r5YaK7UVvP9/j+xU4cgR7sxpc6z2ONI=; b=XNfFY6pXGghP+C8mR0IcB43HFLTef9pGZyh3GDxxUYn9UnXkqScmxGSEEqHv+6A/x3wLGwFjHivof6HwLGdU9VV9TFeKgNGOi2z2qX6SeiinocG5G8E2FbtXzuqFdI51N3EITAH9uVcl+YFJZKO8GYowE5WmaYp+1k+zQ+ipsG0= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=oss.nxp.com); dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1656597951498509.02974376975203; Thu, 30 Jun 2022 07:05:51 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.358511.587765 (Exim 4.92) (envelope-from ) id 1o6umr-0004V7-6b; Thu, 30 Jun 2022 14:04:53 +0000 Received: by outflank-mailman (output) from mailman id 358511.587765; Thu, 30 Jun 2022 14:04:53 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1o6umr-0004UL-25; Thu, 30 Jun 2022 14:04:53 +0000 Received: by outflank-mailman (input) for mailman id 358511; Thu, 30 Jun 2022 14:04:19 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1o6umJ-0004O6-3c for xen-devel@lists.xenproject.org; Thu, 30 Jun 2022 14:04:19 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70059.outbound.protection.outlook.com [40.107.7.59]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 821adbf6-f87d-11ec-bdce-3d151da133c5; Thu, 30 Jun 2022 16:04:08 +0200 (CEST) Received: from VI1PR04MB5056.eurprd04.prod.outlook.com (2603:10a6:803:5a::13) by DU0PR04MB9322.eurprd04.prod.outlook.com (2603:10a6:10:355::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5373.18; Thu, 30 Jun 2022 14:04:14 +0000 Received: from VI1PR04MB5056.eurprd04.prod.outlook.com ([fe80::1549:6f15:1949:f1a5]) by VI1PR04MB5056.eurprd04.prod.outlook.com ([fe80::1549:6f15:1949:f1a5%6]) with mapi id 15.20.5395.015; Thu, 30 Jun 2022 14:04:13 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 821adbf6-f87d-11ec-bdce-3d151da133c5 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iXY1k/P0bk3m/GfBSMjWRH/ulnetKmgn6JNt09emUVtWhvCIDRzeOG6JjBVuQRWJ09l2t24WvRmzC35k2VlcOUfN21SyrHOkeZyBb+jy1PqhN0xcj6/37merMNIV+Q6ChDuo7cYzz41W5iPUhPJ8voMXymuIQ/9ki7lEa2bmqSJmLDnv5eccTSQZikjvYHDOFY8TJd7L3llcKEKsYC8DK99G18z+wtUsb0yKILxjmSP1U0/XjvKDnIPx9NGTO81Qm9T1yTJ4/MnCVi1A0Mm2e7NSd2cnoZYFENFtEs0jh1319cKecuO1CFeDVFlWGD/w2auZbHWrBIkLBNAht8y8Pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=7giP8A1iOXK4r5YaK7UVvP9/j+xU4cgR7sxpc6z2ONI=; b=GieAOesNy7rYgjEKVCPDOMjUvJJGdkNuuuwBavfMGjHZmzQBdcD2CU/caecYoLhwNgwcNdXPxI/1TQuPOm22vIEZfgMegA+prtPy/Z2M8TZvBXsi2BnH2vouskn/SVmBX9ikYuMU6ndd7VMQTu7EVYqFYmwpNLzx+gpg2+g10pZONnn6+qVQN3r0fCdycrEGCaVTNHZH+TZYyppr3cblXOTVxBcUkyZKHxaDFN1kIfmj00BivrFSqrGecYo8k5BcydqU2YluCIPAP5hu6nRPYeJ0ExtL9VanNVQc4mW0nQHz6tz1iyKjAMJ0eqowcJj7gzWqR8ewS0ATSMspRBogow== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7giP8A1iOXK4r5YaK7UVvP9/j+xU4cgR7sxpc6z2ONI=; b=b3bKox2luCJh3uG9LYknIigWafyWSjOli0Y1SR+sOoYxuYYO4VE80EM4bW2FgjZA3SBpTSv8tmd8PNPpXL531DKapfJl2+HlUfcuxA9NSkMKgcPXH136zTsGKEL3RWAo0QCz+JiHfHca7yFvku/8Eidimf8yjPLy8d3glCKB6HE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; From: "Andrei Cherechesu (OSS)" To: xen-devel@lists.xenproject.org Cc: viryaos-discuss@lists.sourceforge.net, sstabellini@kernel.org, Andrei Cherechesu Subject: [ImageBuilder][PATCH v2 1/4] scripts: Add support for prepending path to file names Date: Thu, 30 Jun 2022 17:00:26 +0300 Message-Id: <20220630140028.3227385-2-andrei.cherechesu@oss.nxp.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220630140028.3227385-1-andrei.cherechesu@oss.nxp.com> References: <20220630140028.3227385-1-andrei.cherechesu@oss.nxp.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: AM0PR03CA0089.eurprd03.prod.outlook.com (2603:10a6:208:69::30) To VI1PR04MB5056.eurprd04.prod.outlook.com (2603:10a6:803:5a::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 933f6104-b5ca-4a51-6275-08da5aa169be X-MS-TrafficTypeDiagnostic: DU0PR04MB9322:EE_ X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BdocNINpiOuxSxtoTht6KPhwqlNKePMkfJSIq6FOuxQaVDoFCP4nhhSeplKZyQBDHPKzePTYt8JSzFfsR1RcEAhHKerSto06RXCpgV0BcOl6YMOlEVCpDlvHaVD2e97+59Xs7AiFAgo1QCTWVLF7b2/DqzLbbLCIHUzZq6KkQ4zNAdrdKQuN689lSILZ1bewSKCSovQniv5N7HQDr2lj6cMXTfpWCT5YzhD/nJs5QUHioiLgdv41epBZhk/yIvcY0nnu+HzZVob/6E6qc9LlsAgxfeh7uipVoyY8zT9i+7Yr+HSTjvUK2W7g6U6LCVlJES3IBkuAIw92AQWBNr4oRj5iZ8YproCIr4lGCNqtFh1Wz2WmSSms5HS0XfmKPexBBrhzv8PcaILo2tKHdX4ENvLP27d4vklv0LW9fT802z1d1YJRfPZUJkRVvM7A3MUtNP1yGCzz3X6jZdAfTZJr2KOmfC8F+nyX5SH+jn69eeK8Pz92iuMvcKFH2x6wa1yRPF6rN65hVGZ9Fmxz4aQLGLdYQcYpgtOTC1XVCqwZC2DuzP6L81Eoy4btk7TGLag1mfu6aPXN4rPGa6Rykn0xCwm/WuheL5PERneR/NwQ4P4iIzT4qfEVBq14/pH5FqyM1Xzj0dCJ6wFUJPAzph2yk0ssQWTfjE2pe8tvBVDn+85EV1uQATR7vwbhCDEWnSH+sw1aV+Jq6bdk29uAVkyIrOItiCOjQflFe19yPAWE088dz+gq0xblpFUUdVosl9f3yxo9SIKbR/tS8CDHk1Gy15htYOiG1sUm/l/SocVqhKJG1k95jszzM2NEggVU+u9U X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5056.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(346002)(366004)(136003)(396003)(39860400002)(376002)(478600001)(41300700001)(5660300002)(6666004)(186003)(6486002)(6512007)(52116002)(1076003)(86362001)(26005)(8936002)(2906002)(2616005)(66946007)(4326008)(38100700002)(8676002)(6506007)(316002)(66476007)(66556008)(38350700002)(83380400001)(6916009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?/6inGlVl0mxGbVn8w8PbvLkPDC4AUGE/pgfQHpesNPuYCCLAmpi29Cl0t/NQ?= =?us-ascii?Q?9BRCqJXQdNDdv3A4H2LtWzF5xAB168Kv/LXTXZ26XDitkWhJbB/tQ1Xck4zA?= =?us-ascii?Q?EOJvU9ijtrnP/ZuYHU4Sbjnkzz2DSsJ3R8pV/PMSNMfgrnuEEHraEK0Lb5jB?= =?us-ascii?Q?Xr16uPHmzT2RdEbmKcYzcAJWEaB4/Vbl2mGeWNOFggRkYQv5lTF1fyz37bOO?= =?us-ascii?Q?QMW4vl78MElFaxW6+DqBU/lhMQ8sQlCe8tcIZv3JS5mDtXYWRfQMPQNQ/cDl?= =?us-ascii?Q?8TxWSZE9Ss//ZFZsgf1GCkXJt2CTMjPy+hwvNl9cqCfycU4qlu3fulJ+ENet?= =?us-ascii?Q?HQAVNRApL+CH7WcSDu+d1pzUPFNRj0wqu50YU6cGXMP5KuGY6Gyq4vnvumti?= =?us-ascii?Q?FAme0Uus9injZihicHZNWMonB1RprOKiFkqcmdv9SOYz6NZLhlFSWxaP9Vpq?= =?us-ascii?Q?NEdGaOSBpzNFns+1Rq1dZI3n61karxUD0VuFjoaQAUc2c6kM943PMMEgv974?= =?us-ascii?Q?X/eATYref4q9X4mzdGCNEhpLi+tEZMG97rEy7BhvRL997LGg7//Ipyy+4gxl?= =?us-ascii?Q?KJLWBc0N9SGls7xtYQxkrTJPWK2E70WWmvSdMYDAcckU9YePq0lwARLkdeYG?= =?us-ascii?Q?mbhtc9SCf+nEx9SNkTkxt9powzvvoMpI6Cp9X083qrhtN8M/xfWG1YpF0PxK?= =?us-ascii?Q?Smp5i2SXfUsMFHqFaUCPPC8kmEGNEX3QST4+SLeHHt0k1U+n5fgrfG778yFD?= =?us-ascii?Q?Ag+JhCwtOb7cyW8JetoQmZnBebWWxkYutJBUUrshPLuvWEaPJkvcOaCmMwRa?= =?us-ascii?Q?uk/CNRxzj8DbmiRmo1XjYEJjvNv+kikR32akLjDrBQPqVmfd9C3iQmIsRhCs?= =?us-ascii?Q?iOAf4HFS1LQJ4tm+9juTOKDvyLmX2dKJXj6a0DriZPXu77e+/322ptosY0JY?= =?us-ascii?Q?OA8jBNbQgH67LwEjOMTe+8aM060GK9bWWHt/PeeG33Rw9IID6uujRvCwz7jY?= =?us-ascii?Q?ziiZf5KrgeMQAVXHwA8vdp9todO6BF+W8d9KvPrEBNYn6or8B64JqhmTxZsc?= =?us-ascii?Q?XfyWywGvAeYxFno+4PKWOH9PhePPrquFz9Reke1pTWWDf2oSP78YLGChElfT?= =?us-ascii?Q?Rk1ieXapFdw9bSN31QIOtkVWI1wF52naLgIdVYtGTeX7aEDoiJuKqeOuhkBE?= =?us-ascii?Q?nb0UhBxwlhjTxXDYbqYYkoBnO1D63wvFCYclT6ZRdRXl+u3zlCv2ulaEqe4s?= =?us-ascii?Q?XJj7XdFrPuNs2w/2I9dHLoe2OBYvfMZruBt9o3XDVnY1nt0u/riGjipA+NYL?= =?us-ascii?Q?fzdB15ProqVY9G2a9fcrB8ohtp+fuIoJUwQHhUmuItkthA9HOoMgqS0U+gN/?= =?us-ascii?Q?7U8wpzfXAWoGW/L/zV3vT8lZ4Hod1kNpIqZbCU3AUH14S98KWqa7OkvRg15w?= =?us-ascii?Q?MAk5Syzf4pGwN3lHi+8PlfD37Yg1s1ZgtuJwdsi79OUKzrgQ1GeOz9lRWwWP?= =?us-ascii?Q?s9XUz4tbesTk6WL2HTToEREiV/ypz+C26qTUORz+JgMw+v7aPB5JsyyUA59Y?= =?us-ascii?Q?FElrY4T8MJC+3r1P+BcDC9AFQyY0fRX22XtiixNp+Er4MgAm1A01iLDRs+Mg?= =?us-ascii?Q?xg=3D=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 933f6104-b5ca-4a51-6275-08da5aa169be X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5056.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jun 2022 14:04:13.8853 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: zk+Jo9wKlfQGj/dT1D9pz1hszik6zTfmW5Y20Lc2T+4qz7HCqHjB50M18gYJcUbIp8kFVcNJ4rbfvoTArrghYEZJhAvbAkOzzhO1YIdwfxc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR04MB9322 X-ZohoMail-DKIM: pass (identity @NXP1.onmicrosoft.com) X-ZM-MESSAGEID: 1656597954583100003 Content-Type: text/plain; charset="utf-8" From: Andrei Cherechesu Added support for prepending path to file names in the final generated u-boot script, for the use-case where we have the files in a separate folder that can be accessed with a given $LOAD_CMD. For example, we can have "fatload mmc 0:2" as LOAD_CMD but the files would need to be loaded from the /boot folder within the 2nd partition, not from the root ("/"). By specifying the "-p " parameter when running the script, paths like "/boot" can be automatically prepended to the generated u-boot commands used to load the files in board's memory. Also added the support to disk_image script, to enable generating a FAT partition with the binaries deployed in a custom folder within it, if the "-p" parameter is specified. Signed-off-by: Andrei Cherechesu Reviewed-by: Stefano Stabellini --- scripts/disk_image | 37 +++++++++++++++++++++++-------------- scripts/uboot-script-gen | 12 ++++++++---- 2 files changed, 31 insertions(+), 18 deletions(-) diff --git a/scripts/disk_image b/scripts/disk_image index 12fb06b..97e798f 100755 --- a/scripts/disk_image +++ b/scripts/disk_image @@ -539,7 +539,7 @@ function write_rootfs() function print_help { echo "usage:" - echo " $0 -c CONFIG_FILE -d UBOOT_DIRECTORY -t UBOOT_TYPE <-w WORK_DIR= ECTORY> <-s SLACK> <-a> -o IMG_FILE" + echo " $0 -c CONFIG_FILE -d UBOOT_DIRECTORY -t UBOOT_TYPE <-w WORK_DIR= ECTORY> <-s SLACK> <-a> -o IMG_FILE <-p PREPEND_PATH>" echo " $0 -h" echo "where:" echo " -c CONFIG_FILE - configuration file" @@ -553,6 +553,7 @@ function print_help echo " -s SLACK - free MB to add to each partition, default 128" echo " -a specifies that the size of IMG_FILE has to be aligned to the= nearest power of two" echo " -o IMG_FILE - the output img file " + echo " -p PREPEND_PATH - path to be appended before file names to cust= omize deploy location within rootfs" echo "Example:" echo " $0 -c ../config -d ./build42 -w tmp -o disk.img" } @@ -564,7 +565,7 @@ then exit 1 fi =20 -while getopts ":w:d:c:t:s:o:ah" opt +while getopts ":w:d:c:t:s:o:ahp:" opt do case ${opt} in t ) @@ -606,6 +607,9 @@ do a ) ALIGN=3D1 ;; + p ) + PREPEND_PATH=3D"$OPTARG" + ;; h ) print_help exit 0 @@ -828,56 +832,61 @@ mount /dev/mapper/diskimage1 $DESTDIR/part/disk1 =20 # only copy over files that were counted for the partition size cd "$UBOOT_OUT" -cp --parents "$DOM0_KERNEL" "${DESTDIR_ABS}/part/disk1/" -cp --parents "$DEVICE_TREE" "${DESTDIR_ABS}/part/disk1/" -cp --parents "$UBOOT_SCRIPT" "${DESTDIR_ABS}/part/disk1/" +if [ -n "$PREPEND_PATH" ] +then + mkdir -p "${DESTDIR_ABS}/part/disk1/${PREPEND_PATH}" +fi + +cp --parents "$DOM0_KERNEL" "${DESTDIR_ABS}/part/disk1/${PREPEND_PATH}" +cp --parents "$DEVICE_TREE" "${DESTDIR_ABS}/part/disk1/${PREPEND_PATH}" +cp --parents "$UBOOT_SCRIPT" "${DESTDIR_ABS}/part/disk1/${PREPEND_PATH}" =20 if test "${DOM0_RAMDISK}" then - cp --parents "$DOM0_RAMDISK" "${DESTDIR_ABS}/part/disk1/" + cp --parents "$DOM0_RAMDISK" "${DESTDIR_ABS}/part/disk1/${PREPEND_PATH= }" fi if test "$NUM_DT_OVERLAY" && test "$NUM_DT_OVERLAY" -gt 0 then i=3D0 while test $i -lt "$NUM_DT_OVERLAY" do - cp --parents "${DT_OVERLAY[$i]}" "${DESTDIR_ABS}/part/disk1/" + cp --parents "${DT_OVERLAY[$i]}" "${DESTDIR_ABS}/part/disk1/${PREP= END_PATH}" i=3D$(( $i + 1 )) done fi if test "${UBOOT_SOURCE}" then - cp --parents "$UBOOT_SOURCE" "${DESTDIR_ABS}/part/disk1/" + cp --parents "$UBOOT_SOURCE" "${DESTDIR_ABS}/part/disk1/${PREPEND_PATH= }" fi if test "${XEN}" then - cp --parents "$XEN" "${DESTDIR_ABS}/part/disk1/" + cp --parents "$XEN" "${DESTDIR_ABS}/part/disk1/${PREPEND_PATH}" fi if test "$NUM_BOOT_AUX_FILE" && test "$NUM_BOOT_AUX_FILE" -gt 0 then i=3D0 while test $i -lt "$NUM_BOOT_AUX_FILE" do - cp --parents "${BOOT_AUX_FILE[$i]}" "${DESTDIR_ABS}/part/disk1/" + cp --parents "${BOOT_AUX_FILE[$i]}" "${DESTDIR_ABS}/part/disk1/${P= REPEND_PATH}" i=3D$(( $i + 1 )) done fi if test "${BITSTREAM}" then - cp --parents "$BITSTREAM" "${DESTDIR_ABS}/part/disk1/" + cp --parents "$BITSTREAM" "${DESTDIR_ABS}/part/disk1/${PREPEND_PATH}" fi =20 i=3D0 while test $i -lt $NUM_DOMUS do - cp --parents "${DOMU_KERNEL[$i]}" "${DESTDIR_ABS}/part/disk1/" + cp --parents "${DOMU_KERNEL[$i]}" "${DESTDIR_ABS}/part/disk1/${PREPEND= _PATH}" if test "${DOMU_RAMDISK[$i]}" then - cp --parents "${DOMU_RAMDISK[$i]}" "${DESTDIR_ABS}/part/disk1/" + cp --parents "${DOMU_RAMDISK[$i]}" "${DESTDIR_ABS}/part/disk1/${PR= EPEND_PATH}" fi if test "${DOMU_PASSTHROUGH_DTB[$i]}" then - cp --parents "${DOMU_PASSTHROUGH_DTB[$i]}" "${DESTDIR_ABS}/part/di= sk1/" + cp --parents "${DOMU_PASSTHROUGH_DTB[$i]}" "${DESTDIR_ABS}/part/di= sk1/${PREPEND_PATH}" fi i=3D$(( $i + 1 )) done diff --git a/scripts/uboot-script-gen b/scripts/uboot-script-gen index 085e29f..8f08cd6 100755 --- a/scripts/uboot-script-gen +++ b/scripts/uboot-script-gen @@ -316,7 +316,7 @@ function load_file() then echo "imxtract \$fit_addr $fit_scr_name $memaddr" >> $UBOOT_SOURCE else - echo "$LOAD_CMD $memaddr $relative_path" >> $UBOOT_SOURCE + echo "$LOAD_CMD $memaddr ${prepend_path:+$prepend_path/}$relative_= path" >> $UBOOT_SOURCE fi add_size $filename } @@ -891,7 +891,7 @@ function print_help { script=3D`basename "$0"` echo "usage:" - echo " $script -c CONFIG_FILE -d DIRECTORY [-t LOAD_CMD] [-o FILE] [-k= KEY_DIR/HINT [-u U-BOOT_DTB]] [-e] [-f]" + echo " $script -c CONFIG_FILE -d DIRECTORY [-t LOAD_CMD] [-o FILE] [-k= KEY_DIR/HINT [-u U-BOOT_DTB]] [-e] [-f] [-p PREPEND_PATH]" echo " $script -h" echo "where:" echo " CONFIG_FILE - configuration file" @@ -907,6 +907,7 @@ function print_help echo " HINT - the file name of the crt and key file minus the suffix (= ex, hint.crt and hint.key)" echo " U-BOOT_DTB - u-boot control dtb so that the public key gets add= ed to it" echo " -f - enable generating a FIT image" + echo " PREPEND_PATH - path to be appended before file names to match d= eploy location within rootfs" echo " -h - prints out the help message and exits " echo "Defaults:" echo " CONFIG_FILE=3D$cfg_file, UBOOT_TYPE=3D\"LOAD_CMD\" env var, DIR= ECTORY=3D$uboot_dir" @@ -914,7 +915,7 @@ function print_help echo " $script -c ../config -d ./build42 -t \"scsi load 1:1\"" } =20 -while getopts ":c:t:d:ho:k:u:f" opt; do +while getopts ":c:t:d:ho:k:u:fp:" opt; do case ${opt} in t ) case $OPTARG in @@ -953,6 +954,9 @@ while getopts ":c:t:d:ho:k:u:f" opt; do f ) fit_opt=3Dy ;; + p ) + prepend_path=3D"$OPTARG" + ;; h ) print_help exit 0 @@ -1179,5 +1183,5 @@ then echo "$LOAD_CMD $fit_addr $FIT; source $fit_addr:boot_scr" else echo "Generated uboot script $UBOOT_SCRIPT, to be loaded at address $u= boot_addr:" - echo "$LOAD_CMD $uboot_addr $UBOOT_SCRIPT; source $uboot_addr" + echo "$LOAD_CMD $uboot_addr ${prepend_path:+$prepend_path/}$UBOOT_SCRI= PT; source $uboot_addr" fi --=20 2.35.1 From nobody Tue Apr 30 17:00:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=oss.nxp.com); dmarc=fail(p=none dis=none) header.from=oss.nxp.com ARC-Seal: i=2; a=rsa-sha256; t=1656597970; cv=pass; d=zohomail.com; s=zohoarc; b=lv2ULzQ15MG8daKqFEIGQZ+7L5ZvhpWPvrtrSyMoutXODujyoR5memHddUjbvSYUbpxh3T1BsX9Od6qZLq06YNe94mSKugWAii0TizZCzCE/dlIIBUh2NemNzrcFgiuR86RYR0KPt06+sdfXnHtgR0ONvUowH948lwXKYGLJ44o= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1656597970; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=0p9WID8wCWme7yTVDlS/nHDHlNEKgtykRbLwYbaQeI4=; b=UfSb3ZNud8D/tOwhC+eCeDv2kSRujyS69t9O955ftDD+gc3wCHUkIgh5LxaTnz6jU6ddDK081ULVmKPx5IuER/a8k3fXeEVM/wTbOOWfPiuyu+gIBBw6E2FlCNcX+7uzxNzlt4zw3jJ26/77pyYvyRMZAkFf00ti4fpdfn2tafY= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=oss.nxp.com); dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1656597970456478.38053210346607; Thu, 30 Jun 2022 07:06:10 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.358512.587772 (Exim 4.92) (envelope-from ) id 1o6umr-0004br-GV; Thu, 30 Jun 2022 14:04:53 +0000 Received: by outflank-mailman (output) from mailman id 358512.587772; Thu, 30 Jun 2022 14:04:53 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1o6umr-0004Zn-B5; Thu, 30 Jun 2022 14:04:53 +0000 Received: by outflank-mailman (input) for mailman id 358512; Thu, 30 Jun 2022 14:04:19 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1o6umJ-0004O6-OP for xen-devel@lists.xenproject.org; Thu, 30 Jun 2022 14:04:19 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70059.outbound.protection.outlook.com [40.107.7.59]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 8319805a-f87d-11ec-bdce-3d151da133c5; Thu, 30 Jun 2022 16:04:09 +0200 (CEST) Received: from VI1PR04MB5056.eurprd04.prod.outlook.com (2603:10a6:803:5a::13) by DU0PR04MB9322.eurprd04.prod.outlook.com (2603:10a6:10:355::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5373.18; Thu, 30 Jun 2022 14:04:15 +0000 Received: from VI1PR04MB5056.eurprd04.prod.outlook.com ([fe80::1549:6f15:1949:f1a5]) by VI1PR04MB5056.eurprd04.prod.outlook.com ([fe80::1549:6f15:1949:f1a5%6]) with mapi id 15.20.5395.015; Thu, 30 Jun 2022 14:04:15 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 8319805a-f87d-11ec-bdce-3d151da133c5 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g0TPi6aWJw0SO7x+DuRH21xHOnECvpwd0r0ZTSN/0C+JhUd8zMpFDTT9eZUTMQHK6+uxz04snj/mFZ5Hwcr/WD7rWEvVE5RvSFNZFs58sLW4oG0OpWDPCuBKjZlwXOe6BNuSQkVw2wbpfp4xNYLMoXMAb17gou6LzD3TcAIShzuzyfAefit0i4iH2m8/k5xR0GDJoGeCUt4d5FKGIl6+6SZ+utgoPiMhEhOBa7/9l8z3mOgFQHGl+Ja8ZtGmBh/qvn8cl0BKUzV89WjVWExpXtFzlr0Fq/uQFgEsmYABjnlq3Izp7hdZkSTVgAyy6BPSrrZ5l/WJPf5EkpkoeoPQIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=0p9WID8wCWme7yTVDlS/nHDHlNEKgtykRbLwYbaQeI4=; b=mfbrWwedUKkeHZ6Vzec50C9Ikd+SBPs+wJbOhcnk7gjpJFkuSMl8fCTm5iURExowkUzuP4fDtjcJX6kb0sBJ9AhqZ0+W8gY4LYfFM1AP6fzYM1/tybx4DeB/PUOwqtAL9S5AIegQxgpcICifnfOZwkeUGPnSWelqDfFpZQ5inK1tyLY+0dstNax/rnoQiHj1eAYbbsWCanowMDxm9RqhgJadC7fX7vQM2fKzzI3nsUAuYZk+FeLAiliu6KFozvtWwCc8lg1h04OarUR8puEYXHyLGW1qXU+oZG/jmziGx/IMqW0cXqoZXYxuYA/J7fpbU0hX6exXzY/EyFTWHWHvng== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0p9WID8wCWme7yTVDlS/nHDHlNEKgtykRbLwYbaQeI4=; b=FpqiTeDycGl20L854ENWpvCiRyWibKzqfc8uPwHzhnDd5BNm7EoF+ZiLiwuLzP/REW/T7F8aBlp+IVeQ3FyojFetGjaFRbd/q4gjYCJNpUYxqSRdUmSGHTHoTYZW0w5y/d5CWg2+zzxq/EdV9DvhWIKBcukOQEjkvCIz5XSG57A= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; From: "Andrei Cherechesu (OSS)" To: xen-devel@lists.xenproject.org Cc: viryaos-discuss@lists.sourceforge.net, sstabellini@kernel.org, Andrei Cherechesu Subject: [ImageBuilder][PATCH v2 2/4] uboot-script-gen: Dynamically compute addr and size when loading binaries Date: Thu, 30 Jun 2022 17:00:27 +0300 Message-Id: <20220630140028.3227385-3-andrei.cherechesu@oss.nxp.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220630140028.3227385-1-andrei.cherechesu@oss.nxp.com> References: <20220630140028.3227385-1-andrei.cherechesu@oss.nxp.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: AM0PR03CA0089.eurprd03.prod.outlook.com (2603:10a6:208:69::30) To VI1PR04MB5056.eurprd04.prod.outlook.com (2603:10a6:803:5a::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d9c75e5c-1b4c-4582-c8fa-08da5aa16aac X-MS-TrafficTypeDiagnostic: DU0PR04MB9322:EE_ X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: N59m1XvfonJiMTpf+UpG/yzpCE7zOaAYt3GjBy5A1i+bySQs6loarS8kvi4osTx1MKoDYVagDkAO78BJ07t+yVBfTNGsyhS6lJBjfXebx+woEGOewxF7DQDV3RhokQpT2CifvB+NM8Ke+y+nErbhnjf/a8ogGxDkGYKrBoBzvSHfpzJLOH/9jPFwbXTGf5bhT0t9ViDhJ+NDwCmlV0zcVb0WXWix4jkdmicD1U+LeE+6VZMUsUpuUNEhw3t2jZwWHFOUzmySpFb5IT0alpQMumuSg7IhBL2qtUMv717hx9LDzLtqfQJaw1+1pjuw+r34x3B5cOHs8H2O0INJjoSAma7IlbSPTEgG2IY5MbaFVEycQiDZ5t23DN60mBqAdmjEGRn2FAmbg0ItOgg0e37AgzS+zs6UjCLNfI30PcKvMLYeCrtLqxlhtPfdznWupMp2trUJ54QQl0BeWjV4X6/qTQmgLftOgd0PSZVcLjfzUqQDOozRYV/CGBnnuORDrG3pYSiLqtlutlqMWIpAlmhPFVo5cBiAO03XZ5u5nvf8ynMACiuppq6QcqsQmd9Hb9bZZaDu/NWniycjpFAvEelgolT99uI3FHngUwuOnCiXyWDq9jOYvKH4ZPmz09d7p3HtxT1m/8UQQD8VuEYdhgK7UiOGLlE7J6xAd82myKsj34AmOhhr291Ismo8pxqN8I7IBuWMUFN0lmwLoXpg4eamT5nwRRpojbHTpA18w4wvjYBSIEQGSfxnXVfVJfMfZAGPHKL5GMFwoVnJSS4XCibaDkJ4gRBxeBAQIlrRh1OkQ0ohfNooMN0iAOv/KGZExZtV X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5056.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(346002)(366004)(136003)(396003)(39860400002)(376002)(478600001)(41300700001)(5660300002)(6666004)(186003)(6486002)(6512007)(52116002)(1076003)(86362001)(26005)(8936002)(2906002)(2616005)(30864003)(66946007)(4326008)(38100700002)(8676002)(6506007)(316002)(66476007)(66556008)(38350700002)(83380400001)(6916009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?UqVlQVeYBSBgjIjgqtGzIINuDHvlUtdBkhqdpht7W1WhNJvjwmMQp0/VKFTB?= =?us-ascii?Q?XrJ2yAsG8Gz0wId8uNdO5dmrHs/Rj0F3zt4XMab3rhceNjzEGa44Vhfxi+ZE?= =?us-ascii?Q?HYcjIKvo92FWvHNlTYHdpE3fk/yKssE4kQLyZUv+HM9+ztSSuzz95wsRguix?= =?us-ascii?Q?KxbcF8zIKUaZqmSay5u9MzC19noNw6iCXBPhxVhcyfseDpgxrw+InLaegPTi?= =?us-ascii?Q?3FxiyQTzY7jFt+6IIPmvTg8H98IZHqAF7jPkgLrSQfghjka5JwV2ue2WmMRV?= =?us-ascii?Q?UIZqH//uO5HmkpIs03iW0b4HbWaH1Y13BRH5egrs+SCSNt7Y9nRzO2cjxm6w?= =?us-ascii?Q?/97SSSvDuMq7b07e4ALbdzIEwrbgQ9cl+njU/NOGVYEg8jQJ/ltAr9BfGMm5?= =?us-ascii?Q?K9bR+J33uPkggcOYIPPYuXVoAPOAxzkCTYeNhhC2yNzu7ZrsESJuOHeqYlSl?= =?us-ascii?Q?no0yXVsHCgBcs/8GLGKpzEl4SXmgXdU960rSzUbreat0zgpf3WaARm6d3+2y?= =?us-ascii?Q?Nxj49R+dX46q09ahzlT0V2SBM5cuueaU/R06vgPzYz5YWWq7joyConCnNMgz?= =?us-ascii?Q?0OFQ25MgxkzdI5VSDo3jnLIc1BeZ2ZKuXttR6eMsqIM8I4jn4ElGZ9V1/cO4?= =?us-ascii?Q?LllIcFfTtNvN38ACAz281ex4i/R+nnibl0XwMtEvb/cA/KOo9LTThfBPpwBn?= =?us-ascii?Q?srh7mZ99lNIjAWO2NHbfXTz7tZs5rFxq5Na0IZTJQkwNX8zc834+VRDdK4O4?= =?us-ascii?Q?XAHpgj/Q55/5XAo4kveJIRkeuxqZq9nvEWb+CX6pkf5zoMAHIcpvtTrI2aHz?= =?us-ascii?Q?y/rlkiaWj6ChxzzPVOyeRlFZgSWZWuNjcj4RWqL/YT5aI055EWeLJO7A0ElG?= =?us-ascii?Q?y5EapPm84aVgZy5LAdHv0Dxiqzx7P36C6k9Fnf9yaWsK7+G7JYdVHJkezL8G?= =?us-ascii?Q?H4qg2gJSzvehwjK7YwEUjMLwFd2z7DkDIq1lvDtMQ1kRU4hJL184ZtRiTJJR?= =?us-ascii?Q?7xm11C3uY4fR57X+EIV1chYiZx7cLYYSrwA1RI5Burctg6EN0LUZtNgEBH6o?= =?us-ascii?Q?KRslUvkvL3FkL4QMzXu3E173txSMvK/FU97ZIsabbO23xNVHr5hZT3lnW9n6?= =?us-ascii?Q?YJbc/jVyGWerYM2t1yuWhhU37BI22uKNOaA60IJiqz+YQeyiOUnFOeIrpgO+?= =?us-ascii?Q?ofOOGcq6kCclhHYuVXSeLzAryQCbhuJu9Ef48bsCn9Rp+W3wZr+FL/hPQ7PF?= =?us-ascii?Q?xbX/qvevfIpupq8q6FK2mKsa32P1dtAW4Anm4GcBQJRJ0tZDquNg5MROX3nn?= =?us-ascii?Q?5QAeuyK83JAPtFf2eBPXYK/T4xDJwFuszzt4vLovdNfFFrNjh8WR2s6RBb8+?= =?us-ascii?Q?OVupmjUplCAKVVipxvdWfxVAWb9yzqHEhzhe+6o53iE6/9r5oY0i3LHjjlcQ?= =?us-ascii?Q?TjXSxIgKL56VhadpgzkEDRoUuS5ncRcls/WtlPO1gmqpdv4ODbmg0n3PPaY9?= =?us-ascii?Q?Ih4hv3oFli26sHJ9Zz4BbVy5WNiqfe7ubSqraZnv3txb5g0pu5z2sRZhU0DK?= =?us-ascii?Q?KC+aW+iCSqI2/Pdr9BQyzkAgXBRkkDiW3uaRlwsPqTfddf/89EEafv8EwX3C?= =?us-ascii?Q?ZQ=3D=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d9c75e5c-1b4c-4582-c8fa-08da5aa16aac X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5056.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jun 2022 14:04:15.3851 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: VoCm1R/4Tv579CrJBDiUZo5DW0flBwP9NdKGmmPYGSSNxoNrEVX9HE67SqbzQrhxC7/QLlMjZYXhpPlxVqRrd8x7fGFj7biLyLNlyleLIuI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR04MB9322 X-ZohoMail-DKIM: pass (identity @NXP1.onmicrosoft.com) X-ZM-MESSAGEID: 1656597971654100001 Content-Type: text/plain; charset="utf-8" From: Andrei Cherechesu Normally, the script would precompute the sizes of the loaded binaries and addresses where they are loaded before generating the script, and the sizes and addresses that needed to be provided to Xen via /chosen would be hardcoded in the boot script. Added option via "-s" parameter to use the ${filesize} variable in u-boot, which is set automatically after a *load command. The value stored by filesize is now stored in a u-boot env variable with the name corresponding to the binary that was loaded before. The newly set variables are now used in setting the /chosen node, instead of the hardcoded values. Also, the loading addresses for the files are dynamically computed and aligned to 0x200000 using the `setexpr` u-boot command. Basically, if the option is used, there are zero hardcoded addresses inside the boot script, and everything is determined based on the MEMORY_START parameter and each binary's size. If the "-s" parameter is not used, the script does not store the binaries' sizes and addresses in variables and uses the precomputed ones when advertising them in the /chosen node. Signed-off-by: Andrei Cherechesu --- scripts/uboot-script-gen | 136 ++++++++++++++++++++++++++++++++------- 1 file changed, 114 insertions(+), 22 deletions(-) diff --git a/scripts/uboot-script-gen b/scripts/uboot-script-gen index 8f08cd6..f8d2fb0 100755 --- a/scripts/uboot-script-gen +++ b/scripts/uboot-script-gen @@ -4,6 +4,9 @@ offset=3D$((2*1024*1024)) filesize=3D0 prog_req=3D(mkimage file fdtput mktemp awk) =20 +padding_mask=3D`printf "0x%X\n" $(($offset - 1))` +padding_mask_inv=3D`printf "0x%X\n" $((~$padding_mask))` + function cleanup_and_return_err() { rm -f $UBOOT_SOURCE $UBOOT_SCRIPT @@ -91,10 +94,18 @@ function add_device_tree_kernel() local size=3D$3 local bootargs=3D$4 =20 - dt_mknode "$path" "module$addr" - dt_set "$path/module$addr" "compatible" "str_a" "multiboot,kernel mult= iboot,module" - dt_set "$path/module$addr" "reg" "hex" "0x0 $addr 0x0 $(printf "0x%x"= $size)" - dt_set "$path/module$addr" "bootargs" "str" "$bootargs" + if test "$dynamic_loading_opt" + then + dt_mknode "$path" "module\${"$addr"}" + dt_set "$path/module\${"$addr"}" "compatible" "str_a" "multiboot,k= ernel multiboot,module" + dt_set "$path/module\${"$addr"}" "reg" "hex" "0x0 0x\${"$addr"} 0= x0 0x\${"$size"}" + dt_set "$path/module\${"$addr"}" "bootargs" "str" "$bootargs" + else + dt_mknode "$path" "module$addr" + dt_set "$path/module$addr" "compatible" "str_a" "multiboot,kernel = multiboot,module" + dt_set "$path/module$addr" "reg" "hex" "0x0 $addr 0x0 $(printf "0= x%x" $size)" + dt_set "$path/module$addr" "bootargs" "str" "$bootargs" + fi } =20 =20 @@ -104,9 +115,16 @@ function add_device_tree_ramdisk() local addr=3D$2 local size=3D$3 =20 - dt_mknode "$path" "module$addr" - dt_set "$path/module$addr" "compatible" "str_a" "multiboot,ramdisk mul= tiboot,module" - dt_set "$path/module$addr" "reg" "hex" "0x0 $addr 0x0 $(printf "0x%x"= $size)" + if test "$dynamic_loading_opt" + then + dt_mknode "$path" "module\${"$addr"}" + dt_set "$path/module\${"$addr"}" "compatible" "str_a" "multiboot,r= amdisk multiboot,module" + dt_set "$path/module\${"$addr"}" "reg" "hex" "0x0 0x\${"$addr"} 0= x0 0x\${"$size"}" + else + dt_mknode "$path" "module$addr" + dt_set "$path/module$addr" "compatible" "str_a" "multiboot,ramdisk= multiboot,module" + dt_set "$path/module$addr" "reg" "hex" "0x0 $addr 0x0 $(printf "0= x%x" $size)" + fi } =20 =20 @@ -116,9 +134,16 @@ function add_device_tree_passthrough() local addr=3D$2 local size=3D$3 =20 - dt_mknode "$path" "module$addr" - dt_set "$path/module$addr" "compatible" "str_a" "multiboot,device-tree= multiboot,module" - dt_set "$path/module$addr" "reg" "hex" "0x0 $addr 0x0 $(printf "0x%x"= $size)" + if test "$dynamic_loading_opt" + then + dt_mknode "$path" "module\${"$addr"}" + dt_set "$path/module\${"$addr"}" "compatible" "str_a" "multiboot,d= evice-tree multiboot,module" + dt_set "$path/module\${"$addr"}" "reg" "hex" "0x0 0x\${"$addr"} 0= x0 0x\${"$size"}" + else + dt_mknode "$path" "module$addr" + dt_set "$path/module$addr" "compatible" "str_a" "multiboot,device-= tree multiboot,module" + dt_set "$path/module$addr" "reg" "hex" "0x0 $addr 0x0 $(printf "0= x%x" $size)" + fi } =20 function add_device_tree_mem() @@ -186,7 +211,12 @@ function xen_device_tree_editing() then dt_mknode "/chosen" "dom0" dt_set "/chosen/dom0" "compatible" "str_a" "xen,linux-zimage xen,m= ultiboot-module multiboot,module" - dt_set "/chosen/dom0" "reg" "hex" "0x0 $dom0_kernel_addr 0x0 $(pri= ntf "0x%x" $dom0_kernel_size)" + if test "$dynamic_loading_opt" + then + dt_set "/chosen/dom0" "reg" "hex" "0x0 0x\${dom0_linux_addr} 0= x0 0x\${dom0_linux_size}" + else + dt_set "/chosen/dom0" "reg" "hex" "0x0 $dom0_kernel_addr 0x0 $= (printf "0x%x" $dom0_kernel_size)" + fi dt_set "/chosen" "xen,dom0-bootargs" "str" "$DOM0_CMD" fi =20 @@ -194,7 +224,12 @@ function xen_device_tree_editing() then dt_mknode "/chosen" "dom0-ramdisk" dt_set "/chosen/dom0-ramdisk" "compatible" "str_a" "xen,linux-init= rd xen,multiboot-module multiboot,module" - dt_set "/chosen/dom0-ramdisk" "reg" "hex" "0x0 $ramdisk_addr 0x0 $= (printf "0x%x" $ramdisk_size)" + if test "$dynamic_loading_opt" + then + dt_set "/chosen/dom0-ramdisk" "reg" "hex" "0x0 0x\${dom0_ramdi= sk_addr} 0x0 0x\${dom0_ramdisk_size}" + else + dt_set "/chosen/dom0-ramdisk" "reg" "hex" "0x0 $ramdisk_addr 0= x0 $(printf "0x%x" $ramdisk_size)" + fi fi =20 i=3D0 @@ -241,14 +276,29 @@ function xen_device_tree_editing() dt_set "/chosen/domU$i" "colors" "hex" "$(printf "0x%x" $bitco= lors)" fi =20 - add_device_tree_kernel "/chosen/domU$i" ${domU_kernel_addr[$i]} ${= domU_kernel_size[$i]} "${DOMU_CMD[$i]}" + if test "$dynamic_loading_opt" + then + add_device_tree_kernel "/chosen/domU$i" "domU${i}_kernel_addr"= "domU${i}_kernel_size" "${DOMU_CMD[$i]}" + else + add_device_tree_kernel "/chosen/domU$i" ${domU_kernel_addr[$i]= } ${domU_kernel_size[$i]} "${DOMU_CMD[$i]}" + fi if test "${domU_ramdisk_addr[$i]}" then - add_device_tree_ramdisk "/chosen/domU$i" ${domU_ramdisk_addr[$= i]} ${domU_ramdisk_size[$i]} + if test "$dynamic_loading_opt" + then + add_device_tree_ramdisk "/chosen/domU$i" "domU${i}_ramdisk= _addr" "domU${i}_ramdisk_size" + else + add_device_tree_ramdisk "/chosen/domU$i" ${domU_ramdisk_ad= dr[$i]} ${domU_ramdisk_size[$i]} + fi fi if test "${domU_passthrough_dtb_addr[$i]}" then - add_device_tree_passthrough "/chosen/domU$i" ${domU_passthroug= h_dtb_addr[$i]} ${domU_passthrough_dtb_size[$i]} + if test "$dynamic_loading_opt" + then + add_device_tree_passthrough "/chosen/domU$i" "domU${i}_fdt= _addr" "domU${i}_fdt_size" + else + add_device_tree_passthrough "/chosen/domU$i" ${domU_passth= rough_dtb_addr[$i]} ${domU_passthrough_dtb_size[$i]} + fi fi i=3D$(( $i + 1 )) done @@ -271,7 +321,12 @@ function device_tree_editing() =20 if test $UBOOT_SOURCE then - echo "fdt addr $device_tree_addr" >> $UBOOT_SOURCE + if test $dynamic_loading_opt + then + echo "fdt addr \${host_fdt_addr}" >> $UBOOT_SOURCE + else + echo "fdt addr $device_tree_addr" >> $UBOOT_SOURCE + fi echo "fdt resize 1024" >> $UBOOT_SOURCE =20 if test $NUM_DT_OVERLAY && test $NUM_DT_OVERLAY -gt 0 @@ -306,7 +361,7 @@ function add_size() function load_file() { local filename=3D$1 - local fit_scr_name=3D$2 + local binary_name=3D$2 =20 local absolute_path=3D"$(realpath --no-symlinks $filename)" local base=3D"$(realpath $PWD)"/ @@ -314,11 +369,30 @@ function load_file() =20 if test "$FIT" then - echo "imxtract \$fit_addr $fit_scr_name $memaddr" >> $UBOOT_SOURCE + echo "imxtract \$fit_addr $binary_name $memaddr" >> $UBOOT_SOURCE else - echo "$LOAD_CMD $memaddr ${prepend_path:+$prepend_path/}$relative_= path" >> $UBOOT_SOURCE + if test "$dynamic_loading_opt" + then + echo "$LOAD_CMD \${curr_addr} ${prepend_path:+$prepend_path/}$= relative_path" >> $UBOOT_SOURCE + else + echo "$LOAD_CMD $memaddr ${prepend_path:+$prepend_path/}$relat= ive_path" >> $UBOOT_SOURCE + fi fi add_size $filename + + if test "$dynamic_loading_opt" && test ! "$FIT" + then + # Store each binary's load addr and size + local binary_name_addr=3D"${binary_name}_addr" + local binary_name_size=3D"${binary_name}_size" + echo "setenv $binary_name_addr \${curr_addr}" >> $UBOOT_SOURCE + echo "setenv $binary_name_size \${filesize}" >> $UBOOT_SOURCE + =20 + # Compute load addr for next binary dynamically + echo "setexpr curr_addr \${curr_addr} \+ \${filesize}" >> $UBOOT_S= OURCE + echo "setexpr curr_addr \${curr_addr} \+ \${padding_mask}" >> $UBO= OT_SOURCE + echo "setexpr curr_addr \${curr_addr} \& \${padding_mask_inv}" >> = $UBOOT_SOURCE + fi } =20 function check_file_type() @@ -536,6 +610,14 @@ generate_uboot_images() =20 xen_file_loading() { + if test "$dynamic_loading_opt" + then + local curr_addr=3D`printf "%x\n" $memaddr` + echo "setenv curr_addr $curr_addr" >> $UBOOT_SOURCE + echo "setenv padding_mask $padding_mask" >> $UBOOT_SOURCE + echo "setenv padding_mask_inv $padding_mask_inv" >> $UBOOT_SOURCE + fi + if test "$DOM0_KERNEL" then check_compressed_file_type $DOM0_KERNEL "executable" @@ -891,7 +973,7 @@ function print_help { script=3D`basename "$0"` echo "usage:" - echo " $script -c CONFIG_FILE -d DIRECTORY [-t LOAD_CMD] [-o FILE] [-k= KEY_DIR/HINT [-u U-BOOT_DTB]] [-e] [-f] [-p PREPEND_PATH]" + echo " $script -c CONFIG_FILE -d DIRECTORY [-t LOAD_CMD] [-o FILE] [-k= KEY_DIR/HINT [-u U-BOOT_DTB]] [-e] [-f] [-p PREPEND_PATH] [-s]" echo " $script -h" echo "where:" echo " CONFIG_FILE - configuration file" @@ -908,6 +990,7 @@ function print_help echo " U-BOOT_DTB - u-boot control dtb so that the public key gets add= ed to it" echo " -f - enable generating a FIT image" echo " PREPEND_PATH - path to be appended before file names to match d= eploy location within rootfs" + echo " -s - enable dynamic loading of binaries by storing their addres= ses and sizes u-boot env variables" echo " -h - prints out the help message and exits " echo "Defaults:" echo " CONFIG_FILE=3D$cfg_file, UBOOT_TYPE=3D\"LOAD_CMD\" env var, DIR= ECTORY=3D$uboot_dir" @@ -915,7 +998,7 @@ function print_help echo " $script -c ../config -d ./build42 -t \"scsi load 1:1\"" } =20 -while getopts ":c:t:d:ho:k:u:fp:" opt; do +while getopts ":c:t:d:ho:k:u:fp:s" opt; do case ${opt} in t ) case $OPTARG in @@ -957,6 +1040,9 @@ while getopts ":c:t:d:ho:k:u:fp:" opt; do p ) prepend_path=3D"$OPTARG" ;; + s ) + dynamic_loading_opt=3Dy + ;; h ) print_help exit 0 @@ -1151,7 +1237,13 @@ device_tree_editing $device_tree_addr =20 # disable device tree reloation echo "setenv fdt_high 0xffffffffffffffff" >> $UBOOT_SOURCE -echo "$BOOT_CMD $kernel_addr - $device_tree_addr" >> $UBOOT_SOURCE + +if test "$dynamic_loading_opt" +then + echo "$BOOT_CMD \${host_kernel_addr} - \${host_fdt_addr}" >> $UBOOT_SO= URCE +else + echo "$BOOT_CMD $kernel_addr - $device_tree_addr" >> $UBOOT_SOURCE +fi =20 if test "$FIT" then --=20 2.35.1 From nobody Tue Apr 30 17:00:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=oss.nxp.com); dmarc=fail(p=none dis=none) header.from=oss.nxp.com ARC-Seal: i=2; a=rsa-sha256; t=1656597951; cv=pass; d=zohomail.com; s=zohoarc; b=SdbTbNHkzqPiuWVpY8Xru/8ce8ybGStWZNobYno762j46uCfL4oElBFpo/sHQF+RoWA8rytEAUow5J2uOYoXK1d5Pt3W8yLiDiG+bUjSnZGmT7osTS89ARmbNgoJA6wmAkRjlT+1h4od8dG24vSTHHjkJ02UJN+spnAq1LS1osc= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1656597951; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=slRq7QSM4ixKn2x0tNbd2VGZDBfK2EupasNiNNU+x2c=; b=L3jJfu5B6zYqgNMyVfd0enRCx1LsalHYxtVnnoXIX0g6Nw9I04VxAUjHzn01WKK162q3LxL9paTujYH+KBhenkSMG7DDxmr5Fv1RC7iUGFPsH61xiyOfJRSZ3O5uqAUkE3rSDb6VNT7/PGcGCTl935bZvV4iha66Aw1zBv2hKEM= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=oss.nxp.com); dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1656597951021951.1729347059014; Thu, 30 Jun 2022 07:05:51 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.358513.587779 (Exim 4.92) (envelope-from ) id 1o6umr-0004hB-Pu; Thu, 30 Jun 2022 14:04:53 +0000 Received: by outflank-mailman (output) from mailman id 358513.587779; Thu, 30 Jun 2022 14:04:53 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1o6umr-0004fP-Jc; Thu, 30 Jun 2022 14:04:53 +0000 Received: by outflank-mailman (input) for mailman id 358513; Thu, 30 Jun 2022 14:04:20 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1o6umK-0004O6-9U for xen-devel@lists.xenproject.org; Thu, 30 Jun 2022 14:04:20 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70059.outbound.protection.outlook.com [40.107.7.59]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 8398080f-f87d-11ec-bdce-3d151da133c5; Thu, 30 Jun 2022 16:04:10 +0200 (CEST) Received: from VI1PR04MB5056.eurprd04.prod.outlook.com (2603:10a6:803:5a::13) by DU0PR04MB9322.eurprd04.prod.outlook.com (2603:10a6:10:355::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5373.18; Thu, 30 Jun 2022 14:04:16 +0000 Received: from VI1PR04MB5056.eurprd04.prod.outlook.com ([fe80::1549:6f15:1949:f1a5]) by VI1PR04MB5056.eurprd04.prod.outlook.com ([fe80::1549:6f15:1949:f1a5%6]) with mapi id 15.20.5395.015; Thu, 30 Jun 2022 14:04:16 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 8398080f-f87d-11ec-bdce-3d151da133c5 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N28HQzeyfEkoXNgIyh6g3bG4X1wzaLamMZwAcohnVXQ76Q/PKm2TxVyE8p9EpQPr3hhSudVf2+RWX9J1U7cZ96DSdVO21i5R8Jc19xbTBGZvmaTL4qJK/pbNMC1YfxyDHTKDdCyNsqu5oWpqp8OeWNz33V5b0L+olVnT+3o0eHc1DrP2aGopaU2NzL6DA9xmq7QAYTcLLPWho/QU6gaZmBdsDhHZfMolcIywrZefEGbqsAzGbv69NaWZBLzgQRDhixk/HpKWZRZUc8xndf1L+KsX6L3LKaoi/7bKLJbCmlrZF1l7GSdkHzJz9ARXi7p0O//TRFAeYV4DbZshQAhgiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=slRq7QSM4ixKn2x0tNbd2VGZDBfK2EupasNiNNU+x2c=; b=nkBLdNbmNoyQ3V0LM2eNHDA8otlqnWNCEGLxyU09082a7HtXThmCqyQTilYT+WarAbuJbupVsN1yqDGSeg83bvJAinKmxm1XeIkJgp9Gv4buU4EMWFMANG8bHNiodEPpU3nJZT7oUPAKaqzFQ63dlbJbqm3bZkYpuaCQtQ2ZI2VU3zHaRZx9ffW69VbL1EXR4xb4sK9h3pJ+4nMxcLAATF3+OF3Iu+84eTIhyCJYSyoL9rUW4V38hgQV/rqB0zHUVQQFXCn+0i7uD5o7qBRwRVeDg2QxuA6UJ5dv8xQNX6hgMmUy5VGRHSwnRXsCsWuTcXvZ5vDOj0XGeLBR/eqTeA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=slRq7QSM4ixKn2x0tNbd2VGZDBfK2EupasNiNNU+x2c=; b=KqRcy4Z6BEh5Ei+OsiD3dQNyV5WK6l2weeqhYIlP4UknJm5B1EF5KFj3mwvj30nSkBg4fRGl20g5BQdsRVXWa/fuEOdcy7HaTRt+99SATXSA/V8BkHQwgzPPxioGLQokrzsLelZyfVCt1aY4OU7a8R7Vg2nVTmz3D29SsCymI5Y= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; From: "Andrei Cherechesu (OSS)" To: xen-devel@lists.xenproject.org Cc: viryaos-discuss@lists.sourceforge.net, sstabellini@kernel.org, Andrei Cherechesu Subject: [ImageBuilder][PATCH v2 3/4] uboot-script-gen: Enable appending extra commands to boot script Date: Thu, 30 Jun 2022 17:00:28 +0300 Message-Id: <20220630140028.3227385-4-andrei.cherechesu@oss.nxp.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220630140028.3227385-1-andrei.cherechesu@oss.nxp.com> References: <20220630140028.3227385-1-andrei.cherechesu@oss.nxp.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: AM0PR03CA0089.eurprd03.prod.outlook.com (2603:10a6:208:69::30) To VI1PR04MB5056.eurprd04.prod.outlook.com (2603:10a6:803:5a::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3acbee7f-13ba-46e9-6d00-08da5aa16b77 X-MS-TrafficTypeDiagnostic: DU0PR04MB9322:EE_ X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8hu0YU/b5vU/Au3Dw7O9H3DsUtx/yMPpoUQUu7/TS2HaVc6vxDmJVL2EbGtmNSglIRVSTJmr4WfBp8KbpOYuFs7SmHJ7J3EeDzxFnHxcOcaVW3QVBKltR9fvH0JHaErKhRpIYJU/7voixjiTZhr5b7gWM58OkTQd2uXznnt7bYAEAxAbl3qkRxJZA9GxOsX5biCKWn6RbpQUBLSZBJ5ABa6KiUwj6kqcEA18wppzAWT+l7E9GYJls9+nRLmQH6+albhqB4vE1bEE7JSUvIeaSPQVOk7Ydj/qJRgzzQ4Y4w4+LfkqMIhtrHc3wu0lkKlq35t8I/s3u7dpYJHT3FrkqiSHGJsmSDC1B5I6em2eLQZKj4E/cDRqFRQTSP7eKCDYfOjHkfaXq5i8tP+bWvVcOXOuDZenil25vLW5q7NYffBVrH5Y00ANE9vd5HbQ28ALfblZTPyKAzp/wHT7lOfP+m/GBQrDw+Zx3FSbtVb72S0KLb/AWGWeHfxz1EiDPES1X+CuNbrDpCDzQ68TqYOpDj1oc6RkLrZHXWy/WXYqOwlcrC0Wr0YbMxTfoK31gav4TCT+91TZKE6aPbk3aoUSxFsUzhMdAT8T+jbRUUCOJ3nf4kTiAmZqjCS+mipVlPNa9LdqkK4g7SmxJl2on3cm+D4MktG65DjuzDrnnHY2XQUNMO0ktLVlaBXhfsI2MlE06HGoph+bJVLnrY/5JZWX5SJuFF6uUFU6/5PNM5Vikayba2jh95V/NC21B2zIWz7hQzQxK1lGMNe3AIGyO2VCOzXRSEFYf7wCQ8kl7mvFWvmhaj4w1Lkg4c23pLy20TZ2 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5056.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(346002)(366004)(136003)(396003)(39860400002)(376002)(478600001)(41300700001)(5660300002)(6666004)(186003)(6486002)(6512007)(52116002)(1076003)(86362001)(26005)(8936002)(2906002)(2616005)(66946007)(4326008)(38100700002)(8676002)(6506007)(316002)(66476007)(66556008)(38350700002)(83380400001)(6916009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?tOqvql/MD4ejQ4kO7mo54xgh9ZR7tORA7n1HzA+7Kjzk+vWBcQopMhSvOPsZ?= =?us-ascii?Q?2Q1Atdo/vQx2ZXhBRwoTMKRN/KPtuRaE+LPnJc8qI9UcsJkT17WBeuJ2tf2f?= =?us-ascii?Q?YxUt46KlEHTeTfFvFKmSBNyeBB1VRSvZbscHdReKMBw9Zm6e6bqhuFZitFeN?= =?us-ascii?Q?FfoSSekMwY4qx9MbAv8U7UZGz86ZHdUc2XjBD60ixXKpoQtksxp39JLZ/qkO?= =?us-ascii?Q?Y78dYOeet4Oalyu+kIcI8K2M2ZdKY98eevpMc7q9z8UIsfPUHmbcrzlBqSTQ?= =?us-ascii?Q?mBOP6odYYJNURjsUBhw5KQi8rEDDG/R1aaVcWNdOMAsr1x8r8gjBZkD1cUxO?= =?us-ascii?Q?LWu/UTW5BkmJ0qVEvpROO12/D5pT3WSA1DyjLYpxRIBk3Ykkmq7wYbqs42sU?= =?us-ascii?Q?kj2VdYgQbyJ7fhfkKi/CrNSo29czF0Qi1p7+kuOO/gyimlolicrvg2f0LR/4?= =?us-ascii?Q?8EGh/UX4VTH/AD2O9BxOl/MZqvTqJ6G0rfphuCvc477kVGWTZiuvcus4slLT?= =?us-ascii?Q?yUWGGRQigviByUI61GwQvRMyxWT7BF4EkG1ia+FnsdzRNh2/75WkOfCRWX1w?= =?us-ascii?Q?tP7fzl7YZHeTGBntZIW0W1rDiGk/z7GPIRTPqD+ctg//7pUZS73f1ZAJFgl/?= =?us-ascii?Q?Q1Ycr+ZHHtxaWdMd91ceq4c5vbgtwTQg9Jee8KRC7W3lJsk2cnqIYIR8P8mW?= =?us-ascii?Q?4kP+qABetjiltYOL7Vp1bLp3PmuHJq7YzoDp6n/23PbjVJ0+zQZhwpsUsdvN?= =?us-ascii?Q?wh7rlNVoELA3KRZWIIk9b+MyMB4KTyIJ7BOvFgPhv1V7Qk/GtFCKCxllLeJI?= =?us-ascii?Q?u55eDP9o33NjKC0Sucj9XNa64RygyesoHCwkhiW94Uot4apJVXo9cNMUReyq?= =?us-ascii?Q?YH4FiZGnQ/yYIvXT1KNtgQ0eKFt+GjSN4UKbLGbAlDn2jMucVF6CnMXH40E5?= =?us-ascii?Q?D4FVN8QZI1BKElWA4bKDKlEvfTAhQlOQ+99wYE05Unnn+Fml0ecAq32nArRf?= =?us-ascii?Q?HVocK0IwCp7URTYd63syUs0Yy1gHC3JSB6dqZcysEeCYgSPFNrTQAXhjR8tJ?= =?us-ascii?Q?Vv/NSCr6MobaI4iXVAcVXY8Iescot7ETM2WhMOkF5Ml4nAJYRdRrbW0tB07U?= =?us-ascii?Q?GVy59pDLrusq0HE1iRQzHHvGhdXKoYR4FOAVXdkvtAA8DkEtrWRzREdOAArm?= =?us-ascii?Q?s7DkXhNaKZmyxYH28v9Uw3HFQH4fKsIjapJV2kQTBrB07oZhd47z7Ynms4lk?= =?us-ascii?Q?oQY8zwaZ0TIhxDbVifU0Z+Sh45TgRJ6YcMeYgQpGARJNomLanWGs4/musL2b?= =?us-ascii?Q?htyfN3nP6dtyiTOHApCc7YEbHe50mqUHPgyiS/csu4XoiEkx8rzOiwWINa/c?= =?us-ascii?Q?slZoAvogKBRAJn57VQsONeRNFLSIOfrUoHtPZbcnWmw3REtmzQzXjXi4qo8o?= =?us-ascii?Q?iSfYMjKtgi82ATihtxPzFx4qyz615f8O0OQ6mSE1ViGorerg3i+2yFduFc3c?= =?us-ascii?Q?lhBDbOu+VyjZWph1azu2mTh8eRFBwjvfKTaiyYc81IAL7xLpaWrwbNphCmo8?= =?us-ascii?Q?qhk5g4D7CZC4boemWWwoKbmE5FIRK8Bk8CprNJ0yZY4Q0xvPgUCDsb5AKoTS?= =?us-ascii?Q?rg=3D=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3acbee7f-13ba-46e9-6d00-08da5aa16b77 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5056.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jun 2022 14:04:16.7132 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 7ACarorNNtrjb3ap2HLw+RmQDTul/TZbMMNGeyHQS2j8KwlE5RZR9ONyJ5qxnsTPJbo2nOui4rgbjN1cEZcDyVWi1PApoNKHu/guKoTyyfM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR04MB9322 X-ZohoMail-DKIM: pass (identity @NXP1.onmicrosoft.com) X-ZM-MESSAGEID: 1656597953310100001 Content-Type: text/plain; charset="utf-8" From: Andrei Cherechesu Added the "-a" parameter which stands for APPEND_EXTRA_CMDS option, which enables the user to specify the path to a text file that contains, on each line, u-boot commands that will be added to the generated script as "fixups", before the boot command. The file specified via the "-a" parameter will be copied as-is in the generated script. Signed-off-by: Andrei Cherechesu --- scripts/uboot-script-gen | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/scripts/uboot-script-gen b/scripts/uboot-script-gen index f8d2fb0..444c65a 100755 --- a/scripts/uboot-script-gen +++ b/scripts/uboot-script-gen @@ -416,6 +416,10 @@ function check_file_type() elif [ "$type" =3D "Device Tree Blob" ] then type=3D"Device Tree Blob\|data" + + elif [ "$type" =3D "text" ] + then + type=3D"ASCII text" fi =20 file -L $filename | grep "$type" &> /dev/null @@ -973,7 +977,7 @@ function print_help { script=3D`basename "$0"` echo "usage:" - echo " $script -c CONFIG_FILE -d DIRECTORY [-t LOAD_CMD] [-o FILE] [-k= KEY_DIR/HINT [-u U-BOOT_DTB]] [-e] [-f] [-p PREPEND_PATH] [-s]" + echo " $script -c CONFIG_FILE -d DIRECTORY [-t LOAD_CMD] [-o FILE] [-k= KEY_DIR/HINT [-u U-BOOT_DTB]] [-e] [-f] [-p PREPEND_PATH] [-s] [-a APPEND_= EXTRA_CMDS]" echo " $script -h" echo "where:" echo " CONFIG_FILE - configuration file" @@ -991,6 +995,7 @@ function print_help echo " -f - enable generating a FIT image" echo " PREPEND_PATH - path to be appended before file names to match d= eploy location within rootfs" echo " -s - enable dynamic loading of binaries by storing their addres= ses and sizes u-boot env variables" + echo " APPEND_EXTRA_CMDS - absolute path to file containing extra u-bo= ot cmds (fixups) to be run before booting" echo " -h - prints out the help message and exits " echo "Defaults:" echo " CONFIG_FILE=3D$cfg_file, UBOOT_TYPE=3D\"LOAD_CMD\" env var, DIR= ECTORY=3D$uboot_dir" @@ -998,7 +1003,7 @@ function print_help echo " $script -c ../config -d ./build42 -t \"scsi load 1:1\"" } =20 -while getopts ":c:t:d:ho:k:u:fp:s" opt; do +while getopts ":c:t:d:ho:k:u:fp:sa:" opt; do case ${opt} in t ) case $OPTARG in @@ -1043,6 +1048,9 @@ while getopts ":c:t:d:ho:k:u:fp:s" opt; do s ) dynamic_loading_opt=3Dy ;; + a ) + extra_cmds_file=3D$OPTARG + ;; h ) print_help exit 0 @@ -1235,6 +1243,13 @@ load_file $DEVICE_TREE "host_fdt" bitstream_load_and_config # bitstream is loaded last but used first device_tree_editing $device_tree_addr =20 +# append extra u-boot commands (fixups) to script before boot command +if test "$extra_cmds_file" +then + check_file_type "$extra_cmds_file" "text" + cat $extra_cmds_file >> $UBOOT_SOURCE +fi + # disable device tree reloation echo "setenv fdt_high 0xffffffffffffffff" >> $UBOOT_SOURCE =20 --=20 2.35.1 From nobody Tue Apr 30 17:00:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=oss.nxp.com); dmarc=fail(p=none dis=none) header.from=oss.nxp.com ARC-Seal: i=2; a=rsa-sha256; t=1656597956; cv=pass; d=zohomail.com; s=zohoarc; b=dey78zL+ZROtWwcluixv9ILHyd1eeRnwWsTRI7Qjq2+7x+AcnUBL7BIPPKJy7CAmmAeXgGeq+W3B7Z6naM7Yvnn/yRIxqIPRhfLUtSVfM+9frv8g25JLdleqCTHx4z4sH7NFiAAuNqqGwxb/VC705Wtnop7CWXIPng01cwa8eZA= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1656597956; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=IEOir/TcWxDepJgogJp+rLWOzXH0RRWLH/R0bAwSxes=; b=Y/4HD9nyCa49lQkSAIhMWZHQh/1RtpVQPdqZKCD8C17psqf18ACOM9P7XIjFJKcRNP32foVDwbvi24rkyBXqGHiPhKi/6bn8Mfv95QcIcK0KDyEGfSDzSPatyctdUs0zMgLlFh/shsi/nKAyrr29mvIuS0v/B97sj7gs+FBVv0g= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=oss.nxp.com); dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1656597956018351.1349395769781; Thu, 30 Jun 2022 07:05:56 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.358515.587784 (Exim 4.92) (envelope-from ) id 1o6ums-0004pm-3o; Thu, 30 Jun 2022 14:04:54 +0000 Received: by outflank-mailman (output) from mailman id 358515.587784; Thu, 30 Jun 2022 14:04:54 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1o6umr-0004nh-Ti; Thu, 30 Jun 2022 14:04:53 +0000 Received: by outflank-mailman (input) for mailman id 358515; Thu, 30 Jun 2022 14:04:21 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1o6umL-0004O6-5X for xen-devel@lists.xenproject.org; Thu, 30 Jun 2022 14:04:21 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70057.outbound.protection.outlook.com [40.107.7.57]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 845c74a2-f87d-11ec-bdce-3d151da133c5; Thu, 30 Jun 2022 16:04:12 +0200 (CEST) Received: from VI1PR04MB5056.eurprd04.prod.outlook.com (2603:10a6:803:5a::13) by DU0PR04MB9322.eurprd04.prod.outlook.com (2603:10a6:10:355::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5373.18; Thu, 30 Jun 2022 14:04:18 +0000 Received: from VI1PR04MB5056.eurprd04.prod.outlook.com ([fe80::1549:6f15:1949:f1a5]) by VI1PR04MB5056.eurprd04.prod.outlook.com ([fe80::1549:6f15:1949:f1a5%6]) with mapi id 15.20.5395.015; Thu, 30 Jun 2022 14:04:18 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 845c74a2-f87d-11ec-bdce-3d151da133c5 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iaNeOhHqZRiDSLBjIYipfklZW9Ie3cfyB6qlqKLAY9+osIwNHCX2Z4oV6garVDFhCFPTZDj9Jc8/bBI3F4JhMwB9QVg/LjHaA06d+/gw2Pl/UlyKemZfw8O2EKruZGpH+oUVhIyWZCA0mxVGdn9nPqnu+b0P3Rx6+PvsQ3gA4ve3oDVj2bASEReS9W/lHB1IUihBAkM9tS3J1v2u41U8mJIyMaV69LySbl3BWiQeGS2Ww0ns6NdudVumlR454V61FW4wc9oicKlgSp698atFQntRKlyg2/9r8SPwuVGgmL7DO9FQmwEBq/AbVfzkUbYVNOOZwHfar0Dl6eOWlncifg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=IEOir/TcWxDepJgogJp+rLWOzXH0RRWLH/R0bAwSxes=; b=Y3Gd2hQrS94vwh16oJ2N70W43LWmaZtdvJKE2Zt2VcuxgbRYqMxnzMu0TSdDgPoUshpeRFDTp1fWXCll9q2BwXXwyVk03PPQ6Cu/Z4ucfbEgQZNJBMQ+Bw0HKSi9qcFKdffbDtDBoHn5cIjmhHtkygrGytwYwm7fj/Z9CJ1rtcFJ15nVr+oCeNVMprMZXXkCgOyYvMyNISLOtC+M36qNO8mOxUn2wqYszwkF1udHbPw6t1iBLmLYzaI6AepV+FH1FMpqvGbfzw98amyrLPTw13fafU3CrBn4Wk88Tmm3ZujTZEs1oXm3K+Fw5TYsix74/ALQuGK+Pp5paGE3k8Eh7Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IEOir/TcWxDepJgogJp+rLWOzXH0RRWLH/R0bAwSxes=; b=Z4ij3h4QhH+o8FEfpit/cKJUDNqRo4BGo6jBHrPyoDNLC6on4wf1xChSgB7itEzIvKd9uLcFIvWP+26hflWlmB+4UEyl3q5mMaaNUc0E9wstB/kaL7bwKsN6jSMqp3+4QAzXQ9Uz1roOo1Hcv5jLBNZ4ClD6Wn2FIcmuSFx4qGQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; From: "Andrei Cherechesu (OSS)" To: xen-devel@lists.xenproject.org Cc: viryaos-discuss@lists.sourceforge.net, sstabellini@kernel.org, Andrei Cherechesu Subject: [ImageBuilder][PATCH v2 4/4] uboot-script-gen: Enable not adding boot command to script Date: Thu, 30 Jun 2022 17:00:29 +0300 Message-Id: <20220630140028.3227385-5-andrei.cherechesu@oss.nxp.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220630140028.3227385-1-andrei.cherechesu@oss.nxp.com> References: <20220630140028.3227385-1-andrei.cherechesu@oss.nxp.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: AM0PR03CA0089.eurprd03.prod.outlook.com (2603:10a6:208:69::30) To VI1PR04MB5056.eurprd04.prod.outlook.com (2603:10a6:803:5a::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 91ed6371-c465-42ee-1f5a-08da5aa16c93 X-MS-TrafficTypeDiagnostic: DU0PR04MB9322:EE_ X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2R0yvQkVV0ZbmP+qQBWaoy+eo1ecg8F5/ZC0MyL1ZxXepCy83RY8kHeCzfOSoQR52FNG+xrOJH3ls4Adbnq8GYOGXJN1+DkvK689YcJSbzGkfbvvpxrFhg6oYqWnWhBKe/0L/+C+OfH9S7ycSK2BHClF5pxACUeljsI3JgVc6duED8+upYjopZfJ7KiZ/KsVCgMzVHwDBbxM6cMNRudm73qrv8SCyzpIkl2paCPNMhea44pivSRFfMA03c39VJKB2PL+zYWKCkZ2EC9PSJ5xxpOBW2i1R7Y0f8VRfcivwhNfuQQ+ynivlqPVF1x8r69skFcOWZX72iEAFf3wbZJomta0H/KbenL3YezO1BcUmo/6J//E8beFlpAl1k4sz1df2Ewa+pjIZizdiVzUACenrVcjKVPp9/EmwlUlE0erhzQh3rm6o57xSi22aiZEwoPL3Bq08qFB5w+cZnCKV0xkIvycc+YoAh0UgQsO9he9VVJlEaUEMRNK9//w9wNAkqWNo22LRyyBjbpCImNcuJiEED778/uyAAO5j1yrBbx+Ov7/RrUy/DJFwsNsRNOi6vLai5M/j+BfpZRY3BGY0UxSP9u78YWMU4IxkTxIaOpxeiS3VXL/x5UQBRrSDOTWmuaLTXDAe+wpDGMsALhbQ7KqettF2OprRgZskZqZsEXGRaxlzRcMtgz/oSZ95SNFpwnPDAe85vHR2RnSsvAKPToDp4sAyx6+SFaO34gwz6nM06U7Nzjuvs3Fh0VVZYMdz919h+Pqp1a+MIXIMgYz+cH6y2kSasO7mHQ9xBd/uCmO7Y/jCcY6PUdKQ0BDDZveI9x9 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5056.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(346002)(366004)(136003)(396003)(39860400002)(376002)(478600001)(41300700001)(5660300002)(6666004)(186003)(6486002)(6512007)(52116002)(1076003)(86362001)(26005)(8936002)(2906002)(2616005)(66946007)(4326008)(38100700002)(8676002)(6506007)(316002)(66476007)(66556008)(38350700002)(83380400001)(6916009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?LsaCxl+YMIsKgAg1h9c7B4CTIvi+WIDV/juo2j+mf04+HNBfGNa75fFtUkAa?= =?us-ascii?Q?DadxhNl+NTWCNRPX1trj8/VIQRypK38xVKtcrDnJI2I9bydO9veYf7XtvT8C?= =?us-ascii?Q?a9jgs/vtXS5o8V9lGUcM85H0h4U2FCCdmjHJ5AihbtIqviRxXICppYyqP0XE?= =?us-ascii?Q?anWu921kndKGTXFOIkDBxW3YT7csh7OiTxltvjVHksR8NuDPhPoAnmqwatVD?= =?us-ascii?Q?0D9sjJy+qjLCBjbWl/QUshgQc79kGYO9S1Fl11fjEDaGPTKCw0fnsL5h9Oxv?= =?us-ascii?Q?e3M+pb6HewoP2m89fb3YOwulmSDLHvlBgKU6fL8J/nM2TTXbuL7X0BckCrbz?= =?us-ascii?Q?ReT5isJqfs1bj/KvqPHqYkt4DtPuzBb20itLXyjb4P0b+8d64c4Pb1iBK/yk?= =?us-ascii?Q?F1pu1hqxf+en04Vv5BTNrf7wU14Wo5FGOtxyJeb4SKxX4QWvApHfqFCr8V/4?= =?us-ascii?Q?aJTXsg628vMokulEsUfSXnaCwgDNwMlnbu7/tXLfV1VM/oIpkWzdTt4KwhgA?= =?us-ascii?Q?gvEKRLHHzMlHp/niiicZUB2Hq1LUlAiSXedvuRvGFJPj8NBtq+LzU+qTUhq6?= =?us-ascii?Q?xgLqcm5g9uh6YVzvoevNyz+v7aTbH7EvvStrdKy7nZ3x0YU00K5q78K/BYI+?= =?us-ascii?Q?s0nxgnBTNF6MXdb6CiKLf4q8tZkwjUfdsE73NT1klGTxru6ESujv1/0I7Uvl?= =?us-ascii?Q?IYa3HPm/GmVJB1A6mppbWo1L6MEnhnGUlcI9gmTPwALGx0S7AseSGl0mMhWl?= =?us-ascii?Q?sOasHUrTz0MTmGV2/qmiua3PdwFhy5F+j6xHjh05SNWj85CA2gAhQCJARV9n?= =?us-ascii?Q?1eDFV2SYd0BKLqjpXhjlHDoMxtHGJgFJKEz+UvPc4UAyC/wEnxbFgSklVZ8K?= =?us-ascii?Q?I5fsg+31uwqhkab26yLtUIQNpgH+JH8HD+mGSaaf40JKEG7pt4PNkEWbpi0c?= =?us-ascii?Q?cgt04z3CAKGyhb80KVkGrdGEgZYWTbmSHj9nb7eZ7cUHU2Xdre4WjQoOUAug?= =?us-ascii?Q?zr+/0p6dWBDisnCxB2kI2ll9MIaJRjfUWXMsMVh8Zx+CJIEetS5rC+p3dKRo?= =?us-ascii?Q?V66HOoDKQnjdDswXMHbudbfLkHCj/4+E5jfAGlCJIMeHG7OpoafHe24QfmGk?= =?us-ascii?Q?yRr/IMSDMTEDf2ZTNNsHqFoEJv0Gl6YPi+M5J327UKJq9woP1BD0U0Q7oQ/c?= =?us-ascii?Q?Kg5d8ptlzoqpekqc+cOKQcI8GgoZ6aUI3k5HlVwO1dwgxn9v1qszJntJhfji?= =?us-ascii?Q?J2E6k4pm2MN7Icq8mlhEmiggKDwAzy7F9ERHXX9ueJ7rW1KsYRtvesHu+CNv?= =?us-ascii?Q?0+6PXy6SXr4zulaUqrpiuVVyR7sCdztZ1bgh7v/qj41Zcf5OlDZbsxtFxAy+?= =?us-ascii?Q?BMSF4cBxIgzf5VZZA5HDRH7RTvc7+m0OeK5iMKYD76J0S3Eu4QUCtyI7mWJk?= =?us-ascii?Q?7l1hwkS5ey2iEgP7ikmFT5dVES+6RJwHAjCqEzSH7ffBkWUCO8LIz54rmYtK?= =?us-ascii?Q?EfqWM1fIhchUm4PVbaoPJDCH67NqMyFU/YEmD4mj6LHpr01/3rjuPx5rSCDJ?= =?us-ascii?Q?XSAQ+sjGWfz2dFSBLl50rGoNsLuIPjlWbT8KHtw0X1bdONFULNvIw6GHUMWP?= =?us-ascii?Q?Zw=3D=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 91ed6371-c465-42ee-1f5a-08da5aa16c93 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5056.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jun 2022 14:04:18.5412 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: L5vxLpA8FjH1rw/tAW8CEsO+tDdQA1nyED8JOKEL42MJf7Nfu/7+s7bZfFo4Mi52c0QS64OJH5O5P263s4OJBwADWDPF1LdIGluXou/pYos= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR04MB9322 X-ZohoMail-DKIM: pass (identity @NXP1.onmicrosoft.com) X-ZM-MESSAGEID: 1656597957783100001 Content-Type: text/plain; charset="utf-8" From: Andrei Cherechesu If the "BOOT_CMD" variable is set to "none" inside the config file, the boot command (i.e. "booti") will not by added to the generated script, to allow the user to customize the u-boot env or the device-tree after executing the script commands and before actually booting. Added commands to store the addresses where the Xen image and device-tree file are loaded, in 'host_kernel_addr' and 'host_fdt_addr' variables, if the boot command is skipped and the "-s" parameter is not used. The `booti` command can then be executed as part of the 'bootcmd' variable in u-boot, which should contain: 1. fetching the generated u-boot script 2. executing the script 3. running `booti ${host_kernel_addr} - ${host_fdt_addr}` command Signed-off-by: Andrei Cherechesu Reviewed-by: Stefano Stabellini --- README.md | 5 ++++- scripts/uboot-script-gen | 16 +++++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index cb15ca5..b1a9b9d 100644 --- a/README.md +++ b/README.md @@ -80,7 +80,10 @@ Where: =20 - BOOT_CMD specifies the u-boot command used to boot the binaries. By default, it is 'booti'. The acceptable values are 'booti', 'bootm' - and 'bootefi'. + and 'bootefi' and 'none'. If the value is 'none', the BOOT_CMD is not + added to the boot script, and the addresses for the Xen binary and the + DTB are stored in 'host_kernel_addr' and 'host_fdt_addr' u-boot + env variables respectively, to be used manually when booting. =20 - DEVICE_TREE specifies the DTB file to load. =20 diff --git a/scripts/uboot-script-gen b/scripts/uboot-script-gen index 444c65a..994369c 100755 --- a/scripts/uboot-script-gen +++ b/scripts/uboot-script-gen @@ -966,7 +966,7 @@ function check_depends() =20 function check_boot_cmd() { - if ! [[ " bootm booti bootefi " =3D~ " ${BOOT_CMD}" ]] + if ! [[ " bootm booti bootefi none " =3D~ " ${BOOT_CMD}" ]] then echo "\"BOOT_CMD=3D$BOOT_CMD\" is not valid" exit 1 @@ -1255,9 +1255,19 @@ echo "setenv fdt_high 0xffffffffffffffff" >> $UBOOT_= SOURCE =20 if test "$dynamic_loading_opt" then - echo "$BOOT_CMD \${host_kernel_addr} - \${host_fdt_addr}" >> $UBOOT_SO= URCE + if [ "$BOOT_CMD" !=3D "none" ] + then + echo "$BOOT_CMD \${host_kernel_addr} - \${host_fdt_addr}" >> $UBOO= T_SOURCE + fi else - echo "$BOOT_CMD $kernel_addr - $device_tree_addr" >> $UBOOT_SOURCE + if [ "$BOOT_CMD" !=3D "none" ] + then + echo "$BOOT_CMD $kernel_addr - $device_tree_addr" >> $UBOOT_SOURCE + else + # skip boot command but store load addresses to be used later + echo "setenv host_kernel_addr $kernel_addr" >> $UBOOT_SOURCE + echo "setenv host_fdt_addr $device_tree_addr" >> $UBOOT_SOURCE + fi fi =20 if test "$FIT" --=20 2.35.1