mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Gavin Schenk <g.schenk@eckelmann.de>
To: barebox@lists.infradead.org
Cc: Gavin Schenk <g.schenk@eckelmann.de>
Subject: [PATCH] bootchooser: Fix initcall before environment is ready
Date: Thu, 14 Dec 2017 10:50:12 +0100	[thread overview]
Message-ID: <20171214095012.10223-1-g.schenk@eckelmann.de> (raw)

Some properties of bootchooser are initialized by NV variables.

Initialize bootchooser as postenvironment_initcall to ensure that
properties can be initialized correctly.

Signed-off-by: Gavin Schenk <g.schenk@eckelmann.de>
---

Hi,

I want to initialize bootchooser.reset_attempts=all-zero power-on on my
machine.

cat bootchooser.reset_attempts
'all-zero power-on' 

Wenn starting the machine with only build-in environment I got this
message:

envfs: no envfs (magic mismatch) - envfs never written?
failed to create nv variable bootchooser.reset_attempts: Invalid argument

And as result bootchooser.reset_attempts is empty :-(

Is this is a good way to fix this?


 common/bootchooser.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/bootchooser.c b/common/bootchooser.c
index 83b15e0f7..4664b8a51 100644
--- a/common/bootchooser.c
+++ b/common/bootchooser.c
@@ -916,7 +916,7 @@ static int bootchooser_init(void)
 
 	return 0;
 }
-device_initcall(bootchooser_init);
+postenvironment_initcall(bootchooser_init);
 
 BAREBOX_MAGICVAR_NAMED(global_bootchooser_disable_on_zero_attempts,
 		       global.bootchooser.disable_on_zero_attempts,
-- 
2.15.1


-- 
Eckelmann AG
Vorstand: Dipl.-Ing. Peter Frankenbach (Sprecher) Dipl.-Wi.-Ing. Philipp Eckelmann
Dr.-Ing. Marco Münchhof Dr.-Ing. Frank Uhlemann
Vorsitzender des Aufsichtsrats: Hubertus G. Krossa
Stv. Vorsitzender des Aufsichtsrats: Dr.-Ing. Gerd Eckelmann
Sitz der Gesellschaft: Berliner Str. 161, 65205 Wiesbaden, Amtsgericht Wiesbaden HRB 12636
http://www.eckelmann.de

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

             reply	other threads:[~2017-12-14  9:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-14  9:50 Gavin Schenk [this message]
2017-12-14 10:16 ` Schenk, Gavin

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=20171214095012.10223-1-g.schenk@eckelmann.de \
    --to=g.schenk@eckelmann.de \
    --cc=barebox@lists.infradead.org \
    /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