mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Konstantin Kletschke <konstantin.kletschke@inside-m2m.de>
Cc: Roland Hieber <rhi@pengutronix.de>,
	Trent Piepho <trent.piepho@igorinstitute.com>,
	barebox@lists.infradead.org
Subject: Re: Howto implement bootchooser <-> rauc interaction
Date: Fri, 17 Dec 2021 11:00:28 +0100	[thread overview]
Message-ID: <3e8efae8-2c97-1359-cc0d-acbb17b555e8@pengutronix.de> (raw)
In-Reply-To: <0af65ce5839f3990206a5b9ac94d00ac@inside-m2m.de>

On 16.12.21 20:35, Konstantin Kletschke wrote:
> On 2021-12-15 11:56, Ahmad Fatoum wrote:
> 
>> I think Roland meant that you shouldn't rely on the _mutable_ environment
>> for production. It's nice to test out stuff, but once you have figured
>> out what you need, add it to the built-in environment (e.g.
>> arch/arm/<board/myenv or CONFIG_DEFAULT_ENVIRONMENT_PATH).
> 
> Okay, then I got it - the intention of Roland. Compiled default environment
> is no problem.
> 
> But regarding required bootchooser variables: what of those are required?
> I said I utilised
> https://bootlin.com/blog/another-system-update-adventure-with-rauc-barebox-yocto-project/
> there is the barebox-state DT tree setup explained (a bit) and then it points out
> [...]Now we have to add bootchooser variables associated to both targets in arch/arm/<board>/env/nv[...]
> Which is rather abstract on how to do this, especially, if I have
> 
> bootstate.system0.remaining_attempts
> 
> in the DT, why should I replicate this in arch/arm/<board>/env/nv?

bootchooser variables are those that start with bootchooser.*. You named
your state bootstate in the device tree, thus the state driver creates
bootstate.* variables, which can be used to read/write the values.

You need to tell bootchooser which state to take via bootchooser.state_prefix,
but that's it. No need to mess direclty with the state variables.


> Or is there a connection needed to be created? Which variables need to be specified?
> Isn't it already there?
> 
>> > barebox@TI AM335x BeagleBone black:/ devinfo state
>> > Parameters:
>> > bootstate.last_chosen: 0 (type: uint32)
>> > bootstate.system0.ok: 0 (type: uint32)
>> > bootstate.system0.priority: 21 (type: uint32)
>> > bootstate.system0.remaining_attempts: 3 (type: uint32)
>> > bootstate.system1.ok: 0 (type: uint32)
>> > bootstate.system1.priority: 20 (type: uint32)
>> > bootstate.system1.remaining_attempts: 3 (type: uint32)
>> > dirty: 0 (type: bool)
>> > init_from_defaults: 0 (type: bool)
>> > save_on_shutdown: 1 (type: bool)

See https://elinux.org/images/9/9d/Barebox-bells-n-whistles.pdf Slide 26 for an example
/env/nv for a redundant boot setup.

> 
>> > Is bootchooser smart enough to gather system0 and system1 as bootable entries/possibilities?

You need to tell it what system0 and system1 are. See example linked above.

> 
>> > barebox@TI AM335x BeagleBone black:/ bootchooser
>> > ERROR: bootchooser: Target list $global.bootchooser.targets is empty
>> > No bootchooser found
> 
> May be this is my problem:

Ye. You need to tell bootchooser what boot targets there are.

>> hand is manageable, because you restrict what variables are available
>> and how they interact with the rest of the system.
> 
> ?
> 
> 
> What I mixed into my not so elaborated mail is a SIDE QUEST:
> 
> I can boot a bootloader spec equipped partitio like this:
> 
> barebox@TI AM335x BeagleBone black:/ boot mmc1.2
> 
> 
> How do I make a boot entry "system0" a boot.default variable can point to and also a member
> of bootchooser.targets?
> 
> I tried mmc1.2 or "boot mmc1.2" as system0 content but that did not work...

It's a two step thing. First you define your targets, e.g. system0 and system1
Then bootchooser knows the name of the state variables to consult and then
basically does boot ${global.bootchooser.system0.boot}.

Cheers,
Ahmad

> 
> 
> 
> 
> Kind Regards
> Konsti
> 
> 


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

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


  reply	other threads:[~2021-12-17 10:02 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-03 12:40 Konstantin Kletschke
2021-12-03 17:52 ` Trent Piepho
2021-12-05 22:55   ` Roland Hieber
2021-12-06  8:52     ` Konstantin Kletschke
2021-12-14 21:40     ` Konstantin Kletschke
2021-12-15 10:56       ` Ahmad Fatoum
2021-12-16 19:35         ` Konstantin Kletschke
2021-12-17 10:00           ` Ahmad Fatoum [this message]
2021-12-17 12:50             ` Konstantin Kletschke
2022-01-03 15:24         ` Roland Hieber
2021-12-06  8:30   ` Konstantin Kletschke
2021-12-14 21:28   ` Konstantin Kletschke
2021-12-15 10:50     ` Ahmad Fatoum
     [not found]       ` <297b3425baa118783dccb6446900fbfa@inside-m2m.de>
2021-12-16 19:42         ` Fwd: " Konstantin Kletschke
2021-12-17  9:46           ` Ahmad Fatoum
2021-12-17 12:43             ` Konstantin Kletschke
2021-12-17 13:08               ` Ahmad Fatoum
2021-12-17 14:21                 ` Konstantin Kletschke
2021-12-22 14:05                   ` Konstantin Kletschke
2022-01-05 17:50                     ` Ahmad Fatoum
2022-01-06  9:59                       ` Konstantin Kletschke

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=3e8efae8-2c97-1359-cc0d-acbb17b555e8@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=konstantin.kletschke@inside-m2m.de \
    --cc=rhi@pengutronix.de \
    --cc=trent.piepho@igorinstitute.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