mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 7/7] defaultenv-2: add boot sequence
Date: Fri, 28 Sep 2012 12:48:46 +0200	[thread overview]
Message-ID: <20120928104846.GI24458@pengutronix.de> (raw)
In-Reply-To: <1347558023-25680-7-git-send-email-plagnioj@jcrosoft.com>

On Thu, Sep 13, 2012 at 07:40:23PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> Boot will boot run sequentially the script in /env/boot.d
> 
> drop global.boot.default as we start the boot sequence by default
> 
> update the current board using the defaultenv-2 at the sametime
> 

I'm going to drop this one in its current form.

The way it is written is just too confusing. We have a sequence=[y|n]
which is set in multiple places, then after evaluating 60 lines of
shell code the script eventually may call itself, which again sets
sequence to other values.

Currently my babbage board (which appearantly does not have links in
/env/boot.d comes up with:

> WARNING: boot sequence: none
> booting
> /env/boot/ or /env/boot.d/ does not exist. Valid choices:
> initrd net
> 
> boot sequence:
> none

This gives not much clue what is wrong and what has to be done next.

The recursive call to itself makes the script unmaintainable and error
prone.

The boot sequence feature per se is ok and it's good to have, but the
implementation currently is not good.

It would be much better to separate the boot script from a script
running a boot sequence. That way the boot script can have a clear set
of parameters and is responsible for only booting a single source. Then
a boot-sequence script again can have a clear set of options and has the
only responsibility of iterating over the available sources.

I think many usecases do not require a boot sequence. For example if
I want to boot from network it won't help me if the board boots from
flash instead due to some network error. That's why I think users
not wanting a boot sequence should be bothered with this as little
as possible. This could be solved by keeping the boot script like
it is and move the sequence stuff out to another script.

Look at documenting what the script does:

boot [method]: Boot a system using /env/boot/[method]
boot-sequence: Boot a system by iterating over /env/boot.d/* until
               one succeeds.

Now with both combined in a single script:

boot [method]: If called without method, it will iterate over
               /env/boot.d/*. If that directory does not exist,
               it will fall back to a single boot source, which you
               haven't specified, so the script will complain. If you
               give [method], that will be one of /env/boot/[method]
               or /env/boot.d/[method]. If [method] exists in both
               directories, the behaviour will be unspecified.

Another thing is that I do not have a good feeling about putting soft
links into the repository. I can't really give any concrete problems
with it, it just don't feels good to use such a feature which other
version control systems or filesystems do not support

Sascha

-- 
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 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2012-09-28 10:48 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-13 17:22 [PATCH 0/7 v4] " Jean-Christophe PLAGNIOL-VILLARD
2012-09-13 17:40 ` [PATCH 1/7] globalvar: add inline when not enabled Jean-Christophe PLAGNIOL-VILLARD
2012-09-13 17:40   ` [PATCH 2/7] echo: always allow to pass -e option Jean-Christophe PLAGNIOL-VILLARD
2012-09-13 17:40   ` [PATCH 3/7] defaultenv-2/ansi-colors: export color only if enable Jean-Christophe PLAGNIOL-VILLARD
2012-09-13 17:40   ` [PATCH 4/7] globalvar: add support to set a value to of all globalvars beginning with 'match' Jean-Christophe PLAGNIOL-VILLARD
2012-09-13 17:40   ` [PATCH 5/7] defaultenv-2: boot use global.linux.bootargs.dyn for dynamic globalvar Jean-Christophe PLAGNIOL-VILLARD
2012-09-13 17:40   ` [PATCH 6/7] defaultenv-2: boot reset linux.bootargs.dyn. and bootm. globalvar Jean-Christophe PLAGNIOL-VILLARD
2012-09-13 17:40   ` [PATCH 7/7] defaultenv-2: add boot sequence Jean-Christophe PLAGNIOL-VILLARD
2012-09-28 10:48     ` Sascha Hauer [this message]
2012-09-28 15:48       ` Jean-Christophe PLAGNIOL-VILLARD
2012-09-28 18:06         ` Sascha Hauer
2012-09-28 21:17           ` Jean-Christophe PLAGNIOL-VILLARD
  -- strict thread matches above, loose matches on Subject: below --
2012-09-11 10:19 [PATCH 1/7] globalbar: add inline when not enabled Jean-Christophe PLAGNIOL-VILLARD
2012-09-11 10:19 ` [PATCH 7/7] defaultenv-2: add boot sequence Jean-Christophe PLAGNIOL-VILLARD
2012-09-12  7:20   ` Sascha Hauer
2012-09-12  9:01     ` Jean-Christophe PLAGNIOL-VILLARD
2012-09-12  9:44       ` Sascha Hauer
2012-09-12 10:42         ` Jean-Christophe PLAGNIOL-VILLARD
2012-09-12 10:55           ` Sascha Hauer
2012-09-13 17:16         ` Jean-Christophe PLAGNIOL-VILLARD
2012-09-05 12:25 [PATCH 0/7 v2] " Jean-Christophe PLAGNIOL-VILLARD
2012-09-05 12:28 ` [PATCH 1/7] globalbar: add inline when not enabled Jean-Christophe PLAGNIOL-VILLARD
2012-09-05 12:28   ` [PATCH 7/7] defaultenv-2: add boot sequence Jean-Christophe PLAGNIOL-VILLARD

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120928104846.GI24458@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=plagnioj@jcrosoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox