From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Mon, 06 Dec 2021 08:55:48 +0100 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by lore.white.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1mu8qi-0006Ot-NT for lore@lore.pengutronix.de; Mon, 06 Dec 2021 08:55:48 +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 1mu8qi-0001c0-4b; Mon, 06 Dec 2021 08:55:48 +0100 Received: from mail-am6eur05on2050.outbound.protection.outlook.com ([40.107.22.50] helo=EUR05-AM6-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 1mu8pl-0000wl-VD; Mon, 06 Dec 2021 08:54:50 +0100 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gBKJ5S8ZeshUZnjmIjiXNG/5uIebZUtCkdh1hWZoF3nCy/jIk5l5E2aJShHdpF8wr8Z2+w0fyyDMeNioDhcOHoLtSEGUft5HT4AKu2wq3NW28u20wcUFgJX27B1HoLXLrTeOm+8ev0o0Gxg17GgJa4J7ovLZs9J0zZWPtvb+GCQahDOdiaPL2hth5Q/+v9WhH4uxkimwMLcVyB72GexEkfwEtmt+5z6NBvKpCNEH9LFJ3lRNLstDrZbefnzZsXRRFpBaH3MJGl55AbIoYW9g/G/y9Ng6GjqRBL6w4qVnaTl+DAmhYLQDE5WonjbfbQttvEwzsBBkN1llSNCjrq58iQ== 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=/Wnkj9MCSHAxQdYuk3YIRUROe+O667iXN/ole0M1NGw=; b=d2KNsO9ZnxFGAL9VsHULWTJXrMMyONgwXdvr1fVd9pUKC/8Nk54zh6Uwq237M7DRkNJMHHJ49rTvDd2l39k5VkrlNb121ejAh9n7X1ZQFDITTdpBtVy35twrFDErnU2PbNzevmQ/HZJPCwLqKBR574E18TVPH8XHVwQRtIJlm9s/fURLlUmMjqcxMypFiviSo6k67xEHknthc3X3YggsKhFsQl5P3ZI/tOzUza07AxFHmuWtT4iBhBCbJSZ7fj6goB7En7i4u2hCyC9U+od/m0QNLbstxYlyoUUGfjeIBMgeof8ile+8bQKAiIuTlUPBHoXH+dNeKoFioKxM9djq1w== 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=/Wnkj9MCSHAxQdYuk3YIRUROe+O667iXN/ole0M1NGw=; b=uQsYh9tyxKfiop/anPmBrW240tGyyKvUN3RHlbuBHV+5qsZV6G93sKc9/PSb0rbd+csP4/FZBiZPq/Hp0Rd2fjqELt+TP980RpJY8Jz8v41dHqw9tMjJoBWV9EQA3sUPY8Vf9zOjIoHQdHUFy4sxV0LcB0EbGRDbBY+LFRxxlhM= 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 DB6PR0801MB2088.eurprd08.prod.outlook.com (2603:10a6:4:78::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.21; Mon, 6 Dec 2021 07:54:48 +0000 Received: from DBBPR08MB4523.eurprd08.prod.outlook.com ([fe80::81d1:d448:4016:1956]) by DBBPR08MB4523.eurprd08.prod.outlook.com ([fe80::81d1:d448:4016:1956%3]) with mapi id 15.20.4734.028; Mon, 6 Dec 2021 07:54:48 +0000 From: Michael Riesch To: ptxdist@pengutronix.de Date: Mon, 6 Dec 2021 08:54:31 +0100 Message-Id: <20211206075431.1238025-4-michael.riesch@wolfvision.net> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211206075431.1238025-1-michael.riesch@wolfvision.net> References: <20211206075431.1238025-1-michael.riesch@wolfvision.net> X-ClientProxiedBy: ZR0P278CA0014.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:16::24) To DBBPR08MB4523.eurprd08.prod.outlook.com (2603:10a6:10:c8::19) MIME-Version: 1.0 Received: from charlie.fritz.box (2a05:1141:1c9:7c00:2971:328c:3026:3149) by ZR0P278CA0014.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:16::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.20 via Frontend Transport; Mon, 6 Dec 2021 07:54:48 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ada680ec-86c9-445f-3226-08d9b88dad55 X-MS-TrafficTypeDiagnostic: DB6PR0801MB2088:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1060; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ouu7OuE447M9z4z8wevFXDLjFsGyPq89P/fYxlVF9BKbxHlSkIXYd7xiIfyZiEVRCSBqBtwym2vhOY1Hplc1SmfdMmEh7971va8MAWQyuQ5r0vwUvXv6vSreb8ycTwb9QUflCRaeuNL5CwmkJm6KwGAaFNXaVYbmM+F6i/xJO02gxQrX1a4NFR7F2BJMH1QzpSnOSIbr5EQUKZG9SBUVtRnLqqQznXUgnfM1fCIRQJvXxgbln/L2NcKD7Q4zupEkh0GRIQLW9IJ59I7zzVH54LUnyHS36Yo/FX/Z9jb9n1csrSASecsOaeO6xqotXwRVQH1pwx93DfPr9H6GCku0Tz2Nud2HNjzgAkw1qviZyKKU3MZMKrq7zSt57FM3y7PAWEfXcwnSKY+mCAWjoZz8kkqsjHaU/dXswrQSLaNpl9g3tR6xGxqKUs/+yLDlEXjqVVP3z4haH+QG+8KTiDiYkDxjy1lChaD+34GiyE0FdMCT4u68jCV3SnNYoqliIC5Ho7RWuP9zSKB9qhGFGVt90MT90BB3o+C1IAdn0lh+IJ26LnxXnh6mjQks/9gMGcySpOGpfNdyBKJwByzElRtb1/XTfxoyARiZRMXRCc1F12mytbJADsxd+JfPKZK1piEmrFd23G8yQ87EaFyba283tQ== 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)(346002)(376002)(136003)(396003)(366004)(39840400004)(6512007)(450100002)(66946007)(66476007)(508600001)(66556008)(1076003)(2906002)(2616005)(316002)(186003)(107886003)(6666004)(44832011)(83380400001)(6486002)(8936002)(5660300002)(86362001)(4326008)(52116002)(38100700002)(36756003)(6506007)(6916009)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?nVoSoVYnADj+ONWjG3ybuGjvW9U5qMCCXJRKfr1ISPmOumVQVyxgn6wdd9MK?= =?us-ascii?Q?gpKAASDFgts4FAdzK3G//u5g7utulI25dp2cBrrZqsW3dN1SfreVqDMaS3CT?= =?us-ascii?Q?qOZKlb+rtZT4jpKIDArBVM95tKsswrx9f6/xnhWwklX1aMOFA2wsLdKQ2Cny?= =?us-ascii?Q?Hf19lyw4kj2lg6nw9IdagReXdkzZaOwVU9ve+pdkb+LOVxVB5+NNN9Gtg/xA?= =?us-ascii?Q?/TQVsaL3WoJT72d8CAG996szKHf6fOqF3Utc9Zu/ADHXnG3FuuMj8KSCZmq2?= =?us-ascii?Q?L70PBX9cKp5lCXoR9c4qMg9JsKmxj9nxiW8uf8wAN3AdKwbr3fAA1Tqgr3To?= =?us-ascii?Q?DSEiB3EOJfV4TwgWe/OAffEH1skeD4y3Ptal+Z5x42tioBYcAmKsvh1opDnB?= =?us-ascii?Q?sQORecRsX37SMKe84Vt+k5FveF69i4p4QhvO/RKleRpXWdBdAT7vIuiXaqal?= =?us-ascii?Q?xJkPnWHSiqPtQVi0/aXMjsiiX8wscfuOZJt9eNR6kNQtr79GJEVpILZpijkh?= =?us-ascii?Q?BLS2MmRlqjng7dGzQ0m3qkbI8ShCxoP7J2AEeWQhWAum1q2Z20OUQvE7uREB?= =?us-ascii?Q?OraylP/6gVqzgu6ypSF1ygabQQXCHtYgzFpqlanClkw/xTng/heD1qLcHg+U?= =?us-ascii?Q?7Hro6tNSxJGjSyKHfK6OsR9/2QdOuV8ioqqtw1hozUno2F4wBpnskA3ZesvC?= =?us-ascii?Q?1uzItB2hpVfEZ3z83KWbpC9LjIzA9/6Dy8AK6cHGX69MaQ3xsxQM+jcvIYq5?= =?us-ascii?Q?Z4hRttdPQOSvmcdClgrzImUdGOhJXh/GkD6leix8UNgpwl2PeabiaTrWjgT4?= =?us-ascii?Q?oNJN0GxVRKIW+SwUPpIs4+U54XTiROM36VwX0SEm6E6PuRS9xP83BNEaAYqu?= =?us-ascii?Q?osuZq/lL/VOf0xjsFKTe22nWll+lacPuTLzSBp/dxeJVv143oZVLAwYybcET?= =?us-ascii?Q?KkBnViRpul5TYoN7njyQBVEqxIyRrTB7RYp0Qlfvr4gLtmUl8VFYeE/fwp78?= =?us-ascii?Q?LbWKlzS6pHmBIWE3XDefmjUAB32a8xEjN4vxJh5AyY5j94ltD/YHI+8X3kHL?= =?us-ascii?Q?/2gWWKZc0Kky8bp4o+WlIT/D57BwUdOgZwVarejHV89QZD33ZvH+AfVJ0Xhd?= =?us-ascii?Q?186KNVrrhAY3mcTyO3GGZS8eR3+lDQgqJ+1vZ1Vro1m7nGtibl7Li3oqqUY2?= =?us-ascii?Q?Mhc+tBYEBf2htsiigWmaewxPcPwG5uEqoy29JBnQfeUp6OBL23SIryRRuxwN?= =?us-ascii?Q?E6lo0siZcTb21q3wwKJWVU9VKwaAqA9vNxLYpjScF5z9ATGTKa+1Co/QMzNm?= =?us-ascii?Q?f3AiLXfHAkQ9m0ZgYRIuTWDXBW7Aol6XckhHtNmYuyO3cTytEcEt9btbhrW9?= =?us-ascii?Q?qnU3wiHFKvflIgZCXsLdPAVe2QGjaA1h85FBOX1j7h9y1QD/l0r7scMaeF6M?= =?us-ascii?Q?u9DyYw3IybEZl6W1rjpXTRF1kEDc/yXHwFYCOBPNI5XdhefHsvoEt4+t/s1r?= =?us-ascii?Q?UodKAEMTV1nL13b7R55m1Ryqj+BwK7f4aJt2vJhGmjZ886+5FQ4MxNG/XJ6o?= =?us-ascii?Q?Ti7f/ewhJtNBcqht/tQWOmtfddB/uJ3MquUkdaIFKQZzhkH4rafmJolxzmWp?= =?us-ascii?Q?w70YBbegdVgqF7/Xfkw4tR4SUnNZHzd2VRLPDeWNeWPesbaBEpgYZ84jEKxm?= =?us-ascii?Q?nACgwFYKd9E4tyabaOsJ6PAAS/sQ2B03trHRJCEuHpS5f0HiaZONnTXdyBM9?= =?us-ascii?Q?cTW8sce1mA=3D=3D?= X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: ada680ec-86c9-445f-3226-08d9b88dad55 X-MS-Exchange-CrossTenant-AuthSource: DBBPR08MB4523.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2021 07:54:48.8756 (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: wMCPKJ+n8sdVXwe0UHVTlig//SadJJNzSaCEuFwxhqwH7zGWsP636c1iJ2Ak2S7bi4JexdbQRkaKOJMYXBSrNXcVeUUYMI3649L4sRyeAVs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0801MB2088 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on metis.ext.pengutronix.de X-Spam-Level: X-Spam-Status: No, score=-3.2 required=4.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Subject: [ptxdist] [PATCH v2 3/3] barebox: add integration of firmware blobs 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 Cc: m.tretter@pengutronix.de, Michael Riesch 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 In some cases barebox requires firmware blobs, which may be provided in binary form by the vendor or compiled in a preceding step. Add the possibility to specify files which are injected in the barebox source directory during preparation. Signed-off-by: Michael Riesch --- platforms/barebox.in | 31 +++++++++++++++++++ rules/barebox.make | 6 ++++ rules/post/ptxd_make_world_inject.make | 19 ++++++++++++ scripts/lib/ptxd_make_world_inject.sh | 43 ++++++++++++++++++++++++++ 4 files changed, 99 insertions(+) create mode 100644 rules/post/ptxd_make_world_inject.make create mode 100644 scripts/lib/ptxd_make_world_inject.sh diff --git a/platforms/barebox.in b/platforms/barebox.in index d35d16501..150fcc77b 100644 --- a/platforms/barebox.in +++ b/platforms/barebox.in @@ -15,6 +15,7 @@ menuconfig BAREBOX select HOST_IMX_CST if BAREBOX_NEEDS_HOST_IMX_CST select HOST_LZOP if BAREBOX_NEEDS_HOST_LZOP select CODE_SIGNING if BAREBOX_NEEDS_KEYS + select FIRMWARE_ROCKCHIP if BAREBOX_NEEDS_FIRMWARE_ROCKCHIP prompt "barebox " bool help @@ -55,6 +56,29 @@ config BAREBOX_CONFIG This entry specifies the .config file used to compile barebox. +menuconfig BAREBOX_FIRMWARE + bool + prompt "integrate firmware blobs " + +if BAREBOX_FIRMWARE + +config BAREBOX_FIRMWARE_PATH + string "path(s) to firmware blobs" + default "${PTXDIST_SYSROOT_TARGET}/usr/lib/firmware" + help + Define path to the firmware blob(s). Multiple directories can + be specified separated by ':'. + +config BAREBOX_FIRMWARE_FILES + string "firmware blob file(s)" + default ".bin" + help + Select the firmware blob to be integrated into the barebox + source before compilation. Multiple dts files can be + specified, separated by spaces. + +endif + config BAREBOX_EXTRA_ENV prompt "extend the builtin barebox environment" bool @@ -146,4 +170,11 @@ config BAREBOX_NEEDS_HOST_LZOP lzop is used in order to compile lzop for your development host. +config BAREBOX_NEEDS_FIRMWARE_ROCKCHIP + prompt "barebox needs firmware-rockchip" + bool + help + Select this if barebox needs the non-free Rockchip firmware + blobs. + endif diff --git a/rules/barebox.make b/rules/barebox.make index bea9f3adc..a81fc86b3 100644 --- a/rules/barebox.make +++ b/rules/barebox.make @@ -26,6 +26,8 @@ BAREBOX_BUILD_DIR := $(BAREBOX_DIR)-build BAREBOX_LICENSE := GPL-2.0-only BAREBOX_DEVPKG := NO BAREBOX_BUILD_OOT := KEEP +BAREBOX_INJECT_PATH :=$(call remove_quotes,$(PTXCONF_BAREBOX_FIRMWARE_PATH)) +BAREBOX_INJECT_FILES :=$(call remove_quotes,$(PTXCONF_BAREBOX_FIRMWARE_FILES)) BAREBOX_CONFIG := $(call ptx/in-platformconfigdir, \ $(call remove_quotes, $(PTXCONF_BAREBOX_CONFIG))) @@ -94,6 +96,10 @@ ifdef PTXCONF_BAREBOX_EXTRA_ENV @rm -rf $(BAREBOX_BUILD_DIR)/defaultenv/barebox_default_env endif +ifdef PTXCONF_BAREBOX_FIRMWARE + @$(call world/inject, BAREBOX) +endif + @$(call touch) # ---------------------------------------------------------------------------- diff --git a/rules/post/ptxd_make_world_inject.make b/rules/post/ptxd_make_world_inject.make new file mode 100644 index 000000000..b7d28e92f --- /dev/null +++ b/rules/post/ptxd_make_world_inject.make @@ -0,0 +1,19 @@ +# -*-makefile-*- +# +# Copyright (C) 2021 by Michael Riesch +# +# For further information about the PTXdist project and license conditions +# see the README file. +# + +world/inject/env = \ + $(call world/env, $(1)) \ + pkg_inject_path="$($(1)_INJECT_PATH)" \ + pkg_inject_files="$($(1)_INJECT_FILES)" \ + pkg_source="$($(1)_DIR)" + +world/inject = \ + $(call world/inject/env,$(strip $(1))) \ + ptxd_make_world_inject + +# vim: syntax=make diff --git a/scripts/lib/ptxd_make_world_inject.sh b/scripts/lib/ptxd_make_world_inject.sh new file mode 100644 index 000000000..bc06b9503 --- /dev/null +++ b/scripts/lib/ptxd_make_world_inject.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# +# Copyright (C) 2021 by Michael Riesch +# +# For further information about the PTXdist project and license conditions +# see the README file. +# + +ptxd_make_inject() { + local source target + + source=$(echo $inject_file | cut -d ":" -f 1) + target=$pkg_source/$(echo $inject_file | cut -d ":" -f 2) + if [ -z $target ]; then + target=$source + fi + + if [[ "${source}" =~ ^/.* ]]; then + ptxd_bailout "'${source}' must not be an absolute path!" \ + "Use _INJECT_PATH to specify the search path." + fi + + if ! ptxd_in_path pkg_inject_path "${source}"; then + ptxd_bailout "Blob '${source}' not found in '${pkg_inject_path}'." + fi + source="${ptxd_reply}" + + echo -e "\nInject file $source into $target..." + cp $source $target +} +export -f ptxd_make_inject + + +ptxd_make_world_inject() { + ptxd_make_world_init || break + + for inject_file in ${pkg_inject_files}; do + ptxd_make_inject || break + done +} +export -f ptxd_make_world_inject -- 2.30.2 _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de