From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1i59XO-0002hH-In for ptxdist@pengutronix.de; Tue, 03 Sep 2019 16:12:02 +0200 Received: from mol by ptx.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1i59XO-0006qC-AH for ptxdist@pengutronix.de; Tue, 03 Sep 2019 16:12:02 +0200 Date: Tue, 3 Sep 2019 16:12:02 +0200 From: Michael Olbrich Message-ID: <20190903141202.hf3o753xvp6prbwk@pengutronix.de> References: <20190903115025.5007-1-ada@thorsis.com> <20190903120017.uxirotubv2uiwgjp@pengutronix.de> <2446051.fMRPiYAuoM@ada> <20190903130808.vg6cxfnhx23kh5uw@pengutronix.de> <20190903133831.cqvv6oenah4yyaqc@pengutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190903133831.cqvv6oenah4yyaqc@pengutronix.de> Subject: Re: [ptxdist] [RFC PATCH] doc: Add section on creating new layers List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ptxdist-bounces@pengutronix.de Sender: "ptxdist" To: ptxdist@pengutronix.de On Tue, Sep 03, 2019 at 03:38:31PM +0200, Roland Hieber wrote: > On Tue, Sep 03, 2019 at 03:08:08PM +0200, Michael Olbrich wrote: > > On Tue, Sep 03, 2019 at 02:22:04PM +0200, Alexander Dahl wrote: > > > Hello Roland, > > > > > > Am Dienstag, 3. September 2019, 14:00:17 CEST schrieb Roland Hieber: > > > > On Tue, Sep 03, 2019 at 01:50:25PM +0200, Alexander Dahl wrote: > > > > > After discussing these topics in IRC, it seemed reasonable to add some > > > > > explanation on how to create a new layer from scratch. > > > > > > > > \o/ someone else did a task on my overlong todo list :D > > > > > > Yes, and I just saw you already wrote a piece on that topic, but on your > > > website, not in ptxdist documentation: > > > > > > https://pengutronix.de/en/blog/2019-06-18-DistroKitLayer.html > > > > > > o.O > > Uhm. Thanks for reminding me ... ^^ Chris did most of the work though, I > only proof-read it. > > > > > > + > > > > > +Creating a new Layer > > > > > +~~~~~~~~~~~~~~~~~~~~ > > > > > + > > > > > +Adding new layers on top of an already existing BSP is easy: > > > > > + > > > > > +#. Create an empty folder, e.g. next to the existing BSP. > > > > > +#. The lower layer is just a folder named ``base`` (see layers_ above). > > > > > You + may do one of the following (or something else you consider > > > > > convenient): + > > > > > + - Create a symbolic link ``base`` to an outside laying BSP folder. For > > > > > + an easy start, you can try this method with DistroKit_ for example: > > > > > + ``$ ln -s ../DistroKit base`` > > > > > > > > We have done that too sometimes in the past, but if the config files in > > > > the base layer are not in the right versions, the MD5 sum in the config > > > > diffs in the inherited layer will not match. I think this should be > > > > mentioned here. > > > > > > Sorry, I do not understand. :-/ > > > > > > > > + - Use a Git submodule with a BSP in a folder ``base``. > > > > > + - Copy over your whole existing BSP to a new subfolder ``base``. > > > > > > > > Subtree merges are another possibility, although I've never done one. > > > > > > Same here. > > > > > > > > + > > > > > +#. If needed select **ptxconfig** and/or **platformconfig** after copying > > > > > + that file from the lower layer to your new layer: > > > > > + > > > > > +.. code-block:: text > > > > > + > > > > > + $ mkdir -p configs/platform-v7a > > > > > + $ cp base/configs/platform-v7a/platformconfig configs/platform-v7a/ > > > > > + $ ptxdist platform configs/platform-v7a/platformconfig > > > > > > > > I think you should be able to select the config from base/ directly > > > > without copying them? mol? > > > > > > I did not try that. What is possible to select would be indeed an interesting > > > piece in the docs! That question came up multiple times in IRC in the last > > > days. ;-) > > > > If there is just on platform, then ptxdist will just use that on if no > > selected_platformconfig exists. This is especially useful with layers, > > because it will then just pick the config from the first layer that has > > one. > > > > This means, that you can start with just the base link. Then change > > something with 'ptxdist platformconfig'. PTXdist will create the > > platformconfig in your new layer and use it automatically. > > > > The same works for the ptxconfig as well. > > Hmm, this explanation does not match my experience... > > rhi@dude test-bsp $ p version > 2019.08.0 > > rhi@dude test-bsp $ l > lrwxrwxrwx 1 rhi ptx 10 Sep 3 14:58 base -> DistroKit/ > drwxr-xr-x 11 rhi ptx 232 Sep 3 15:03 DistroKit > > rhi@dude test-bsp $ l DistroKit/selected_* > lrwxrwxrwx 1 rhi ptx 35 Sep 3 15:03 DistroKit/selected_platformconfig -> configs/platform-v7a/platformconfig > lrwxrwxrwx 1 rhi ptx 118 Sep 3 15:03 DistroKit/selected_toolchain -> /opt/OSELAS.Toolchain-2018.12.0/arm-v7a-linux-gnueabihf/gcc-8.2.1-glibc-2.28-binutils-2.31.1-kernel-4.19-sanitized/bin > > rhi@dude test-bsp $ p menuconfig platform > configuration written to .config > > *** End of the configuration. > *** Execute 'ptxdist go' to build the project or try 'ptxdist help'. > > Saving 'test-bsp/DistroKit/configs/platform-v7a/platformconfig'. > > Same for ptxdist menuconfig, which changes test-bsp/DistroKit/configs/ptxconfig > instead of configs/ptxconfig in the current layer. However, when I copy > base/configs/ptxconfig to configs/ptxconfig, and then do a menuconfig, > it is changed in the current layer. I cannot reproduce this. It works as expected for me. The last log message may be a clue, I would expect "Saving 'test-bsp/configs/platform-v7a/platformconfig'." or "Saving 'test-bsp/base/configs/platform-v7a/platformconfig'." but not "test-bsp/DistroKit/....". So maybe the symlink handling does not work correctly. What's the output of 'p migrate'? What happens if 'base' is a symlink to '../DistroKit'? Michael -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de