From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Thu, 02 May 2024 12:08:11 +0200 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1s2TMJ-00EoqN-1F for lore@lore.pengutronix.de; Thu, 02 May 2024 12:08:11 +0200 Received: from localhost ([127.0.0.1] helo=metis.whiteo.stw.pengutronix.de) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1s2TMI-0002YD-No; Thu, 02 May 2024 12:08:10 +0200 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1s2TM8-0002Xg-MO; Thu, 02 May 2024 12:08:00 +0200 Received: from [2a0a:edc0:2:b01:1d::c5] (helo=pty.whiteo.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s2TM8-00FUuK-8H; Thu, 02 May 2024 12:08:00 +0200 Received: from mol by pty.whiteo.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1s2TM8-007ZGp-0X; Thu, 02 May 2024 12:08:00 +0200 Date: Thu, 2 May 2024 12:08:00 +0200 From: Michael Olbrich To: Alexander Dahl Message-ID: Mail-Followup-To: Alexander Dahl , ptxdist@pengutronix.de, m.tretter@pengutronix.de, Michael Riesch References: <20220129070330.2601433-1-michael.riesch@wolfvision.net> <20220129070330.2601433-4-michael.riesch@wolfvision.net> <2397228.ElGaqSPkdT@ada-pc> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2397228.ElGaqSPkdT@ada-pc> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain Subject: Re: [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: ptxdist@pengutronix.de, m.tretter@pengutronix.de, Michael Riesch 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false On Fri, Apr 19, 2024 at 11:48:51AM +0200, Alexander Dahl wrote: > sorry for digging up this old discussion, but I kind of want to use this > approach and … see below. > > Am Samstag, 29. Januar 2022, 08:03:28 CEST schrieb Michael Riesch: > > 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). > > Currently trying to build recent U-Boot for i.MX8 and i.MX9 based boards which > require additional firmware. However I still want to build OOT to keep my > source tree clean, especially when building with an external tree (after > `ptxdist local-src u-boot $HOME/src/u-boot`). > > Now U-Boot needs those binaries in the build tree, it does not work using this > nice inject mechanism putting it in the source tree. > > > > > 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)" > > Here _DIR is assigned to pkg_source which makes the source dir the target > folder. > > Did anyone already think of how to extend this approach to be more flexible > for the target folder? Maybe even without damaging existing use cases? > > Maybe adding a new optional variable _INJECT_DEST which defaults to > _DIR and can be overridden? Makes sense to me. I would have named it _INJECT_DIR but either is fine with me. And if it's empty, set it to pkg_dir in ptxd_make_world_inject() Regards, Michael -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |