[PATCH 7/7] defaultenv-2: add boot sequence

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Fri Sep 28 11:48:01 EDT 2012


On 12:48 Fri 28 Sep     , Sascha Hauer wrote:
> 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.
This was your request to do this this way

THe first version was keeping the old boot.default and ask you to enable the
boot sequence specifycally and then you ask me to drop this to make the boot
sequence by default

so now I've hardware ready to be send on the way with this next with boot
sequence mandatory

so I do not think we drop it we can update it but not drop it
> 
> 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
none of the scm or fs we known does not support this

except window stuff and common it's windows

Best Regards,
J.



More information about the barebox mailing list