From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7118849486659518464 X-Received: by 2002:a17:907:1c0a:b0:72b:378f:2fa1 with SMTP id nc10-20020a1709071c0a00b0072b378f2fa1mr13102842ejc.492.1657557083755; Mon, 11 Jul 2022 09:31:23 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a17:906:2ad6:b0:6fe:976a:7a5 with SMTP id m22-20020a1709062ad600b006fe976a07a5ls106833eje.7.gmail; Mon, 11 Jul 2022 09:31:22 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vvM56totIAuiYews71H3LI7UqnRZcYLkoiR+ZZte2nL/zGBDALT0ef4F817TUfXRH3n/A4 X-Received: by 2002:a17:906:cc45:b0:72b:313b:f3ee with SMTP id mm5-20020a170906cc4500b0072b313bf3eemr15235052ejb.362.1657557082496; Mon, 11 Jul 2022 09:31:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1657557082; cv=pass; d=google.com; s=arc-20160816; b=ljnfVZ3uVJpjL0y9lpD43WgF3S/GcCLi8+BgkXitBFOtjfp0mP5SS5ZO5ZDDiRRqVv dTN43ZXq8mk+hjA2yUGLKNri0429jIi/ewMAyKYEj7/mHso5QFT+C6avM0duc3lpUAW9 YNi4DXg+0kYgkgQThX+AmEv2tCZWpkqZL2lK1YEloM5Lpsc/lFq0GvWQCcXiuLGq2+VU OlKVLF1hs07GkBbtd/fIASx+y4GqTZmtm46kjnzbM9uYvsuNohFe+DIs7YKgFKh8/2+h 1IF7BW45GRIkwRSAYbmW+z6Bc7ssnOlydD/eW6XPyvgXtYkJzF8UcmhZ1FkBpARViZyf LOgA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :dkim-signature; bh=rg00IKm6YW5qBxdQANBp0dFpnMC+cWHmkV+oDgItsx8=; b=nos6qshBDP/342Fp54vuHT2Z0DuSOfuoCsSf9Yof4I/NMBSl0iObquIcCr6vANtKqa gwCXJVlkYA0UAHcNQZJCbyPhfRvrj3B6i3leRTjZhvjQTTAOjoGU9Cp8mnWZQ5MJfB+F 3NyeEOF1jbL0xtvS0H0DL8qQ/WYFaJUe7D1ioGVTTmQ7n2oiwa79TdLAdq9dMqvhG8xu pj6aiwdUzC7e5fN+BCJZC6RPhRnXEUeT1u94FjNP2A0ykrnOpDFnRDbN3iEbIRxI7F78 cqonjDL5zIRwbhbHdYOovy48SxehUIMY/JbU1GhamD+EDUCGS0XIN1Nufbr9dHmRbCKs p9QA== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=selector2 header.b=iYAFKuAf; arc=pass (i=1 spf=pass spfdomain=siemens.com dmarc=pass fromdomain=siemens.com); spf=pass (google.com: domain of jan.kiszka@siemens.com designates 40.107.8.74 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80074.outbound.protection.outlook.com. [40.107.8.74]) by gmr-mx.google.com with ESMTPS id my7-20020a1709065a4700b0072af116ff94si328835ejc.1.2022.07.11.09.31.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Jul 2022 09:31:22 -0700 (PDT) Received-SPF: pass (google.com: domain of jan.kiszka@siemens.com designates 40.107.8.74 as permitted sender) client-ip=40.107.8.74; Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=selector2 header.b=iYAFKuAf; arc=pass (i=1 spf=pass spfdomain=siemens.com dmarc=pass fromdomain=siemens.com); spf=pass (google.com: domain of jan.kiszka@siemens.com designates 40.107.8.74 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eQ+fNUI/T9XaV4LiNszxhspODCLzuwtGk//fEyBOOFGURWnc3Um9oM/rIllX2lijVS6Fw93nYAIlqa25HdtFEWCW/GGGVCH1IzXGxMWFfsy57Vrd30ra4PkT+6Hfrukp7uxIF3yZEwbGHDv6v1E9hUZKgNTxYoV+ui6+jKf3TZowKy0ivYG6BTYpkC2f0cIQqhcL61nYdEIBUakhKi9I4Bo0ZCepwvMIMkvkpYao6QHFrLGXHqNMIMiT24XWjGUHxaK6m2hg6+xC87DZ9/2JLb+YADIFTwrF5jBBiRYakX0AwFWIijVj7wpXE3tyBvmHLo1A03DqgcivZuq/lmLRBg== 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=rg00IKm6YW5qBxdQANBp0dFpnMC+cWHmkV+oDgItsx8=; b=XRFqW/5IQZMWzIWAc7BtsRw+vew3gRn49SW8DG1gX9xMgGxatHd/bA7jSuRW8nifEimwgGtCB2gdsrEHZjH2PO0/apZRis7snHIeSsBZ0yjchBJXRoQaipWWOJLKFG9cLz4ufLGb1BYfr7hDv7SG1mQxs5JHoFSajgDavxeF7jlb3CCKv8pGTUEH2Rk6EZ4gl9s2BIteMbQliUPu3zT5zPixPuG42PLI6BKR89UMj82zlg+Q2QMTCdQr8T1hBTZGZsJlZ4WKuGI3HYd/EZKe5wCd+s0Pse5hXOxhXJH83P4OQhLaF++R3s3MSic7xVM61jLwPMfZHgPgjZVXzhbWBw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 194.138.21.73) smtp.rcpttodomain=googlegroups.com smtp.mailfrom=siemens.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=siemens.com; dkim=none (message not signed); 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=rg00IKm6YW5qBxdQANBp0dFpnMC+cWHmkV+oDgItsx8=; b=iYAFKuAfRACP0g7jFr7tog5a+qj9bmsDX7/EGl20W+qW4urxP0x+mvVLRWIrpwlVYbQzg1Z/FxvDob46LR7rvP8VdtV6EtQHRF7Az17uuIn56DGhOLXzmkxQtZ3Gxe3gC1qac1VrguVq+laSPJY1MvqWRdukD8VhFJ4iNwk8wefiqeUb3LbusFyf63gLo4IbpecLUjrr2KevO/bS3x1q64JAyNsGLSRCF5a2uT0EqIUMFetGyNxPASqDgf5czLilKKrFui79y23pIyh0qxkfLRSw9pLEWAD2y9w07Dd+ve6r2tpq5c76mKCJg/QD3H9esE0X0nQD8wMROitwolviKw== Received: from AS9PR06CA0768.eurprd06.prod.outlook.com (2603:10a6:20b:484::23) by PAXPR10MB4653.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:102:12c::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.15; Mon, 11 Jul 2022 16:31:21 +0000 Received: from VE1EUR01FT084.eop-EUR01.prod.protection.outlook.com (2603:10a6:20b:484:cafe::9b) by AS9PR06CA0768.outlook.office365.com (2603:10a6:20b:484::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.15 via Frontend Transport; Mon, 11 Jul 2022 16:31:21 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 194.138.21.73) smtp.mailfrom=siemens.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=siemens.com; Received-SPF: Pass (protection.outlook.com: domain of siemens.com designates 194.138.21.73 as permitted sender) receiver=protection.outlook.com; client-ip=194.138.21.73; helo=hybrid.siemens.com; pr=C Received: from hybrid.siemens.com (194.138.21.73) by VE1EUR01FT084.mail.protection.outlook.com (10.152.3.48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.16 via Frontend Transport; Mon, 11 Jul 2022 16:31:20 +0000 Received: from DEMCHDC89XA.ad011.siemens.net (139.25.226.103) by DEMCHDC9SNA.ad011.siemens.net (194.138.21.73) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.9; Mon, 11 Jul 2022 18:31:20 +0200 Received: from [167.87.9.151] (167.87.9.151) by DEMCHDC89XA.ad011.siemens.net (139.25.226.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.9; Mon, 11 Jul 2022 18:31:20 +0200 Message-ID: <3ab635bd-9694-3c85-64fd-854478260ba0@siemens.com> Date: Mon, 11 Jul 2022 18:31:19 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH] wic: bootimg-efi-isar: Add support for loading device tree files Content-Language: en-US To: Henning Schild CC: isar-users References: <20220711151214.271e944a@md1za8fc.ad001.siemens.net> <360ce666-6b17-d0ce-08fe-f195cdebe675@siemens.com> <20220711181212.79e7341f@md1za8fc.ad001.siemens.net> From: Jan Kiszka In-Reply-To: <20220711181212.79e7341f@md1za8fc.ad001.siemens.net> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-Path: jan.kiszka@siemens.com X-Originating-IP: [167.87.9.151] X-ClientProxiedBy: DEMCHDC89XA.ad011.siemens.net (139.25.226.103) To DEMCHDC89XA.ad011.siemens.net (139.25.226.103) X-TM-AS-Product-Ver: SMEX-14.0.0.3080-8.6.1018-26680.007 X-TM-AS-Result: No-10--30.863500-8.000000 X-TMASE-MatchedRID: uYzAW4YwQpU5QaOxwNGfvo9bHfxDWoibUlQrLabIzZPG2Lk2+vnEINdJ Rhy28lIunhD4vcFcha56ohuAoQsbwqhe/05vGvRYkqaOkaeJPrIqW5UkFuVoY8euFL5UpINxMoS 2PLq1B763ltgdOztD8Dp0RQ1/bKBcuB6DVpeQ1xoN5sID7a5qKOSInyvsm+wj/sUSFaCjTLypvf +jmz45w+cgikpSNCD7bjQ2nmm3r6itjaeQ/9STMvz0L4F91Y6Ez72Qid45mWHnBcjWg41W4H4JY JwdJw4TCwWRLqiC/UqujX9a1RWR0+CvRZnq77KlPdRKVxuI5P/QVDF+NEc7OIIK2tjTqNotDqaU R6lw5a/JyYU2J054PdWwBJL7BYx1VZJaOTfaCCUJ0s0WLmuOQDbqJxVoBdbQCtzGvPCy/m4rXO/ DnwR5y9WM2x6EZ/S9p/g7QDIlgt0VvqM4RwhxWtEd7bbT67j7aWPqw6Sbal5tawJSSsDgSd3JII V4K3T7JLfQYoCQHFZNOr2O2VM/50xQsabvw7Ox6oHsXSQd784OzP220JI38YpHR9xEGhE1Dvc/j 9oMIgWbkEl1SMP4VViCdxtT9qgpB+Wizc8insYvHEcEx0NzujLvC8LxRzod9u1rQ4BgXPJ9LQin Z4QefL6qvLNjDYTwsuf7RWbvUtyrusVRy4an8bxAi7jPoeEQftwZ3X11IV0= X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--30.863500-8.000000 X-TMASE-Version: SMEX-14.0.0.3080-8.6.1018-26680.007 X-TM-SNTS-SMTP: 3E98F725FAF0CC6A73C2E09BEE2729A919B9BA57746890F254CDC5055C2C75272000:8 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dee4187d-31cd-4674-d82e-08da635ac9c5 X-MS-TrafficTypeDiagnostic: PAXPR10MB4653:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nTmUA70Q+4wKe68XzluMMpjHIzlY/oSNRkw25TOEvmVC/bK98fJqnHH8D8KdP/Okt+S5MiZn1BQDBfS94yLaohsi3xpm/z7v2SwBmHpKFhnfOdI9yrDEvbIHuxtAIiXtIsf5+kj1zr01Q4/0wzorSsGiDJmdDN3ukNTePpBN+eIZ8wPfSd5tdPLUqOXoq2eC5grKlTXKyXfpNxJIWjSw4QWHdMU9g2+PICSAibeXoFHlUs+7Wj3CBOmz4QFJkNqp+ZPxZhGt2iQ/Owt9DIdChIcg7ptI0G/1eVnbwbvY9iq8+vZPQuHvNya6MVV8afb5w4TCGkd6vbVAwaqMAS4ZGkSVBhyZPYN+5AOUGUHHeFP7d7faDpl5MEo1avhaOHytPEXk89hZYmU5PNP+5E3WTUn9877VgYFfxYaVrwUde/S6IwdpYeUo8Df1OCp/r29GPV/rZuOubv/la6RQzq680XJvHLJRPtd/Y2HjurWSF4ErE1yltRXPPemsmcMnkQZZQkwEDMYluCpby8t5mCn4Fg00evnKbWkudCEti+rONq+U7wmz5umm+j0dC5vj4QutKrxwua5zfpHxFzhE9oeOS9uPKTYahNKfXBANTwai/MW4kgZF/fIpyrsPmP9IDlBO+6YIebPzw8VZjnElEQ8M5PXmoY3vmosNZeLlEY6X9kxAtwVcpp51wQ4EcnM6Ms6xzgaeIbXgjwXJqRGUhTybOOo2q/6cHQbyNBLiO7TEzII7Zk02RpMjL0mZMf5XEhTzrk3QneZPp8Vk9mH1rRlCPLiOgq0CUu/X1kDeHbEb/9FnnbUXKDas1SlCxsl/HkzmysDQWcCd81MUtHv9aPxH8KEKv6yaQtQN23dFY/9GQyllEDMWJNflPUs4p26JqcW6zC8/ZXOJsX9V1n5rWC82trPfvF9bDCf74HG6O0Qpk/k= X-Forefront-Antispam-Report: CIP:194.138.21.73;CTRY:DE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:hybrid.siemens.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230016)(4636009)(346002)(136003)(396003)(376002)(39860400002)(46966006)(36840700001)(40470700004)(356005)(81166007)(47076005)(40460700003)(31696002)(83380400001)(86362001)(82740400003)(6862004)(4326008)(336012)(36756003)(8676002)(8936002)(82960400001)(36860700001)(70206006)(6636002)(316002)(40480700001)(5660300002)(44832011)(31686004)(82310400005)(2906002)(53546011)(26005)(41300700001)(2616005)(478600001)(37006003)(16526019)(956004)(70586007)(186003)(16576012)(6706004)(3940600001)(43740500002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: siemens.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2022 16:31:20.9270 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dee4187d-31cd-4674-d82e-08da635ac9c5 X-MS-Exchange-CrossTenant-Id: 38ae3bcd-9579-4fd4-adda-b42e1495d55a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=38ae3bcd-9579-4fd4-adda-b42e1495d55a;Ip=[194.138.21.73];Helo=[hybrid.siemens.com] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR01FT084.eop-EUR01.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR10MB4653 X-TUID: 27kvcfPw5kKQ On 11.07.22 18:12, Henning Schild wrote: > Am Mon, 11 Jul 2022 17:14:09 +0200 > schrieb Jan Kiszka : > >> On 11.07.22 15:12, Henning Schild wrote: >>> Am Sun, 10 Jul 2022 22:51:44 +0200 >>> schrieb Jan Kiszka : >>> >>>> From: Jan Kiszka >>>> >>>> For device tree using systems, add support to set a custom devices >>>> tree during UEFI boot. This requires to copy the DTB file to the >>>> boot partition and to add the respective loader entries to the >>>> configuration files. >>>> >>>> Both grub and systemd-boot support only loading a specific device >>>> tree. Therefore refuse to work if DTB_FILES contains more than one >>>> entry. >>>> >>>> This has been tested with grub from bullseye and systemd from >>>> bullseye-backport. The latter is needed as only systemd 250 gained >>>> the required feature. >>>> >>>> Out of scope are overlays (only supported by systemd-boot) as well >>>> as unified kernel images (practically broken on non-x86 with >>>> current toolchains). >>>> >>>> Signed-off-by: Jan Kiszka >>>> --- >>>> meta/classes/imagetypes_wic.bbclass | 2 +- >>>> .../wic/plugins/source/bootimg-efi-isar.py | 39 >>>> +++++++++++++------ 2 files changed, 29 insertions(+), 12 >>>> deletions(-) >>>> >>>> diff --git a/meta/classes/imagetypes_wic.bbclass >>>> b/meta/classes/imagetypes_wic.bbclass index 61a74d4a..3a577f71 >>>> 100644 --- a/meta/classes/imagetypes_wic.bbclass >>>> +++ b/meta/classes/imagetypes_wic.bbclass >>>> @@ -106,7 +106,7 @@ WICVARS += "\ >>>> ROOTFS_SIZE STAGING_DATADIR STAGING_DIR STAGING_LIBDIR >>>> TARGET_SYS TRANSLATED_TARGET_ARCH" >>>> # Isar specific vars used in our plugins >>>> -WICVARS += "DISTRO DISTRO_ARCH" >>>> +WICVARS += "DISTRO DISTRO_ARCH DTB_FILES" >>>> >>>> python do_rootfs_wicenv () { >>>> wicvars = d.getVar('WICVARS', True) >>>> 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 >>>> a24e04f3..aff51e81 100644 --- >>>> a/meta/scripts/lib/wic/plugins/source/bootimg-efi-isar.py +++ >>>> b/meta/scripts/lib/wic/plugins/source/bootimg-efi-isar.py >>> >>> This file is a fork from OE with very minimal non-functional >>> changes to make it into Isar. I am afraid that feature will have to >>> make it via OE. >> >> Right, from >> >> bootimg-efi-isar.py | 65 >> +++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, >> 59 insertions(+), 6 deletions(-) >> >> to >> >> bootimg-efi-isar.py | 104 >> +++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, >> 87 insertions(+), 17 deletions(-) > > If you look carefully you will see that what you propose is the only > new feature. And most of the other code is a "trivial" grub template > ... which one could shrink, but it is not worth it. In other places i > invested a lot to make it hopefully easy to maintain, not to make it > look small. > > What you suggest is a pretty big change, which is going to be pretty > hard to maintain. If we really need to go down that road ... we need > testing for that. The change is not "big". > >> The problem is that OE core has no DTB_FILES, and seems like not even >> a concept of injecting DTBs via the bootloader, thus passing them to >> wic. > > Then prepare an "additional boot files" patch for OE. ... but wait. It > already has "custom_cfg". There is "initrd" which can specify multiple > files to copy, so i guess all you need is to write it down differently. > Carry the generated config+yourdiff as custom_cfg and set initrd=foo to > initrd=foo;my.dtb to get that file copied, done without a patch. Look, we surely don't want to ask users for much more than setting DTB_FILES in order to inject their DTB into the boot loader. That rules out custom configs and the existing primitive interface. But I will explore if OE has an opinion on setting "devicetree" in grub and systemd-boot configs. If that is at least positive in general, maybe some less elegant API than this one is possible, and it will generate one line less of deviation that this patch. If not, we will move forward with our API. Meanwhile: Happy Isar forking... Jan -- Siemens AG, Technology Competence Center Embedded Linux