From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Mon, 20 Dec 2021 13:10:08 +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 1mzHUW-00Cd5g-0P for lore@lore.pengutronix.de; Mon, 20 Dec 2021 13:10:08 +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 1mzHUU-0004Gq-Pe; Mon, 20 Dec 2021 13:10:06 +0100 Received: from mail-eopbgr80050.outbound.protection.outlook.com ([40.107.8.50] helo=EUR04-VI1-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 1mzHTh-0003re-35; Mon, 20 Dec 2021 13:09:20 +0100 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KZRHOTGsfdiTY+6RTUrbfFrXuK0lbB3oNLW7PXPNbchUQIonYjXphBkiPtAydazivKRzFrPC2T6mPNNZ3PhlTU6EA7dar15hEKVixkM8iioh3HjtU5LV+4gxiPVKNUsmmTcng00BSibJVPjAgcMJ6KEDbGWPMdzKWVHdk3WzNWukrch8zaxToez6YCP8zYZUnmYf5e8gR4dAYsPZlHMaOXxMiSnLFSAtLzP9NsRdRS0fvvquLN8glFeJqmKE3hu1I54im3yehZw0dmoQ9qo1hRfMj+BnBlThHFjXPib2wv7kWxA1JaIZEOms4huD7VHSkAg4WhOYqdnkVUHO86SpTA== 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=9njTOVblHD0qfvZxSK+5y38i4dolqArn3WvKd2WZbSE=; b=NduFTD6KZQgQ50aJEXewM994M0u6u8yWcFZbj8NEFCQ5h+NOhl4t2jEeTN5PJ0bNg7yAtBT26qZgigANS97E2r89uEKgYT1baO2eO7gFIkKoLG0fwre66PVNgusaMLJPCICQMWd2uZy/M1ZkCus5BcIK1zHr8bWTYqKRhBAzLNkeuOmemgYiKsBp25T6iLGJ9aXNV3lj/vGqrfiUBXHWkOJM627P5R1LYDrZ+6JQ8vJVQbmea6VZU0FEz0n3ywPd2T6Uua1/ufX5GmI+wKqfP5Dak/7v4JVlyBgNI6BP+JkprFg02COGKJfxJflBxkuc8UiIAasqyug0QBKC6BQ4qg== 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=9njTOVblHD0qfvZxSK+5y38i4dolqArn3WvKd2WZbSE=; b=F8cHD/rKuY90LWJaYqSEcVkJVtoH6WDv6pJoNJO5Su2wdnR5QPUvgGvDAUwYCMBlfh1MUeFkJKFMMFzaBnBRoLXbjm9ws689gW2MXAVBUVe4IYGOjV+MAeq6G1+m1cjz9X8cuWkdXbjjPoOYFAYNjt3Wp2dtb8g0E7Ycb3BGHy0= 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 DBBPR08MB5224.eurprd08.prod.outlook.com (2603:10a6:10:f1::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4801.15; Mon, 20 Dec 2021 12:09:14 +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.4801.020; Mon, 20 Dec 2021 12:09:14 +0000 From: Michael Riesch To: ptxdist@pengutronix.de Date: Mon, 20 Dec 2021 13:08:56 +0100 Message-Id: <20211220120857.3672237-4-michael.riesch@wolfvision.net> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211220120857.3672237-1-michael.riesch@wolfvision.net> References: <20211220120857.3672237-1-michael.riesch@wolfvision.net> X-ClientProxiedBy: ZR0P278CA0022.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:1c::9) To DBBPR08MB4523.eurprd08.prod.outlook.com (2603:10a6:10:c8::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4a8affbd-7eca-45dc-ff1e-08d9c3b189d2 X-MS-TrafficTypeDiagnostic: DBBPR08MB5224:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gRqgJ+k82Xwk0VY2/Ljz94pDC5Rt8wCRTdjVynH+g1wevUvUQf7Zk8Q18yio4eOX73wE/EYpMraeg6mnFDxXN1KPYY+2/xAexD+CQ4II2rAYFSzLDeITUPW90bfSWVnhdKkjroQIoTemAuCjnc2WTnRdiwBBXSb29+hbyuEet0yWpH1wEHGHRsED8aYDxFMqGYJH+ft06F2z1chEkrGkObHLDoHcNC9ZZ4qqi5YUWBfEnzjHf46sN01Y5fkfm1rEwPZHoEATdAsxT/B1//flWoNa5Re4nIdpwmwjeG3GpaMvQOwe0970CYKhlw/g2z7mYJO760mTvLgxdpX4w+YNZZkmWr8isEXgbkolCNHDHK36Qh240nC6B6Bn8tl487EC2l6g58xzQHZZNMx3zexYThQafqXByDqVpyBuBUQKk9+TXPejoJdns5sO9RE3BBox47CRORLqSXwJ8SBOezLZKGIat6MFVbC/AMH6Lv+IeYI/EHxV9eOfiWAsx9CasKDeKGVT5hSETB4wgc6arTOMC6OfT60i614qvpngcWyhWWM91QEx4Kfgxavim9fsUxdNHCoG/v+JkiTdfVsHQDpOJh9IUDJ1jUMe4xxp9YviD2lUgAfoR/t3t08ofEjaITS7Yg43gh0XqBEEhFeHRZgElQ== 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)(39840400004)(376002)(136003)(346002)(366004)(396003)(8936002)(2616005)(52116002)(44832011)(6512007)(316002)(38100700002)(6666004)(508600001)(107886003)(2906002)(5660300002)(86362001)(6506007)(6486002)(8676002)(6916009)(66556008)(186003)(66476007)(36756003)(4326008)(1076003)(450100002)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?K92shVCKnzLD1EqnGAeTZfIyGRkCDW55VAjQVNfbFLI4kLaoBhpNVfrctPEI?= =?us-ascii?Q?7pXP/kzy6WBpVpFoYDeWDmopYJgb+8Db0dhpITsxZb+uxREw8SaFE57HVJHP?= =?us-ascii?Q?kuMyHtFkHCqYHAapqw1vCVPmF6/3pqFff4T2hOP08JYTU37fUBfcTKI+OX0I?= =?us-ascii?Q?JpwiDoSOio6Jz/Ts2pBpn9lCT69yfBl8ZyGprQ3g/Qf6VVKyZpIOQz5d4ObJ?= =?us-ascii?Q?GN8+OPtfvRgID+uArODodbCbFtUxGyPQXxt4KU4GWCB+wJScslQExZAYG5dy?= =?us-ascii?Q?Ug53XmR8hD27sj3OdHldQdpBdIT6o3Sd39AYkZ3beK2Ft1uEIs/usm+b7GXN?= =?us-ascii?Q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q9rrbxbU?= =?us-ascii?Q?tznQodX1qdXDHAWxdqymJHxaQLChQlV+bHPrz35cTXGRInhd8TDkWrcYw6dr?= =?us-ascii?Q?0oeWocphK1wxKnwr+aB319xWRF2bmJwh9rvxgW0TFXpfajV9ldGnNOFGeW3x?= =?us-ascii?Q?GGCWoD61tIEB8ccUf7jeXLBofDpOxZB9BFkInd0XXdhUk/+M36evAAFnOox7?= =?us-ascii?Q?s2bBJrL/hp/bpEOEKBCm6aPyCXI5W/tFxPgORvv7gK+67gkluwmVDs+LPau3?= =?us-ascii?Q?z0eb5VNnkq6y7uBOO9zZ7YKxcLfUD2qjcD+PVbq7AIFprtIOdSAApYNXzUZo?= =?us-ascii?Q?I6Cw2PIWU8tZFRZSbIae62fe7hhJdN3nZ5fBJNk4Yoam52JBNsNBaSHvVGTo?= =?us-ascii?Q?GGeiT4P+4UjnuZhKUi3Vjhw1EqotiEcbGTMjFr3SLUS5rz3J/xzc4WjeQXmE?= =?us-ascii?Q?+YBJ6ErPFQR+fClqYh5+7BLigNntknVIC6SCK+cN7mOKeBiVXz/xxG+PEM8/?= =?us-ascii?Q?ZjCVz3M73Q=3D=3D?= X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: 4a8affbd-7eca-45dc-ff1e-08d9c3b189d2 X-MS-Exchange-CrossTenant-AuthSource: DBBPR08MB4523.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Dec 2021 12:09:13.9859 (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: Pq6Hab2tcXC/ZRg4S9PTsxyOiUMN6SQGrgtmgcbjMByHOjnjKLip8HhKd1c35qsQq9vKH8XyM8MLvv4cpBoTCopTX82kodOKblRAEKuVHOg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB5224 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on metis.ext.pengutronix.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=4.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 v4 3/4] scripts: add helper to inject files into a source directory 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 Some packages may require certain files that are maintained or generated outside of their source repository. For example, binary firmware blobs could be excluded from the sources due to licensing issues. Add a helper that allows to inject certain files into the source directory (usually in the prepare stage). Signed-off-by: Michael Riesch --- rules/post/ptxd_make_world_inject.make | 19 ++++++++++++ scripts/lib/ptxd_make_world_inject.sh | 42 ++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 rules/post/ptxd_make_world_inject.make create mode 100644 scripts/lib/ptxd_make_world_inject.sh 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..c2e45ad42 --- /dev/null +++ b/scripts/lib/ptxd_make_world_inject.sh @@ -0,0 +1,42 @@ +#!/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 $(ptxd_print_path ${source}) into" \ + "$(ptxd_print_path ${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