From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7351319485919264768 X-Forwarded-Encrypted: i=3; AJvYcCVHnWpkSrZis3tEIz4BS1+v+ulVDkqtN5M9GZY4PQSsSD2RHvrpVgdmL40uAzP9hNWhsmmB7BBtjfeVxWpAHU7gZS1qNDeYmLayOBE= X-Received: by 2002:a05:6214:a73:b0:69b:5db8:113 with SMTP id ef19-20020a0562140a7300b0069b5db80113mr6664068qvb.42.1713186699766; Mon, 15 Apr 2024 06:11:39 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6214:21c7:b0:68e:fab1:8005 with SMTP id d7-20020a05621421c700b0068efab18005ls4280305qvh.0.-pod-prod-05-us; Mon, 15 Apr 2024 06:11:37 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVWJmJgIC0GOLjo2KAEWDiZnsvewhXUtFkPLU/H7i3+UqE9rpSM7rG1ppCcvYkg1cHIVW3B1JigIE/bh1c4KEA1UCa8U062i/6SvoM= X-Google-Smtp-Source: AGHT+IHnvXRh8IhhvCjYcHbR4mRDc8Wr4Jwekq88MXIpTpLM6iN60rm4WetNizL7utI9caz4ECgY X-Received: by 2002:a0c:fba2:0:b0:696:a48d:26a0 with SMTP id m2-20020a0cfba2000000b00696a48d26a0mr11020593qvp.46.1713186697391; Mon, 15 Apr 2024 06:11:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713186697; cv=pass; d=google.com; s=arc-20160816; b=Af+9ulE1rQ6FJd4VLCtEKI6uUAVZpQziR31vPsjXAjHGU2Xcmyw0rZ4lSewO1V0n6M rKzfQN0PzH6CZZD6gAB3Ebphb5ARqKLZgVSrvI3G58wEL/puryBrRsWiVCHonrqUS0+l adP4O9tj45WaeE1ij/VfINO+4LMD+aQSb1sTvMXQRGCMCd8AxG+zLBXrP2S+f76mNQ+S BiiFudfUw1n+ahUc+DWReI08NftecD4770y3BtS36dGlz3lxifaKvhoL0nUg/wHb2MX8 65GLttVZB4mqGft5ABgWKt8n69s2xzV4CnJKFada4nv/aKcowigjfer4IJ2G++MxUz+p TrZQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:content-transfer-encoding:msip_labels:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:to:from:dkim-signature; bh=MW0o+I6Ov7R1BRFnkklZWk0BcaWjQSqREcoqOJDPRH4=; fh=Q7LxutatS/TXRtMZZN66oHJ4tLBqDTE7B7BlJVUVwAk=; b=vqX3YP95CFY5ooyd1E6P8rFbrK3Y/QQQcW0+V/YfeUqy4zutB0ZWSYY0BsvPqJCk2M d99zxvMybeYJEZD1t7UzsRNoINn0/A2GgO0iS8RPhWDMlQwm7GOAWdyAGHSWvXOQpJuZ OFTJmq5WOk1FeopN1iVgiQ0O8lYyIMbBahY62J7aCwiw84vkBjk5Q6WPqTDRVGJU4Izd tCNYKcAT6OCmStwOyC6HFVVtrgmjhGPbCp/LmVI1t42uT4RYT62u+8PtXDzm/8WqBtQ4 z02v6KwBgaYmVnBCshpHoq1H8GVZUZGNGqTPKZR/vkQd1ydMdUymWW7P+lDX0Cu8PtIV THkg==; dara=google.com ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=selector2 header.b=haeWoyn1; arc=pass (i=1 spf=pass spfdomain=siemens.com dkim=pass dkdomain=siemens.com dmarc=pass fromdomain=siemens.com); spf=pass (google.com: domain of nicusor.huhulea@siemens.com designates 2a01:111:f403:260d::601 as permitted sender) smtp.mailfrom=nicusor.huhulea@siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Return-Path: Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on20601.outbound.protection.outlook.com. [2a01:111:f403:260d::601]) by gmr-mx.google.com with ESMTPS id u17-20020a0ce5d1000000b0069bb2dfe44fsi58233qvm.8.2024.04.15.06.11.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Apr 2024 06:11:37 -0700 (PDT) Received-SPF: pass (google.com: domain of nicusor.huhulea@siemens.com designates 2a01:111:f403:260d::601 as permitted sender) client-ip=2a01:111:f403:260d::601; Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=selector2 header.b=haeWoyn1; arc=pass (i=1 spf=pass spfdomain=siemens.com dkim=pass dkdomain=siemens.com dmarc=pass fromdomain=siemens.com); spf=pass (google.com: domain of nicusor.huhulea@siemens.com designates 2a01:111:f403:260d::601 as permitted sender) smtp.mailfrom=nicusor.huhulea@siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OS4zw7sEPFSmICrGirPS8y19/9HSy0306KNTa4mVD78MN2PUt/CgQn5G7FlMG+AM+A1puoJwgEaD2A6M5zoEQDVfI0+8Hdqb4xEG/F1Eft88L2vtPTA4D6UbqutilkOT1jMovQSgNzga1PIIfAcKnL6T695zD1F+q30aR2bscVYS1QmQ5uGzbD6PRov6BK6aiimd1L7oqm8vSnhKthnnvc+d81F4sOGrS3ycL0yMna8Wa+V6U66lbSTSvdMReH7kCmZI9edINwfAcjPyWDNR3RinSmpt5IOZzvtj90iAHRmxTpDga91DY48QGpOzMa4cqLtg5zsP3QeAvifKISvfqg== 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=MW0o+I6Ov7R1BRFnkklZWk0BcaWjQSqREcoqOJDPRH4=; b=LfA7Q5YYmo9QAspiE1G4g+flxSy/lEzIHTOxFEQ5OT8AoqI0jGQtybq2eaF1wsjtVxRgEIXYAV/vI5DwLFvXe3jCqiUJv8RoObJChNoi2Sr5PLeWyorw8sdCgHylgK5xWMjlapd3q6zD+qZHH1uEouUwgKutodabccCCfhww2t7eGKJsNhMxlJCAWIn8AaN/CM1t6ZInxKvzHKvDv7aqhtQp1qGqsbTkP7wbFurjmwUbmFd+B0hbycBEGHso7tSEorE4L3xzFYd558Mb2KqaxUpouRJFmyXZRJnupoYgzYSqaal9nqqZddNDta1ZCZXmjA9lrqynEYGsLburLu4P4w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=siemens.com; dmarc=pass action=none header.from=siemens.com; dkim=pass header.d=siemens.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=siemens.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MW0o+I6Ov7R1BRFnkklZWk0BcaWjQSqREcoqOJDPRH4=; b=haeWoyn1nrTl1ZyVZ3xbpQdw/JA1ccDc5pTcb0FU0NeyDcnZCZYFftjDwJLeZVAO6iMsEaNaoaGnx6a8WkiKlmBtMsmjG9WnXuFiQJW0DUbrtm97wqy6+iiALchzKmtrg+7DKCFz8JoC5tHq1EFSZY773q+56mkbAIe2XbYNX3igJN0BESS9RHPPokeOXMh0no3fflaRNj9r95g2x2chq7Ho/5bELKAxki2QWNtCNAJsCF+FUZ0zcJxG6pCjP/CaJuO1kRZxdxhn+fmRiQE8XtE9EVWRjSHPGRbuGQtgfcTgR1XqPgvvIYQX9t5ujo+25+pcSoN9peNW3xJkydo7kg== Received: from DB3PR10MB6908.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:431::21) by AS4PR10MB5223.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:4b3::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.50; Mon, 15 Apr 2024 13:11:34 +0000 Received: from DB3PR10MB6908.EURPRD10.PROD.OUTLOOK.COM ([fe80::224:f99d:c979:4bf5]) by DB3PR10MB6908.EURPRD10.PROD.OUTLOOK.COM ([fe80::224:f99d:c979:4bf5%4]) with mapi id 15.20.7452.046; Mon, 15 Apr 2024 13:11:34 +0000 From: "nicusor.huhulea@siemens.com" To: "quirin.gylstorff@siemens.com" , "isar-users@googlegroups.com" Subject: Re: [PATCH] image.bbclass: copy dtbs into a deploydir/subdirectory based on the image name Thread-Topic: [PATCH] image.bbclass: copy dtbs into a deploydir/subdirectory based on the image name Thread-Index: AQHagNOW1dRx46VomUipLPKsb6RcOLFNcAyAgAAOLDSAEJk8gIAGrBfHgASlogQ= Date: Mon, 15 Apr 2024 13:11:34 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_9d258917-277f-42cd-a3cd-14c4e9ee58bc_Enabled=True;MSIP_Label_9d258917-277f-42cd-a3cd-14c4e9ee58bc_SiteId=38ae3bcd-9579-4fd4-adda-b42e1495d55a;MSIP_Label_9d258917-277f-42cd-a3cd-14c4e9ee58bc_SetDate=2024-04-15T13:11:34.095Z;MSIP_Label_9d258917-277f-42cd-a3cd-14c4e9ee58bc_Name=C1 - Restricted;MSIP_Label_9d258917-277f-42cd-a3cd-14c4e9ee58bc_ContentBits=0;MSIP_Label_9d258917-277f-42cd-a3cd-14c4e9ee58bc_Method=Standard; authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=siemens.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DB3PR10MB6908:EE_|AS4PR10MB5223:EE_ x-ms-office365-filtering-correlation-id: c7c66b7a-f3ad-4a14-e99e-08dc5d4d9349 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: VqMCLAWQc+C7/cmjl+2cQzBYKK54NJjWNG+PEyAUnwpzOhVPoM547RsYFOmZpL34UOePmsiB4DSDiP2IM4PJdnaMTv/QvEo+ZNQqF4Y5sVqwLACUArxSJ0zN9MehsNbejdi9cTMDgs4GGGc62Lr3T+9U2M1DiXzVr4LiMM2yfhpnJM3mswkzzO6xWkgiYc/ECT+x4nw0IdhfET5O6RQY2FJJQo48R/ksjDGX08c/U7OH/isKEHKJXPnmqjmqspl79LW6nUzvpxKP+WWwCYTBWPeduwZc61cBZuuBwnL3XZ4VSgWrASDUJrcnwW62dys0EQJGc0J62nF3Bx9+mMrT8Au1X4azuo7K4m3EalmuOLKXyeUnKJqVKGuK04GD12YQpApyJpNssq1eIZI9j3DFDZnkYwm3Q+N4ANHR+848/MHV54+U0qEYUzJ6yOPRjGHG1bALtmhA3JlMbCEntuHzq/N3gTZDJeXqBg9BRdjcma9ct50rONTVB0ET7DXU9FrpCooIwYNsp1wvZC7TyKLxiujGyugzsFXNoc+3W/TJJfxFluhmyEsSDEkQ/jMq7kkNE13ZyFhpKMmZsJFnHcfdFHNC788Ishksi9gOtrfO9qcSeEBtxDbQUn7zpukHRbIeidQkeCuWyWHarOLteVqvoDECQhdFkhDS9ZjJRDfVuo/HdSSj82OyBA0jasD4EnfK x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB3PR10MB6908.EURPRD10.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230031)(1800799015)(366007)(376005)(38070700009);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Z2CKbZ9UHcD4k7RrPqG93Thv6HumWK1Pzlehyz2/fXkhD4rgQ0kuK+6drxmV?= =?us-ascii?Q?9XWTBJfCqDuZktl5ymTLanBa7Oh4O3vpm5QuoEsKjNqoHCctSWFZ7K2NBYDa?= =?us-ascii?Q?YghcBtUsF4v9NqfskaPvDQjXdGZY/aLP9i2iCcS/jZ9BjpXXgWwc7JV7bVmP?= =?us-ascii?Q?t/u81+J7C0dY48zjkAZ2Q89Bw3PzelkJZRtAvpxw+yIVaEnS3gjKCKfXeE1p?= =?us-ascii?Q?wjnJmtcFcuE/zxOvRT2Z7I8gbRNLK03yW0bXT9AmuHWyCEabu3767M0ns2jA?= =?us-ascii?Q?n4Itn3bZniXiLTdQd9Mz568CbO62JbRLuifQ9ChC93fVw6P7tKlGQVusuEBb?= =?us-ascii?Q?v3VeOCe3efbjhmuPyCL8PdgQ7pXG0GtkNKGsRK/9HSwjo7v15+pNhu//erTO?= =?us-ascii?Q?TekSueZyPX3MbJ/FHsUL4zeihzmZnMf62sFOnu6Dj6RjKAKF5AIXQ28Z5I/6?= =?us-ascii?Q?URqd2BLIYbKGoOmNU2kP2RtAAM5wSqTqlMb6hC1BdZvZh8NRoLmDfaJFP+VG?= =?us-ascii?Q?adJZlReTUS+r+YgkmNik8qxDkDspyYqycP2NRWzwprHYCpQntK12m2jJuGOz?= =?us-ascii?Q?XzdkuK/IwAlM2jVsyxicG1wavmupvn0YhbZSGqdFI+uWBAs5aMB3suhQ624i?= =?us-ascii?Q?T6qPe6UXxdPgQq+KbN5HlyqlTVcedmH/p9Z4u85S1CRd6v/YM7TVse9rreb9?= =?us-ascii?Q?1oivH9mTNYiu5c4wHT1Xg5fTYH4iXZSnTK0w9w8EL7nPwcyk4gPvHg5wMtm8?= =?us-ascii?Q?ZEB5ViCtB0clTQhc+BL1+R090u/yl7Za7fnbIOe53Ju74emFTduF7sf7Y3sv?= =?us-ascii?Q?L1SRPJ1AH4+AkVAsexomP/XlCaN43CTmV2f4zl2GbzZKlFFnWdWF/CzAo3Bd?= =?us-ascii?Q?fYKt0vW/BmLOlq0E4r+OmE7b21WaEVJ4nrxEgC/xhvRnbsu3gsh1NboJ8UfS?= =?us-ascii?Q?lT+vhZjv16qR1osNcpaozeekAA89NptoqgpvClIPBBKkpZrGdWjUscJ6xUME?= =?us-ascii?Q?T4JEhIuiMfUtZBnREXw07u1Yp7rLzA48Oa/pm0S0b9YfwROmKmjcadmDUl0b?= =?us-ascii?Q?m7PvkVrjliRAG4J0n+5UOy3aOPA7AhnW5VZkc1qCev5DIykS6eZpAqsIq4pu?= =?us-ascii?Q?YczomDePMHcbEGw5z09ztAVwKjvaIgiqmis7mvzMmginvh7rWWFC1FpCglSB?= =?us-ascii?Q?v+FPU/2jAHd05lnxH8hSAA0rTRe70VC4QBEvBKIBcTdj7vWk2o+zpegNcGsD?= =?us-ascii?Q?ws2MBH+V5LVgixLxCioQpLYXIiqVamxbQMKVsISoEqrrBIvx4XKNh2Td9w4v?= =?us-ascii?Q?U5S6ZBwoZRhK0jTYYcuuvu4QUuUGDovzRornF3P/P4eYScP7Xu480memrepl?= =?us-ascii?Q?RVB8g/01ZgMn+nt7uSj+BIEFOAMMlPI5oWKImT5kWWrA2Nx/7mp7kVpBvvs4?= =?us-ascii?Q?9M4E234hcWrlVuIWi/8e2XwcKBBEzq0FLvKOErIQQifCsNcFpvaoPCShcM5M?= =?us-ascii?Q?O040TtIWiVaUW7jcprzRdMwDo849/YYrlRqZjInlVAtsM2Bzzje0dn2hZDAD?= =?us-ascii?Q?pQQ4dKsygzlARYaVJzJBp7j69IVSkrmTwtRHpoFW?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: siemens.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DB3PR10MB6908.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: c7c66b7a-f3ad-4a14-e99e-08dc5d4d9349 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Apr 2024 13:11:34.4141 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 38ae3bcd-9579-4fd4-adda-b42e1495d55a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: d44wEuorSPi5t7mX2wl4vfRfmwpXdHAyXQ1HgcAsYHg/0pN6/g1nXj0KEBHvzmkLHlgdDkbp3ZvxtWTrgUVf5P9f1R6IOzpNPLO0Kk/NZ2s= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR10MB5223 X-TUID: 7rQS0AGVluaf Tested this on all the isar and cip-core machines. fix patch formatting too. * update the other areas in order to sync with the dtbs directory path Signed-off-by: Nicusor Huhulea --- meta/classes/image.bbclass | 21 +++++++++++-------- meta/classes/imagetypes_wic.bbclass | 2 +- .../wic/plugins/source/bootimg-efi-isar.py | 8 +++++-- scripts/lib/wic/plugins/source/bootimg-efi.py | 8 +++++-- .../wic/plugins/source/bootimg-partition.py | 10 ++++++++- 5 files changed, 34 insertions(+), 15 deletions(-) diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index 98741da0..e90f8fde 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass @@ -364,16 +364,19 @@ do_copy_boot_files() { fi fi - for file in ${DTB_FILES}; do - dtb=3D"$(find '${IMAGE_ROOTFS}/usr/lib' -type f \ - -iwholename '*linux-image-*/'${file} | head -1)" - - if [ -z "$dtb" -o ! -e "$dtb" ]; then - die "${file} not found" - fi + if [ -n "${DTB_FILES}" ]; then + mkdir -p "${DEPLOYDIR}/${IMAGE_FULLNAME}.dtbs" + for file in ${DTB_FILES}; do + dtb=3D"$(find '${IMAGE_ROOTFS}/usr/lib' -type f \ + -iwholename '*linux-image-*/'${file} | head -1)" + + if [ -z "$dtb" -o ! -e "$dtb" ]; then + die "${file} not found" + fi - cp -f "$dtb" "${DEPLOYDIR}/" - done + cp -f "$dtb" "${DEPLOYDIR}/${IMAGE_FULLNAME}.dtbs" + done + fi } addtask copy_boot_files before do_rootfs_postprocess after do_rootfs_insta= ll diff --git a/meta/classes/imagetypes_wic.bbclass b/meta/classes/imagetypes_= wic.bbclass index bce881ed..adbde400 100644 --- a/meta/classes/imagetypes_wic.bbclass +++ b/meta/classes/imagetypes_wic.bbclass @@ -107,7 +107,7 @@ WICVARS +=3D "\ ROOTFS_SIZE STAGING_DATADIR STAGING_DIR STAGING_LIBDIR TARGET_S= YS TRANSLATED_TARGET_ARCH" # Isar specific vars used in our plugins -WICVARS +=3D "DISTRO DISTRO_ARCH" +WICVARS +=3D "DISTRO DISTRO_ARCH IMAGE_FULLNAME" python do_rootfs_wicenv () { wicvars =3D d.getVar('WICVARS') diff --git a/meta/scripts/lib/wic/plugins/source/bootimg-efi-isar.py b/meta= /scripts/lib/wic/plugins/source/bootimg-efi-isar.py index 4bfb70a0..218a7fe7 100644 --- a/meta/scripts/lib/wic/plugins/source/bootimg-efi-isar.py +++ b/meta/scripts/lib/wic/plugins/source/bootimg-efi-isar.py @@ -57,7 +57,9 @@ class BootimgEFIPlugin(SourcePlugin): if dtb: if ';' in dtb: raise WicError("Only one DTB supported, exiting") - cp_cmd =3D "cp %s/%s %s" % (bootimg_dir, dtb, hdddir) + image_fullname =3D get_bitbake_var("IMAGE_FULLNAME") + dtbs_dir =3D os.path.join(bootimg_dir + "/" + image_fullname += ".dtbs") + cp_cmd =3D "cp %s/%s %s" % (dtbs_dir, dtb, hdddir) exec_cmd(cp_cmd, True) @classmethod @@ -353,8 +355,10 @@ class BootimgEFIPlugin(SourcePlugin): if dtb: if ';' in dtb: raise WicError("Only one DTB supported, exiting") + image_fullname =3D get_bitbake_var("IMAGE_FULLNAME") + dtbs_dir =3D os.path.join(deploy_dir + "/" + image_ful= lname + ".dtbs") dtb_params =3D '--add-section .dtb=3D%s/%s --change-se= ction-vma .dtb=3D0x40000' % \ - (deploy_dir, dtb) + (dtbs_dir, dtb) else: dtb_params =3D '' diff --git a/scripts/lib/wic/plugins/source/bootimg-efi.py b/scripts/lib/wi= c/plugins/source/bootimg-efi.py index 634a808d..07b177df 100644 --- a/scripts/lib/wic/plugins/source/bootimg-efi.py +++ b/scripts/lib/wic/plugins/source/bootimg-efi.py @@ -51,7 +51,9 @@ class BootimgEFIPlugin(SourcePlugin): if dtb: if ';' in dtb: raise WicError("Only one DTB supported, exiting") - cp_cmd =3D "cp %s/%s %s" % (bootimg_dir, dtb, hdddir) + image_fullname =3D get_bitbake_var("IMAGE_FULLNAME") + dtbs_dir =3D os.path.join(bootimg_dir + "/" + image_fullname += ".dtbs") + cp_cmd =3D "cp %s/%s %s" % (dtbs_dir, dtb, hdddir) exec_cmd(cp_cmd, True) @classmethod @@ -334,8 +336,10 @@ class BootimgEFIPlugin(SourcePlugin): if dtb: if ';' in dtb: raise WicError("Only one DTB supported, exiting") + image_fullname =3D get_bitbake_var("IMAGE_FULLNAME") + dtbs_dir =3D os.path.join(deploy_dir + "/" + image_ful= lname + ".dtbs") dtb_params =3D '--add-section .dtb=3D%s/%s --change-se= ction-vma .dtb=3D0x40000' % \ - (deploy_dir, dtb) + (dtbs_dir, dtb) else: dtb_params =3D '' diff --git a/scripts/lib/wic/plugins/source/bootimg-partition.py b/scripts/= lib/wic/plugins/source/bootimg-partition.py index 5dbe2558..1ae6216f 100644 --- a/scripts/lib/wic/plugins/source/bootimg-partition.py +++ b/scripts/lib/wic/plugins/source/bootimg-partition.py @@ -180,10 +180,18 @@ class BootimgPartitionPlugin(SourcePlugin): logger.debug('Kernel dir: %s', bootimg_dir) + image_fullname =3D get_bitbake_var("IMAGE_FULLNAME") + dtbs_dir =3D os.path.join(kernel_dir + "/" + image_fullname + ".dt= bs/") for task in cls.install_task: src_path, dst_path =3D task - logger.debug('Install %s as %s', src_path, dst_path) + + dtb_file =3D os.path.join(dtbs_dir + os.path.basename(src_path= )) + + if os.path.exists(dtb_file): + src_path =3D os.path.join(dtbs_dir + src_path) + + logger.debug('Install %s as %s', (src_path, dst_path)) install_cmd =3D "install -m 0644 -D %s %s" \ % (os.path.join(kernel_dir, src_path), os.path.join(hdddir, dst_path)) -- 2.39.2 ________________________________________ From: Huhulea, Nicusor Liviu (DI CTO FDS CES LX SVCS) Sent: Friday, April 12, 2024 5:11 PM To: Gylstorff, Quirin (T CED OES-DE); isar-users@googlegroups.com Subject: Re: [PATCH] image.bbclass: copy dtbs into a deploydir/subdirectory= based on the image name updated all the cases where the dtbs path needed to be changed * update the other areas in order to sync with the dtbs directory path Signed-off-by: Nicusor Huhulea diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index 98741da0..e90f8fde 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass @@ -364,16 +364,19 @@ do_copy_boot_files() { fi fi - for file in ${DTB_FILES}; do - dtb=3D"$(find '${IMAGE_ROOTFS}/usr/lib' -type f \ - -iwholename '*linux-image-*/'${file} | head -1)" - - if [ -z "$dtb" -o ! -e "$dtb" ]; then - die "${file} not found" - fi + if [ -n "${DTB_FILES}" ]; then + mkdir -p "${DEPLOYDIR}/${IMAGE_FULLNAME}.dtbs" + for file in ${DTB_FILES}; do + dtb=3D"$(find '${IMAGE_ROOTFS}/usr/lib' -type f \ + -iwholename '*linux-image-*/'${file} | head -1)" + + if [ -z "$dtb" -o ! -e "$dtb" ]; then + die "${file} not found" + fi - cp -f "$dtb" "${DEPLOYDIR}/" - done + cp -f "$dtb" "${DEPLOYDIR}/${IMAGE_FULLNAME}.dtbs" + done + fi } addtask copy_boot_files before do_rootfs_postprocess after do_rootfs_insta= ll diff --git a/meta/classes/imagetypes_wic.bbclass b/meta/classes/imagetypes_= wic.bbclass index bce881ed..adbde400 100644 --- a/meta/classes/imagetypes_wic.bbclass +++ b/meta/classes/imagetypes_wic.bbclass @@ -107,7 +107,7 @@ WICVARS +=3D "\ ROOTFS_SIZE STAGING_DATADIR STAGING_DIR STAGING_LIBDIR TARGET_S= YS TRANSLATED_TARGET_ARCH" # Isar specific vars used in our plugins -WICVARS +=3D "DISTRO DISTRO_ARCH" +WICVARS +=3D "DISTRO DISTRO_ARCH IMAGE_FULLNAME" python do_rootfs_wicenv () { wicvars =3D d.getVar('WICVARS') diff --git a/meta/scripts/lib/wic/plugins/source/bootimg-efi-isar.py b/meta= /scripts/lib/wic/plugins/source/bootimg-efi-isar.py index 4bfb70a0..218a7fe7 100644 --- a/meta/scripts/lib/wic/plugins/source/bootimg-efi-isar.py +++ b/meta/scripts/lib/wic/plugins/source/bootimg-efi-isar.py @@ -57,7 +57,9 @@ class BootimgEFIPlugin(SourcePlugin): if dtb: if ';' in dtb: raise WicError("Only one DTB supported, exiting") - cp_cmd =3D "cp %s/%s %s" % (bootimg_dir, dtb, hdddir) + image_fullname =3D get_bitbake_var("IMAGE_FULLNAME") + dtbs_dir =3D os.path.join(bootimg_dir + "/" + image_fullname += ".dtbs") + cp_cmd =3D "cp %s/%s %s" % (dtbs_dir, dtb, hdddir) exec_cmd(cp_cmd, True) @classmethod @@ -353,8 +355,10 @@ class BootimgEFIPlugin(SourcePlugin): if dtb: if ';' in dtb: raise WicError("Only one DTB supported, exiting") + image_fullname =3D get_bitbake_var("IMAGE_FULLNAME") + dtbs_dir =3D os.path.join(deploy_dir + "/" + image_ful= lname + ".dtbs") dtb_params =3D '--add-section .dtb=3D%s/%s --change-se= ction-vma .dtb=3D0x40000' % \ - (deploy_dir, dtb) + (dtbs_dir, dtb) else: dtb_params =3D '' diff --git a/scripts/lib/wic/plugins/source/bootimg-efi.py b/scripts/lib/wi= c/plugins/source/bootimg-efi.py index 634a808d..07b177df 100644 --- a/scripts/lib/wic/plugins/source/bootimg-efi.py +++ b/scripts/lib/wic/plugins/source/bootimg-efi.py @@ -51,7 +51,9 @@ class BootimgEFIPlugin(SourcePlugin): if dtb: if ';' in dtb: raise WicError("Only one DTB supported, exiting") - cp_cmd =3D "cp %s/%s %s" % (bootimg_dir, dtb, hdddir) + image_fullname =3D get_bitbake_var("IMAGE_FULLNAME") + dtbs_dir =3D os.path.join(bootimg_dir + "/" + image_fullname += ".dtbs") + cp_cmd =3D "cp %s/%s %s" % (dtbs_dir, dtb, hdddir) exec_cmd(cp_cmd, True) @classmethod @@ -334,8 +336,10 @@ class BootimgEFIPlugin(SourcePlugin): if dtb: if ';' in dtb: raise WicError("Only one DTB supported, exiting") + image_fullname =3D get_bitbake_var("IMAGE_FULLNAME") + dtbs_dir =3D os.path.join(deploy_dir + "/" + image_ful= lname + ".dtbs") dtb_params =3D '--add-section .dtb=3D%s/%s --change-se= ction-vma .dtb=3D0x40000' % \ - (deploy_dir, dtb) + (dtbs_dir, dtb) else: dtb_params =3D '' diff --git a/scripts/lib/wic/plugins/source/bootimg-partition.py b/scripts/= lib/wic/plugins/source/bootimg-partition.py index 5dbe2558..1ae6216f 100644 --- a/scripts/lib/wic/plugins/source/bootimg-partition.py +++ b/scripts/lib/wic/plugins/source/bootimg-partition.py @@ -180,10 +180,18 @@ class BootimgPartitionPlugin(SourcePlugin): logger.debug('Kernel dir: %s', bootimg_dir) + image_fullname =3D get_bitbake_var("IMAGE_FULLNAME") + dtbs_dir =3D os.path.join(kernel_dir + "/" + image_fullname + ".dt= bs/") for task in cls.install_task: src_path, dst_path =3D task - logger.debug('Install %s as %s', src_path, dst_path) + + dtb_file =3D os.path.join(dtbs_dir + os.path.basename(src_path= )) + + if os.path.exists(dtb_file): + src_path =3D os.path.join(dtbs_dir + src_path) + + logger.debug('Install %s as %s', (src_path, dst_path)) install_cmd =3D "install -m 0644 -D %s %s" \ % (os.path.join(kernel_dir, src_path), os.path.join(hdddir, dst_path)) ________________________________________ From: Gylstorff, Quirin (T CED OES-DE) Sent: Monday, April 8, 2024 11:12 AM To: Huhulea, Nicusor Liviu (DI CTO FDS CES LX SVCS); isar-users@googlegroup= s.com Subject: Re: [PATCH] image.bbclass: copy dtbs into a deploydir/subdirectory= based on the image name On 3/28/24 8:05 PM, Huhulea, Nicusor Liviu (DI CTO FDS CES LX SVCS) wrote: > Yes, it will break it without patching it. I'm not sure where this bootim= g-efi.py is being used here, as for testing usually I'm using https://githu= b.com/siemens/meta-iot2050 It is used indirect with bootimg-efi-isar. Quirin > > I guess that in this case the equivalent for bootimg-efi.py is https://gi= tlab.com/cip-project/cip-core/isar-cip-core/-/blob/master/scripts/lib/wic/p= lugins/source/efibootguard-boot.py which is already patched. > > Nicu > > ________________________________________ > From: Gylstorff, Quirin (T CED OES-DE) > Sent: Thursday, March 28, 2024 7:53 PM > To: Huhulea, Nicusor Liviu (DI CTO FDS CES LX SVCS); isar-users@googlegro= ups.com > Subject: Re: [PATCH] image.bbclass: copy dtbs into a deploydir/subdirecto= ry based on the image name > > > > On 3/28/24 8:54 AM, 'nicusor.huhulea@siemens.com' via isar-users wrote: >> This fixes the build failures detailed in the https://groups.google.com/= g/isar-users/c/Va0Ue-ISYeA and >> https://groups.google.com/g/isar-users/c/PSGU_AcdPZ8 >> This adds the MACHINE variable to WICVARS, hence the need to reflect thi= s change in >> cip-core/scripts/lib/wic/plugins/source/efibootguard-boot.py >> >> >> Signed-off-by: Nicusor Huhulea >> >> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass >> index 73f1d52c..9b98719b 100644 >> --- a/meta/classes/image.bbclass >> +++ b/meta/classes/image.bbclass >> @@ -377,16 +377,19 @@ do_copy_boot_files() { >> fi >> fi >> >> - for file in ${DTB_FILES}; do >> - dtb=3D"$(find '${IMAGE_ROOTFS}/usr/lib' -type f \ >> - -iwholename '*linux-image-*/'${file} | head -1)" >> - >> - if [ -z "$dtb" -o ! -e "$dtb" ]; then >> - die "${file} not found" >> - fi >> + if [ -n "${DTB_FILES}" ]; then >> + mkdir -p "${DEPLOYDIR}/${IMAGE_FULLNAME}.dtbs" >> + for file in ${DTB_FILES}; do >> + dtb=3D"$(find '${IMAGE_ROOTFS}/usr/lib' -type f \ >> + -iwholename '*linux-image-*/'${file} | head -1)= " >> + >> + if [ -z "$dtb" -o ! -e "$dtb" ]; then >> + die "${file} not found" >> + fi >> >> - cp -f "$dtb" "${DEPLOYDIR}/" >> - done >> + cp -f "$dtb" "${DEPLOYDIR}/${IMAGE_FULLNAME}.dtbs" > > This will break scripts/lib/wic/plugins/source/bootimg-efi.py from > bitbake[1]. > > [1]: > https://github.com/openembedded/openembedded-core/blob/master/scripts/lib= /wic/plugins/source/bootimg-efi.py > > Quirin > >> + done >> + fi >> } >> addtask copy_boot_files before do_rootfs_postprocess after do_rootfs_= install >> >> diff --git a/meta/classes/imagetypes_wic.bbclass b/meta/classes/imagetyp= es_wic.bbclass >> index bce881ed..f0f1c438 100644 >> --- a/meta/classes/imagetypes_wic.bbclass >> +++ b/meta/classes/imagetypes_wic.bbclass >> @@ -107,7 +107,7 @@ WICVARS +=3D "\ >> ROOTFS_SIZE STAGING_DATADIR STAGING_DIR STAGING_LIBDIR TAR= GET_SYS TRANSLATED_TARGET_ARCH" >> >> # Isar specific vars used in our plugins >> -WICVARS +=3D "DISTRO DISTRO_ARCH" >> +WICVARS +=3D "DISTRO DISTRO_ARCH MACHINE" >> >> python do_rootfs_wicenv () { >> wicvars =3D d.getVar('WICVARS') >>