From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Mon, 24 Jan 2022 13:10:56 +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 1nByBU-00Bsxi-Jp for lore@lore.pengutronix.de; Mon, 24 Jan 2022 13:10:56 +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 1nByBT-0007ws-89; Mon, 24 Jan 2022 13:10:55 +0100 Received: from mail-eopbgr140081.outbound.protection.outlook.com ([40.107.14.81] helo=EUR01-VE1-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 1nByAb-0007IU-Km; Mon, 24 Jan 2022 13:10:02 +0100 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F4o6hQpWLsREVhSi5YkBay7Jj4snUy54YhJ2Sa5DmIZiVVYEGUn/oTj90I8O8dY4Cpe5F/og8gol1mXukEfVYVpJWSbSW01mDJ+mm2x67G5aShJ2izhzqwLoLgySv4F/ubE2A2T4pjcgIPHclUl9PiJKpy9trESWBO8q0+TQ6QUFbMnInTLFUpFhGgpAyFcXNuR8vCD6pabZnAj6jxzS3apfKUlXtmNHZgotrFIdo8ayx+L38mmuKqJDSoaIw+HZXIjotO69wTOHZhBU065RolimBT50LblZVIJd5V94yQqvoq16Nn/OR9Cwo47hDG2RNvL4LrHwXAgf+FqrUAOT3A== 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=VYSycSY7xg+87yLYqsfwfUxrPnxT+uyidbl/GiNFTxPVX/a8CYKQpQx3LLlWo7y7L4idf5gswgpA4xWDDFKb6twZ1IUpKZkm4HJk8iwH/ept6E6uTCwzDxi2FuZDpa4O9B2at1yhNDTBWWdzY4XB67OUTLcT1yqjeUFXCxMtbSiAzJwUYjnC521s+erCU6wSg+0yfpCAD4IAnaLfp5BRJ/dvl19nSl4P35o6ZQBWgjTRTP/QCPkrOYHBTCCv2CJjzxTdMuR/kiVGCHDRJBuNdNTQP5wZiOUkqsOlBDvebYKpuqaEYOLvBQdRX5o6++dlkS5FBpRzOsrxEW46pe6bUw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=QGfpjZl0wC/F2yr3AT9jvhi6TPqd/ITcCcTqvlfMZITHf+mbUUJiJrLdu1JAJdchqgKbwcheHPvgvTyWkTmY97j3hGo+mOhn1LUqvzAzhfs2FxUvcG6ctzDcLBLtgfTf2WrwWQot7q5YfD+T/6TizSKSddikqF7AnZgi/rdOm+0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=wolfvision.net; Received: from HE1PR0802MB2426.eurprd08.prod.outlook.com (2603:10a6:3:e1::23) by AS8PR08MB6962.eurprd08.prod.outlook.com (2603:10a6:20b:347::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.10; Mon, 24 Jan 2022 12:10:00 +0000 Received: from HE1PR0802MB2426.eurprd08.prod.outlook.com ([fe80::e14f:197:5001:4c56]) by HE1PR0802MB2426.eurprd08.prod.outlook.com ([fe80::e14f:197:5001:4c56%3]) with mapi id 15.20.4909.017; Mon, 24 Jan 2022 12:10:00 +0000 From: Michael Riesch To: ptxdist@pengutronix.de Date: Mon, 24 Jan 2022 13:09:40 +0100 Message-Id: <20220124120942.557161-4-michael.riesch@wolfvision.net> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220124120942.557161-1-michael.riesch@wolfvision.net> References: <20220124120942.557161-1-michael.riesch@wolfvision.net> X-ClientProxiedBy: ZR0P278CA0177.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:45::11) To HE1PR0802MB2426.eurprd08.prod.outlook.com (2603:10a6:3:e1::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 740f0262-0643-4398-2f40-08d9df327234 X-MS-TrafficTypeDiagnostic: AS8PR08MB6962: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: /Gdry/sN2pT8Hu1xNz6ziCAyOEVsT6jZXOg2WUSrZCO0DJEQfKy/qgSHqxjYxqymIFsfKBennDByin4yLT/onVXkiFxIjCYFNiBg2lZHVqE/u46tBjMC2Usnr8faQQYW2gjD2JFvgSvRbX6FYGZyU1kpr0ijJZJgj+tb2JQcmtI429FAqr6h8Yv7QavWAGdp0he5ITMaQS8DdHOvPllztf/ig5j3aJBrEK68F0Nt1BEWKizYdCsvtKI4SBPYrGS/ihsVqsWS495BUY2d49q3IsMtFKuMEWfzCdvCVbTbKyhmiL3qJlBfJ7ZBc9LDDmVf4RS/TTC2SUswAPNAHiHHQOyY9io4SAdq8f1rE77fofOSKY69pB26ZbF/+yG4kLgN/75dzdintpgGLOX/ZQbEQ6R6exa9ysfbNtQIa1LamCLPgL3IxKqupYPT7OfLaa0EuF5CcrQI/u3afzBrRHdg8D/dUM3yQ2fKow1nCDQ8JxkPyfa3ezsdwMYHht/6tLJuryncfAYfpU9QT6Xj0WVSgYCFji7xHAjDRkgAMhHTYMeCZo7udgLXSk4GHuY3o+CQBpkVPg8oMJn13O4BRs7LDbFrfDNP1+jmTqY4LHhbl3Ls7Si5M2jxWqZMdlEVXIr8sttaWEgscd0X6mKQxUhtYw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:HE1PR0802MB2426.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(44832011)(66476007)(8936002)(316002)(6666004)(6916009)(5660300002)(6506007)(8676002)(66556008)(107886003)(2906002)(1076003)(36756003)(4326008)(52116002)(508600001)(66946007)(2616005)(6486002)(6512007)(38100700002)(86362001)(186003)(450100002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?nkCc4d/KdL2FO/sT0Joy16zCSuP2qIeLBTjBnKxJ6mf8p/v7ip3n6gPUn7dw?= =?us-ascii?Q?punELxqnMIqf/biyq0XjXPm58KR1ivZokRzAQWM15i+bSeGkBQZJjX3lbnVh?= =?us-ascii?Q?+aXfMI/3DcpNytek/UvaEH6z3ejaeyqiBoD7wUDCc6i+6u2tahh4NYMWsjeN?= =?us-ascii?Q?X/Xw5b8brdovEW1xHwMUzfX3ukniTEaDPhz9cKHJ6NAUp3wuUlDD7IvJoJ/o?= =?us-ascii?Q?7q/j58FM+uaH8y1NFGJQsWWWQ9W/X7/N/Lr0zJ2lcio4RzukhkAzSJTD0CWv?= =?us-ascii?Q?BX6QokSAMliLLdCianhpuiKGkLACZV6y/EPI3QG2DJFGyV29syQbSTbj0Wie?= =?us-ascii?Q?QN3ApiUKciQNZCNOFG/DX83kpaP9nVuuGVSyNEEbBCU32tCp122k+v5LnPIY?= =?us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GxZbt3nzkMyEWOEUW4Hfc/bHPR?= =?us-ascii?Q?msxLfhClmWmGs6vI6qK+TOufp0oC6NBcOKf7EFF3I5w4ncHrBRTpuW40ONj7?= =?us-ascii?Q?X/q8W6a6QBOyj1GuKK9hU13cxJVJOHHf+Dpu/CtZkFQabWx2o3RdgzpGEAuA?= =?us-ascii?Q?Wq7VFFKk6CE/CQ0LxEQdJkxREajzK7X6DtwY8etMnscQ+tCaQzJEHtIjTBIm?= =?us-ascii?Q?AE5GRqEXvkibGL30jDLqgXXCz8SpWzxo1DCpE0//tuA8pxqNVgvrDl1UnULo?= =?us-ascii?Q?HGGh58PcjmirC0eEMCnhp5StEX95zokOpKkYnx3kUvGsqU8DmJcmoLKjNlPd?= =?us-ascii?Q?gkz4ItEmFr3qZXQ8y414dOVII+Mg9T3JVg2XBI9CRBMxKpja8jZRZe8c7E+6?= =?us-ascii?Q?YVGp04kwRoYUDR5w9ubyr9gdP5gsmwFV4SZt/xcI8wisfi8xUbM2hlmD3+fT?= =?us-ascii?Q?1UnCtPaD0Q=3D=3D?= X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: 740f0262-0643-4398-2f40-08d9df327234 X-MS-Exchange-CrossTenant-AuthSource: HE1PR0802MB2426.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jan 2022 12:10:00.8286 (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: 5QM/tIDj1+gH4Tn/jD5mS/1lBV4c3WRmL+mXyiUU8HF/9SGEPWezqsM66YjTAAuKNIhWkqBkHroRx0HDiSZrCYTQgQ8DdhYuLbSjF/lgEqs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6962 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.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 v5 3/5] 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