[PATCH] bootchooser: Fix initcall before environment is ready

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

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@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox




[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux