[U-Boot] hashtable lib and escaping

Mats Kärrman Mats.Karrman at tritech.se
Thu Nov 1 18:45:48 CET 2012


Hi,

I used to have a working setup using U-Boot 2009.03 before upgrading to U-Boot 2012.07. The problem I'm facing is related to the escaping policies of lib/hashtable.c.

What I did before was for example having something like this in my default environment:

bootcmd=run first_boot
first_boot=setenv bootcmd my_select\;run ubi_boot;saveenv;boot

The trick accomplished was that the environment was saved after setting the real bootcmd (to "my_select;run ubi_boot") on first boot so that the booted OS could always be relying on a valid environment in one of the flash env partitions.

With the escape parsing of himport_r(), the '\' is simply dropped and it is no longer possible to escape ';' so the "run ubi_boot" is immediately executed and nothing is saved... The function header mentions the possibility for multi-line values but this should not come at the cost of not being able to escape ';'.

I am not sure about what other uses the escape may have or used to have so I have not come up with a patch yet. Does anyone have any feedback/opinions concerning this?

BR // Mats


More information about the U-Boot mailing list