From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Thu, 09 Dec 2021 10:58:50 +0100 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mvGCQ-000yjW-8F for lore@lore.pengutronix.de; Thu, 09 Dec 2021 10:58:50 +0100 Received: from localhost ([127.0.0.1] helo=metis.ext.pengutronix.de) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1mvGCP-0002mg-1t; Thu, 09 Dec 2021 10:58:49 +0100 Received: from mail-db8eur05on20614.outbound.protection.outlook.com ([2a01:111:f400:7e1a::614] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mvGBm-0002mI-C3; Thu, 09 Dec 2021 10:58:12 +0100 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bQ41+FQVXHNi5i+p3VbZXgO/uZncvRlvPp3jDicm2bK+3SRU6VKeZQUMu7J1LwAXDJBeSkSMeQHXmvI2R8DapkZf+gD4+q7WN8mp65bKm/BQ42hTr9Yo/lwjmY7rCF9VmpMnMca2P5G1V+yHrTlmjtJ4kGD/ftlQgAnYdh6tilQLEXUl+HMcW46OcQltDOYDWRLxPNVDgpJveZ0sEtjko5a5OaXhs+Ii8JQ01pddb2t8X/t1pRylraZkjJC/dLxHAxcvUsWzSCiX5OAv1RXxcBQVGmIEIzL9G55wSy7XJ1pv+gU/4dcE9k3/FJ0EgEcYfvsZ414hDSg4qYl6UbFaJQ== 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=F6LY5ejW5fU+XhUG5CyA9tTM/MYNb2lWvYhccsCqe9o=; b=OMJlm4xvfk2TunEm0MoXaYbM1/ECnLvwiuX5vdeX9MsSRtWdqRGuyXud4TTRQKXmIicJUKErKG4xcmBkljop2KXF+9feCMhv93bVUvFwiQbhbngVP1E17Hq+gaZgKUdn+oHcjuo4c3WN23mTevKHCWtJlgKtBEuQlZFwA85X629LUsi7EffsUBwIias/vU7UzEck6bXUeFvQdHG46L/2LWbAiQEITAzGt9uc5BGYlj4e2YV92HSK+swYyZ71suGbZmkhJx7sq4lhblMcl85kHbWwW9B/rYtwv3OyXeVcVvEdobkacHNzstnzk4U1Ysd+1sX5uUMaq+1p32Bjm9i8Gw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wolfvision.net; dmarc=pass action=none header.from=wolfvision.net; dkim=pass header.d=wolfvision.net; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wolfvision.net; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=F6LY5ejW5fU+XhUG5CyA9tTM/MYNb2lWvYhccsCqe9o=; b=lYDuearhck7ICPHsF5f+HgI/lyyxv9YG4JU87yu5YwKObDcqNMPInqCd+RWLBnqzRrFsjkc5a3xikKy/rSaCgiFKKwNYNANdjw/yizaQCxK3rRrdIsGje0cHt/u7IlP1OJiC4SoOd1RLSKxD4rn2EqZ2RWFmQG4J/H00vfPJaSw= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=wolfvision.net; Received: from DBBPR08MB4523.eurprd08.prod.outlook.com (2603:10a6:10:c8::19) by DBBPR08MB4524.eurprd08.prod.outlook.com (2603:10a6:10:c5::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.20; Thu, 9 Dec 2021 09:58:05 +0000 Received: from DBBPR08MB4523.eurprd08.prod.outlook.com ([fe80::81d1:d448:4016:1956]) by DBBPR08MB4523.eurprd08.prod.outlook.com ([fe80::81d1:d448:4016:1956%4]) with mapi id 15.20.4755.022; Thu, 9 Dec 2021 09:58:05 +0000 To: Christian Melki , ptxdist@pengutronix.de, m.tretter@pengutronix.de References: <20211207153905.2386379-1-michael.riesch@wolfvision.net> <20211207153905.2386379-2-michael.riesch@wolfvision.net> <5d9dbc5e-8330-34cd-3a4b-859ebfae277e@t2data.com> <20211208083149.GF15196@pengutronix.de> <0ee4879b-13d2-44dc-e963-09b880a6f310@wolfvision.net> <20211209085356.GM15196@pengutronix.de> From: Michael Riesch Message-ID: <132c595a-f8e4-a7c6-c830-d0911eb0f920@wolfvision.net> Date: Thu, 9 Dec 2021 10:58:03 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 In-Reply-To: <20211209085356.GM15196@pengutronix.de> Content-Language: en-US X-ClientProxiedBy: ZR0P278CA0131.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:40::10) To DBBPR08MB4523.eurprd08.prod.outlook.com (2603:10a6:10:c8::19) MIME-Version: 1.0 Received: from [IPv6:2a05:1141:1c9:7c00:2971:328c:3026:3149] (2a05:1141:1c9:7c00:2971:328c:3026:3149) by ZR0P278CA0131.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:40::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.21 via Frontend Transport; Thu, 9 Dec 2021 09:58:04 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 981ae660-f930-415b-61ac-08d9bafa650d X-MS-TrafficTypeDiagnostic: DBBPR08MB4524:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: i2mC3uIAnByhFDTlH6EH7W0ZlUkNpQp1wlFpWMP9jfO6se/dDfmS7s5lSR1b0WIfXOL30Se04Dc8xeF/9P34Qvo3rkn88yAof1aLelnapeIWpOOWXBw0hmLHjWdk90pj3CJT0QViL6mgvO7EIn/L5acWAiNTBU3UALzAcKNr9W/p53OEtHVv0DZHwFFthI4tEfB83FXQSxUq2lrN8M+7q8FUZ+pGeakK0dkFwTId3zcT+mrkJWDpaTuSQ54gftGGJ+Q06owO4sqQfS1qyy6ZfE2DBTyhYx0XbJgA+SFEjeDchqQrO3D0gM9QGXuBEnwMzGMnUOnOX3N1TK9OTq+/yXCgVipLMsOQijVieBbgl49ZffJJ+JrrbnUxmMJ0N871ZzALpOdK+P8r+JWAIslJFUuyI/MJ8IEuS7cKwv5BxvQOsZQLiCPl4W1Rh6/hxDBGIyhQapT3joch7UbHKUMyPTZzUt0vKDP/+XLN2GQeqV9O2Y+1nj4pn6RRHnOckdM75XF+G8Zbi3ViKXNs9MfvkkSHLf2vHXt8qgIcVpl5SBcR+symafe14/awciatIuO+8Mo+IRDCmhT/dCXUPvxC53/8Hb2NzvpQn/zyg+hQoVhQgU7mPOOTJxCYtGSQ9cxe2gQ8ifKDnTva6QAoeL7Iiv0OIeRtu7zMqdMT6lDZwNRxWRfq4VvolDbNR3+ZYyIsxfnlSwDF1z/H28Nh6N9SFaV4GIcpsCxHv2k7d2z6+uV8VA+Z3y8/5CEper/7ztAhNBxix10SPkoX9F9QsFljrtBX+jEaQ1oS9bfNIK80vukYWq557JtcKDM8mQm6fvWLyDJNtt6trfvYNESoAxm+Nw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DBBPR08MB4523.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(5660300002)(86362001)(66946007)(2616005)(8676002)(6486002)(31696002)(66556008)(53546011)(66476007)(44832011)(8936002)(316002)(52116002)(186003)(508600001)(966005)(36756003)(38100700002)(31686004)(83380400001)(2906002)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Nmh6TEpVZWd6VGY4U0pvRVJJTFd3TkI1UXRpVVBmOXVma3JoNFlOWVo5bVEr?= =?utf-8?B?OEJVQ00yWnlidWZyaTNqWEpydlJXc0RDSlVpSEp1cXVIQTJCd1lBNEt1S3Jl?= =?utf-8?B?NzlrY0N1cVkvdnBYQWVybnRCYjJiaTliZmxrNS8xWSt2Y3dtVWpNV283eldt?= =?utf-8?B?dnkzS0Y2TW43bWVuaFVSNGJjYUtPbmp4VjdDNU5BR09BcHFsNmdJU25Icmta?= =?utf-8?B?V2Nmdm9DRjBWRUEvK2lORndQbHF4d3hqQjU1Z1RaTkhLSUdhUys5aDFDbnlS?= =?utf-8?B?bzVuTU02R3pvVW5aaFl3QUdIb2xQOXVtOTAwWlBUaC9MMklOa2ltVmphbWlm?= =?utf-8?B?MlBlTTYyYnp2azltTlRkUWJOT1VpZHlFd09aZDVpK29uMzFYUTNaZUJPcGQ3?= =?utf-8?B?akhxSGFaci94VVkzdVpmeUxFWXpQZWwyL1RUTWFDM1ovRGdhUjFKdHVQWmY5?= =?utf-8?B?ZXNIRmFwRWxDSlMwdDFTSDlZQ3dpKytPQUdaelp6c3FTdGNIb3hDcnBQWUlp?= =?utf-8?B?MW9yeGhacTlsTVQxQlF3eEVzOUJac1JzNUYxRTJCNlhmL2ZPMXYwY2pMd2hU?= =?utf-8?B?RlQ1Zkhkc3NrL1ViSjdFU2JCN3ZBdHF1M1dESXJiNWZheEJNL2g3Mkx5Qmk2?= =?utf-8?B?TjFDa044MjA0UU0vTDYveHI2SzlTbTRkVW5rWm9iQmkvUDZJdjdxRWlJSXBF?= =?utf-8?B?V243bUJXQjNQZmtQaHVHQlZCNXBESHNnUVkxUjJzanVDZDFZVkJIRHJMV0RN?= =?utf-8?B?Z09Uc0VsMzVUeFgvL2NPMlIxY3lRaVhJQTlyYSsxeFVkM082MWhNOGRmVUpM?= =?utf-8?B?aDloR3lOd2JpVmVOUHlkZUdtc3ZtM3JqVjVIR3JReHNOb1ZiQjMvUzNLbWFX?= =?utf-8?B?SVoyVVRnd1ZPeW1CQitYYmJNVlp4U09tQmU0cGQvcUNkQzB3N1RtOGlDZ01B?= =?utf-8?B?a01Za1FqT2U5V1Z3elZwbTdLVnNCemZhVzNGcnZzWmJLSkhydmNJYWdtaC8y?= =?utf-8?B?N2VMekNvWWxGbmttSHFLV3IzK2kyUEkrQWtCREo5UjlHZ1pJNjZ6WldVYy9v?= =?utf-8?B?VjRhQjZIaWFVQ1VEVWZzekNYSDFPV0VzMS9aT3FONXc5eVorMWQzbHZLVU4x?= =?utf-8?B?WUg4WnM1VzMrSGV1eDQxYnFlVmQ4aStKZ2FDWG90endpSnZpSXBRa296UEJG?= =?utf-8?B?UVlOQ1MwZXN1NE5KWTE5Y3FFbWFpaGQ5QXpaTGVnS1I2VWxvRm5QeHZ5TDB1?= =?utf-8?B?TTJiZVc2bkU5dnlhdXFuTzkxa29mam5mQXhldVhKR3ljR2l1T0Y2RUplOHJY?= =?utf-8?B?NVR3U0Q4VUdBSHhDbXJlQmExVklWR0ZscXFsNytrcHFGaW1kY0NTRzZVR21I?= =?utf-8?B?akFkcjJQT0xvWG5RQ05jWkQ5eVBBTlc3NGtpaHNwOWlTT0I1VXlrZTRQWG4r?= =?utf-8?B?UmJ1YXU5b0FTOFpiU2xOazJ6dTNGWVI4UUs5VjBQVExGa3BMMDk1UHhkSFFi?= =?utf-8?B?bWVrbWx5VkJtNGZaQW5yaXJCMXJmOGc5UThEQmlJblNrRTFuUEZnTjE1eE8v?= =?utf-8?B?cWxyRC9DTCtFZDVLR0tFWUc2bFdqSllrV1Q2N3NBaDNzdzRxa1o4d0tnVWR1?= =?utf-8?B?TUlyeDIzMTgzenMzSkZKd2wvcTFxWUQyZkhMTTJkRU9Senp4OGl4ckY4cDFr?= =?utf-8?B?RmdRUVFNK1AreGtHaXZsL3JrQnJWd1ZaTkwzcE8xWWVia0d6UkRuQWt6Q3NO?= =?utf-8?B?VUpOS1NocFl0MEYyb1c0ZFBXZHFJOWpnUUZ1RVZ5TjZHYnI2VzdOL2tudmJp?= =?utf-8?B?bXA4SFlzSzMwOE1YZUZyalZIM3Q2NDM0NGsvdEMxWE1weWFRR2I2bEp1TWNJ?= =?utf-8?B?TndXd29RWXduSzlwaFBXUjJ5S2w4aWk1bDdCaCtYK0d1QlJrSmRBQnhIN1lw?= =?utf-8?B?dXNPUnBuQXIxbzI4MnJORHJIUWtWY0NSSTgxMnRqYkI0cjJLMHFlc2x1T1ly?= =?utf-8?B?eFNlSjJmOEI0NGdtczIwdTliT1pOcGtib3ZEUTVXRjFSNS9BcjI0Tm5OUFlE?= =?utf-8?B?aEh3cVN4b3BYWXJISFJLMHJNOVkyczcxZ3g3WnduMFlkN3ZrSUJka20rZTN4?= =?utf-8?B?QmxpNERTTncwc0NUZVpCbTJBUDBMSDlVK09TTHhLWVRUd1N5ZXBqdnZmdjF1?= =?utf-8?B?dXY0aUZyVkUydkNaQ0wzbDEwOFlBRW80Z1hqcHQ4K1dUTVpub2d4NnQ2ZWVu?= =?utf-8?B?RVYxRHY1VDJGdVBZVGExQUdXeTVBMGhQcm5qTlQ5Mm9Qc0tYd0pVNXRwYmFJ?= =?utf-8?B?YlpVQTZhT24raEphRk1Sc2hvSTlBOGoybWROdjI4RlpZYktRZkFqaCtUQVpR?= =?utf-8?Q?fILuqK8i2rFDvHAg=3D?= X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: 981ae660-f930-415b-61ac-08d9bafa650d X-MS-Exchange-CrossTenant-AuthSource: DBBPR08MB4523.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Dec 2021 09:58:05.2000 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: e94ec9da-9183-471e-83b3-51baa8eb804f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: OfmTrtx8qJXBUsvWWKhvgLWZcs+tPBv6CU53FS+cJOo9PJwTapVR+9bWVaB14rpO16soZMGcUZdRu8GX3Gq/kk7O+/rAsRkOOIIsy2iFwCM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB4524 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on metis.ext.pengutronix.de X-Spam-Level: X-Spam-Status: No, score=-4.6 required=4.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MSGID_FROM_MTA_HEADER, NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Subject: Re: [ptxdist] [PATCH 1/2] ptxd_make_world_{dtb, dtbo}: add support for device tree overlays X-BeenThere: ptxdist@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "ptxdist" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: ptxdist-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false Hello Michael, On 12/9/21 9:53 AM, Michael Olbrich wrote: > On Thu, Dec 09, 2021 at 08:20:05AM +0100, Michael Riesch wrote: >> On 12/8/21 9:31 AM, Michael Olbrich wrote: >>> On Tue, Dec 07, 2021 at 06:30:54PM +0100, Christian Melki wrote: >>>> I like this take on dtbos! >>>> >>>> On 12/7/21 16:39, Michael Riesch wrote: >>>>> Make ptxd_make_dtb more general and provide suitable wrappers to >>>>> support the generation of device tree overlays. >>>>> >>>>> Signed-off-by: Michael Riesch >>>>> --- >>>>> rules/post/ptxd_make_world_dtbo.make | 21 +++++++ >>>>> scripts/lib/ptxd_make_world_dtb.sh | 82 ++++++++++++++++++++-------- >>>>> 2 files changed, 80 insertions(+), 23 deletions(-) >>>>> create mode 100644 rules/post/ptxd_make_world_dtbo.make >>>>> >>>>> diff --git a/rules/post/ptxd_make_world_dtbo.make b/rules/post/ptxd_make_world_dtbo.make >>>>> new file mode 100644 >>>>> index 000000000..61babc653 >>>>> --- /dev/null >>>>> +++ b/rules/post/ptxd_make_world_dtbo.make >>>>> @@ -0,0 +1,21 @@ >>>>> +# -*-makefile-*- >>>>> +# >>>>> +# Copyright (C) 2020 by Michael Tretter >>>>> +# >>>>> +# For further information about the PTXdist project and license conditions >>>>> +# see the README file. >>>>> +# >>>>> + >>>>> +world/dtbo/env = \ >>>>> + $(call world/env, $(1)) \ >>>>> + pkg_dtso_path="$($(1)_DTSO_PATH)" \ >>>>> + pkg_dtso="$($(1)_DTSO)" \ >>>>> + pkg_dtbo_dir="$($(1)_DTBO_DIR)" \ >>>>> + pkg_kernel_src="$($(1)_KERNEL_DIR)" \ >>> >>> Right, reaching into the source tree of another package is always ugly. >>> Make sure that _DEVPKG is set to 'NO' for the package. It's already >>> set for the generic kernel package (out-of-tree modules need it as well) >>> but not for the kernel package template. >> >> Could you elaborate a bit on why this is required? >> >> What action should be carried out if this variable is not set to 'NO' or >> must this not happen in the first place? > > If pre-built archives[1] are used are used then the source tree may not be > available. So if the source/build tree of a package is used by any other > package then _DEVPKG must be set to ensure that the package is always > built. > > It's a somewhat obscure feature of PTXdist. > > Michael > > [1] https://www.ptxdist.org/doc/daily_work_section.html#using-pre-built-archives > Thanks for the explanation, now I understand why this is necessary. However, I am still not sure what I can do about it in this patch series. Can I really change the _DEVPKG (e.g., KERNEL_CUSTOM_DEVPKG where KERNEL_CUSTOM is derived from the kernel template) at the time world/dtbo is called (from MY_OVERLAY package)? Would it have any effect? I guess I can output a warning, but as far as I understand the damage is already done at this point and if there are no kernel sources in MY_OVERLAY_KERNEL_DIR the dtc command might fail miserably. How would I determine the kernel package name from the kernel directory to begin with? Best regards, Michael >>>>> + pkg_arch="$(GENERIC_KERNEL_ARCH)" >>>>> + >>>>> +world/dtbo = \ >>>>> + $(call world/dtbo/env,$(strip $(1))) \ >>>>> + ptxd_make_world_dtbo >>>>> + >>>>> +# vim: syntax=make >>>>> diff --git a/scripts/lib/ptxd_make_world_dtb.sh b/scripts/lib/ptxd_make_world_dtb.sh >>>>> index f5e796b9d..c1ded5ffb 100644 >>>>> --- a/scripts/lib/ptxd_make_world_dtb.sh >>>>> +++ b/scripts/lib/ptxd_make_world_dtb.sh >>>>> @@ -9,18 +9,10 @@ >>>>> ptxd_make_dtb() { >>>>> local dtc dts tmp_dts dtb deps tmp_deps >>>>> >>>>> - if [[ "${dts_dts}" =~ ^/.* ]]; then >>>>> - ptxd_bailout "'${dts_dts}' must not be an absolute path!" \ >>>>> - "Use _DTS_PATH to specify the search path." >>>>> - fi >>>>> - >>>>> - if ! ptxd_in_path pkg_dts_path "${dts_dts}"; then >>>>> - ptxd_bailout "Device-tree '${dts_dts}' not found in '${pkg_dts_path}'." >>>>> - fi >>>>> - dts="${ptxd_reply}" >>>>> - dtb="${dtb_dir}/$(basename ${dts/%.dts/.dtb})" >>>>> + dts="${dtb_source}" >>>>> + dtb="${dtb_target}" >>>>> >>>>> - dtc="${pkg_build_dir}/scripts/dtc/dtc" >>>>> + dtc="${dtb_kernel_dir}/scripts/dtc/dtc" >>>>> if [ ! -x "${dtc}" ]; then >>>>> dtc=dtc >>>>> fi >>>>> @@ -39,16 +31,16 @@ ptxd_make_dtb() { >>>>> -Wp,-MT,${dtb_deps_target} \ >>>>> -nostdinc \ >>>>> -I"$(dirname "${dts}")" \ >>>>> - -I${pkg_dir}/arch/${pkg_arch}/boot/dts \ >>>>> - -I${pkg_dir}/arch/${pkg_arch}/boot/dts/include \ >>>>> - -I${pkg_dir}/scripts/dtc/include-prefixes \ >>>>> - -I${pkg_dir}/drivers/of/testcase-data \ >>>>> - -I${pkg_dir}/include \ >>>>> + -I${dtb_kernel_dir}/arch/${pkg_arch}/boot/dts \ >>>>> + -I${dtb_kernel_dir}/arch/${pkg_arch}/boot/dts/include \ >>>>> + -I${dtb_kernel_dir}/scripts/dtc/include-prefixes \ >>>>> + -I${dtb_kernel_dir}/drivers/of/testcase-data \ >>>>> + -I${dtb_kernel_dir}/include \ >>>>> -undef -D__DTS__ -x assembler-with-cpp \ >>>>> -o ${tmp_dts} \ >>>>> ${dts} && >>>>> >>>>> - sed -e "\;^ ${pkg_dir}[^ ]*;d" \ >>>>> + sed -e "\;^ ${dtb_kernel_dir}[^ ]*;d" \ >>>>> -e 's;^ \([^ \]*\); $(wildcard \1);' "${tmp_deps}" > "${deps}" && >>>>> # empty line in case all dependencies were removed >>>>> echo >> "${deps}" && >>>>> @@ -57,9 +49,9 @@ ptxd_make_dtb() { >>>>> echo "DTC $(ptxd_print_path "${dtb}")" && >>>>> ptxd_eval \ >>>>> "${dtc}" \ >>>>> - $(ptxd_get_ptxconf PTXCONF_DTC_EXTRA_ARGS) \ >>>>> + "${dtb_extra_args}" \ >>>>> -i "$(dirname "${dts}")" \ >>>>> - -i "${pkg_dir}/arch/${pkg_arch}/boot/dts" \ >>>>> + -i "${dtb_kernel_dir}/arch/${pkg_arch}/boot/dts" \ >>>>> -d "${tmp_deps}" \ >>>>> -I dts -O dtb -b 0 \ >>>>> -o "${dtb}" "${tmp_dts}" && >>>>> @@ -81,17 +73,61 @@ ptxd_make_dtb() { >>>>> export -f ptxd_make_dtb >>>>> >>>>> >>>>> +ptxd_make_world_dtbo() { >>>>> + local dtb_deps_target dtb_extra_args dtb_kernel_dir dtb_source dtb_target >>>>> + >>>>> + ptxd_make_world_init || break >>>>> + >>>>> + dtb_deps_target="${ptx_state_dir}/${pkg_stamp}" >>>>> + dtb_extra_args="-@" >>>> >>>> Looks ok. Do we need to do a dtc version check? >>>> 1.4.4+ I think. Maybe a bit excessive? >>> >>> We cannot build dtbos if that's not supported, so a check won't really >>> help. >> >> Ack. >> >>> >>>>> + dtb_kernel_dir="${pkg_kernel_src}" >>>>> + if [ -z $dtb_kernel_dir ]; then >>>>> + dtb_kernel_dir="${pkg_dir}" >>>>> + fi >>> >>> dtb_kernel_dir="${pkg_kernel_src:-${pkg_dir}}" >>> >>> should work. And I think this can be moved to the shared code above. It >>> works just fine because pkg_kernel_src is never set for the dts case (but >>> we might want to allow it in the future). >> >> Ack. >> >>> >>>>> + >>>>> + echo -e "\nBuilding device tree overlays..." >>>>> + >>>>> + for overlay in ${pkg_dtso}; do >>>>> + if [[ "${overlay}" =~ ^/.* ]]; then >>>>> + ptxd_bailout "'${overlay}' must not be an absolute path!" \ >>>>> + "Use _DTSO_PATH to specify the search path." >>>>> + fi >>>>> + >>>>> + if ! ptxd_in_path pkg_dtso_path "${overlay}"; then >>>>> + ptxd_bailout "Overlay '${overlay}' not found in '${pkg_dtso_path}'." >>>>> + fi >>>>> + dtb_source="${ptxd_reply}" >>>>> + dtb_target="${pkg_pkg_dir}/${pkg_dtbo_dir}/$(basename ${overlay/%.dts*/.dtbo})" >>>>> + >>>>> + ptxd_make_dtb || break >>>>> + done >>>>> +} >>>>> +export -f ptxd_make_world_dtbo >>>>> + >>>>> + >>>>> ptxd_make_world_dtb() { >>>>> - local dtb_deps_target dtb_dir >>>>> + local dtb_deps_target dtb_extra_args dtb_kernel_dir dtb_source dtb_target >>>>> >>>>> ptxd_make_world_init || break >>>>> >>>>> dtb_deps_target="${ptx_state_dir}/${pkg_stamp}" >>>>> - dtb_dir="${pkg_pkg_dir}/boot" >>>>> + dtb_extra_args="$(ptxd_get_ptxconf PTXCONF_DTC_EXTRA_ARGS)" >>>> >>>> Not sure I follow here. Must not the dtb itself be built with -@ for >>>> symbols if dtbos are used? Does EXTRA_ARGS default to -@ or something? >>> >>> I don't know much about dtbos. If -@ is required for the dtb to make dtbos >>> work, then this should be propagated automatically. Add something to >>> world/dtb/env, maybe with a noprompt kernel options >>> KERNEL_DTS_SUPPORT_OVERLAYS or something like that. And select it as >>> needed. >> >> Will change this in v2. >> >> Thanks and regards, >> Michael >> >>> >>>>> + dtb_kernel_dir="${pkg_dir}" >>>>> + >>>>> + echo -e "\nBuilding device trees..." >>>>> + >>>>> + for tree in ${pkg_dts}; do >>> >>> Please keep the dts_dts variable name. >>> >>> Michael >>> >>>>> + if [[ "${tree}" =~ ^/.* ]]; then >>>>> + ptxd_bailout "'${tree}' must not be an absolute path!" \ >>>>> + "Use _DTS_PATH to specify the search path." >>>>> + fi >>>>> >>>>> - echo -e "\nBuilding Device trees..." >>>>> + if ! ptxd_in_path pkg_dts_path "${tree}"; then >>>>> + ptxd_bailout "Overlay '${tree}' not found in '${pkg_dts_path}'." >>>>> + fi >>>>> + dtb_source="${ptxd_reply}" >>>>> + dtb_target="${pkg_pkg_dir}/boot/$(basename ${tree/%.dts/.dtb})" >>>> >>>> Static output dir path? >>>> >>>>> >>>>> - for dts_dts in ${pkg_dts}; do >>>>> ptxd_make_dtb || break >>>>> done >>>>> } >>>>> >>>> >>>> >>>> _______________________________________________ >>>> ptxdist mailing list >>>> ptxdist@pengutronix.de >>>> To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de >>>> >>> >> >> _______________________________________________ >> ptxdist mailing list >> ptxdist@pengutronix.de >> To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de >> > _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de