From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-ua0-x22d.google.com ([2607:f8b0:400c:c08::22d]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bblIF-0004Gy-8i for barebox@lists.infradead.org; Mon, 22 Aug 2016 09:13:20 +0000 Received: by mail-ua0-x22d.google.com with SMTP id 74so177925350uau.0 for ; Mon, 22 Aug 2016 02:12:57 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20160822054521.GU20657@pengutronix.de> References: <20160818063059.GD20657@pengutronix.de> <20160822054521.GU20657@pengutronix.de> From: Guillermo Rodriguez Garcia Date: Mon, 22 Aug 2016 11:12:55 +0200 Message-ID: List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: Re: Fwd: Shouldn't boot_board be called from boot instead of init? To: Sascha Hauer Cc: barebox@lists.infradead.org Hi Sascha, 2016-08-22 7:45 GMT+02:00 Sascha Hauer : > On Thu, Aug 18, 2016 at 10:02:48AM +0200, Guillermo Rodriguez Garcia wrote: >> Hello, >> >> 2016-08-18 8:31 GMT+02:00 Sascha Hauer : >> > Hi, >> > >> > On Tue, Aug 16, 2016 at 10:42:32AM +0200, Guillermo Rodriguez Garcia wrote: >> >> Hello all, >> >> >> >> Currently, for defaultenv v1, the /env/bin/boot_board script is called >> >> from /env/bin/init. >> >> >> >> However this means boot_board will not be run if booting manually (by >> >> running 'boot' from the barebox console). >> >> >> >> Shouldn't this script be called from /env/bin/boot instead? If a board >> >> needs any specific stuff to be done when booting, this probably >> >> applies both when autobooting and when booting manually (otherwise, >> >> anything that only applies only when autobooting could also be done >> >> from init_board instead of boot_board). >> > >> > The only boot_board script we have is >> > arch/arm/boards/at91sam9m10g45ek/env/bin/boot_board. Here a menu is >> > built which I think makes sense at that stage and not at init_board. >> >> The thing is, if boot_board is called from init, then it will not be >> called if autoboot is interrupted and you later boot manually with the >> boot command. > > I think you are right, just go ahead with the suggested change. With > that a menu will be shown on the at91sam9m10g45ek when doing a manual > 'boot' which may even be the desired behaviour. Perfect. Will do so. >> > However, I would be glad to get rid of defaultenv-1 rather sooner than >> > later. >> >> Uhm. I actually like defaultenv-1 better than defaultenv-2. Why not >> keep both? Everyone can then make their choice :) > > That's interesting. What do you like better about defaultenv-1? This > information could help me to improve defaultenv-2. I guess it is just a matter of personal preference but I find defaultenv-1 easier to understand and easier to manage. With defaultenv-1 we basically have just one configuration file to edit (/env/config) and optionally init_board and/or boot_board (which are not needed in a majority of the cases). So everything you need to know/edit/tweak is in /env/config. With defaultenv-2 the "board configuration" is scattered through a number of tiny files, some of which contain just a single value (see for example nv/autoboot_timeout or nv/user). I find this more difficult to manage -- you need to edit a lot of tiny files instead of just one. Also I feel that the flow of control is less obvious for the same reason. I'd say defaultenv-1 feels more "imperative" and defaultenv-2 feels more "declarative", and I prefer the former. But I am fully aware that this is just a matter of personal preference :) Guillermo _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox