From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Sat, 29 Jan 2022 08:04:45 +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 1nDhmv-00GuAQ-Kn for lore@lore.pengutronix.de; Sat, 29 Jan 2022 08:04:45 +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 1nDhmu-00071Y-Gv; Sat, 29 Jan 2022 08:04:44 +0100 Received: from mail-vi1eur05on2083.outbound.protection.outlook.com ([40.107.21.83] helo=EUR05-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 1nDhm0-0006fh-1J; Sat, 29 Jan 2022 08:03:48 +0100 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kTe2vqBg9C2ca+MPAaMsA/FDsYFCE0o311VOwQir3lLXbfVk23WHuFpia3Tq9558vqJByWiqnudZNbDG7uspgUlcKNRTScMaH6F9G2wmnFwg+9wnGasDi2CI3454O+ll+uZXjt5x49ebkIrZynL4BwGhtQ9RGW3HyyLGRb8cpBmrCUKy/zfgLenViCf6G8ijP2GnUidMO//On6FCXrNYAK5Ab3sOuYA7WKnMQFBE3aXhSbzja61kV5E36+jrswHwaptR8awVzBS8m/mZjv9vDmGti1UlCFabzmI3xWSnBRaRMwlmjeIJ9ATRfKgylh0my7U+UQzC251Lf2dNxc/T6Q== 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=W7jCXqiN1sqxn6qIllh0pzLZ/sPli+LYdfHV1f8KHxY=; b=ORPEulKDqY5woK0kXLi2IMy4FmC5N3z5xxMDh5wF8LosO3PMfFURyCyEixG2XrqE3M1JeepUZ4hecAFLs9zmbNw9O8enbnD83+tj5UFQTCEHM8cFVLoSALyIsYnBBWWVvYE6yeM7SfDWOuNU2XbpQoZVQmiPw2Bo/d52X0gDp2QZFXKzvPxPoMLB9i4WTvVVw3TVxfvtEIUZI+e6BLf3StXywTrmKvpqew4diPswHEj/8vrm6dF60rShuV6p/hRjA/1Sdkqi4eHvPjgkMroY9IH5DuHfJDWqOrGGvSlZ4eEhQTlrHltfHVkpLxjbn3Sr55f6+QDYeTaF8rz+FMYUDQ== 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=W7jCXqiN1sqxn6qIllh0pzLZ/sPli+LYdfHV1f8KHxY=; b=Tw0aWpMcJYGnsOjk4qwcuKxmh8nnwh5JDg9Fl55Zbx9hYrA/wEq+K12QgU9UVwMC9lXsHi593Fb5zVV6scXZybllmjooT/yjSQE61bVK4YqVpwtusst4/YjRAdh7f+BLSKpf9Mbijc6g6STlFdUK4J5buwpiuYDfwMy0g9+Evg0= 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 VI1PR08MB3837.eurprd08.prod.outlook.com (2603:10a6:803:ba::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.17; Sat, 29 Jan 2022 07:03:45 +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.4930.020; Sat, 29 Jan 2022 07:03:45 +0000 From: Michael Riesch To: ptxdist@pengutronix.de Date: Sat, 29 Jan 2022 08:03:28 +0100 Message-Id: <20220129070330.2601433-4-michael.riesch@wolfvision.net> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220129070330.2601433-1-michael.riesch@wolfvision.net> References: <20220129070330.2601433-1-michael.riesch@wolfvision.net> X-ClientProxiedBy: ZR0P278CA0192.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:44::16) 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: d4fd30e7-7b26-4aef-dc36-08d9e2f57d57 X-MS-TrafficTypeDiagnostic: VI1PR08MB3837: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: zZCEw5Xq8pGOR7OHXPIlAOOKmkRYu6+mkj+C9fn/L8JNgTNbOekxj2vffSVI1AzHpTMJKXHXQoSAluAORxpVM0zrME5rv3o9jDJegewtXY7A/7BUm/vAyHcBk/McDdHszD7pTPD9krZK+ML2Egm3kzeHFRHXDGADuTf99L6KGKuwQ9hDVqTG+kqIrOy8wu8pimxFcYCcarXqCsm8yrLQeYo17vquaSZpfqJ9ljqVM87g7TM1U9hLRG5fSZnZSDMmwC9dI3q9Gx6HPvyIVNbpcHeXaOZwy/g8lhmq6ozdRQV98pVhGLn5baNqRSTdxDGlefueXkkxpajXL+htKIOszjoXrIoh7bWrOAFMHVBMVA4KDyCixwLhL4Oz5p/l56IiBAlMxY9N3nLljDjT0qFGv+44PKEkpYtfrY1ghn1nYM6zqeorGugfKBhyStHkb8Sq/nT5gR3chN6IIf6Rlywvsbm+jfv7OQK3OCvfuqstr5XVwsWB+YFCusGJPvKJ8fNzSljMiMsd4vPMLc9SoKZuMRuekaL7fyVBdYVZhZI/T4lSMqWsl6tDyqwY8oiZklp6CiJTmOpW7eD9AV01QUic0Yc+D2m5upRzcUgQv+IVesHO9pjwW3a0B6N7cha8ZOOqbZ0us1JjyB9oMuDvKnDzfw== 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:(13230001)(4636009)(366004)(36756003)(186003)(2616005)(6506007)(107886003)(52116002)(6512007)(6666004)(508600001)(2906002)(316002)(6916009)(1076003)(44832011)(8936002)(8676002)(4326008)(66556008)(66476007)(66946007)(86362001)(6486002)(5660300002)(450100002)(38100700002)(20210929001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?BwQuzoowYi++nT4xkGXvFo6d/eaK1GO8/NHE7jRwgfKpEMjG1sFMxZ2EmGy0?= =?us-ascii?Q?idXbeLwAYxwGV72jl1OOXh9aI43YJRVyulw4AdMRHDqS2RvvBwd5njYklZ0m?= =?us-ascii?Q?8T0cNOoEEXJI6HHpUsXZ2I94+H3B6MZ0rf4MMIYGDQZpgAZyEYOjoFWj6RHf?= =?us-ascii?Q?msZte2SaHLOka9RIpHES9SVCeunj0VhBGuJIssX9APaD4bVJPWwKMUNwDg6L?= =?us-ascii?Q?aB0vG0DxZAVYg+Bq7k6xt4M+wc3XPi3x9qg2MVdcZwl5fHEhZ4/vgQLgrM/t?= =?us-ascii?Q?NioI6TnFgCN36ZLeYRzWo1e5TXllrmEWw79wQPQ7FfmbQqvKI07T9f8734SG?= =?us-ascii?Q?W2+5CNwpLNAaKi9p9h5zF0OWvimSutPINRip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q?Y8OqGiKFBEFnOmJk9rdF7UmEwINtcUdLcXrM/JmwjpV9TC1DWVm37WOeKjFm?= =?us-ascii?Q?hc9wbfwtr7Q6htVjlspANpKeKPhcU6Hmb/a/tVpNb05VroNZJcpFh/TIDSjq?= =?us-ascii?Q?g0Z/RohpU/QnzaX/LADFnXGM8EcgDLQ5Yf83L2jLVYj6B8HZ2FyPXx8fH0MF?= =?us-ascii?Q?2AEZjW+iyp08LWe52ioQBuNmVicup5SXwnNgLt5YUlTLZiMSN2npcdV4c4Pn?= =?us-ascii?Q?J3N0fu7DeP+6HiJkg2Z+UvuwwgRJW1p8HjlKtyvi2hYO98FyezRl+0oPuFOC?= =?us-ascii?Q?lYBLjFj3W/GFN6WxQwXqroD1V2ImW6fv0X8PhGtDPNxd/yrXVB9G1DepdACF?= =?us-ascii?Q?+vXa6ccmpqTUGL0lhah9Wz4gqxdFqad20J887aYCLnC24/hA9NUbB2koX6c+?= =?us-ascii?Q?Y07eTTyBPkNWXRBWijXAADIjuA+38s0z4SrRJEgYHFZsPsVFJYoYQbM1d9op?= =?us-ascii?Q?CqLTeIwop89ev27GywY2gXcFyolsd3M=3D?= X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: d4fd30e7-7b26-4aef-dc36-08d9e2f57d57 X-MS-Exchange-CrossTenant-AuthSource: HE1PR0802MB2426.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jan 2022 07:03:44.8660 (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: zLxpE3bBhMdq4qj802Hu90Dfj3D116z+VbyChxgxVU3dbmIEq1W2YRLBPahPi172sjZpFAIQ6v4C+toZqK/42BFdLBZhqVpv0h9kOw2Uoyc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB3837 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,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Subject: [ptxdist] [PATCH v6 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 --- Notes: v6: - replaced 'break' with 'return' 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..fe4eb8363 --- /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 || return + + for inject_file in ${pkg_inject_files}; do + ptxd_make_inject || return + 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