* [PATCH] bootchooser: Fix initcall before environment is ready
@ 2017-12-14 9:50 Gavin Schenk
2017-12-14 10:16 ` Schenk, Gavin
0 siblings, 1 reply; 2+ messages in thread
From: Gavin Schenk @ 2017-12-14 9:50 UTC (permalink / raw)
To: barebox; +Cc: Gavin Schenk
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] bootchooser: Fix initcall before environment is ready
2017-12-14 9:50 [PATCH] bootchooser: Fix initcall before environment is ready Gavin Schenk
@ 2017-12-14 10:16 ` Schenk, Gavin
0 siblings, 0 replies; 2+ messages in thread
From: Schenk, Gavin @ 2017-12-14 10:16 UTC (permalink / raw)
To: barebox
Me again ...
> Is this is a good way to fix this?
>
No, this patch is bad. I noticed it too late.
Regards
Gavin
--
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-12-14 10:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-14 9:50 [PATCH] bootchooser: Fix initcall before environment is ready Gavin Schenk
2017-12-14 10:16 ` Schenk, Gavin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox