loader_lua fails to load dtb

Under 12.0 and legacy loader it was possible to load a dtb file with:
Code:
# Load our board's dtb.
sun50i-h5-nanopi-neo2.dtb_type="dtb"
sun50i-h5-nanopi-neo2.dtb_load="YES"
This conforms to loader.conf() under section *_load and *_type. When using the standard loader (4th) it loads the module sun50i-h5-nanopi-neo2.dtb from /boot/dtb.
However, when using loader_lua these loader.conf instructions are silently ignored.
My questions:
  1. Is this a correct way to load a dtb? Or should *_name be used for declaring the actual filename.
  2. Shouldn't it be considered a bug that no error is reported? loader.conf explicitly instructs to load a module, which did not succeed.
I've done some source digging and found why the lua version of loader does not load the dtb file. The definition of MODULEEXPR in /usr/src/stand/lua/config.lua states:

Code:
local MODULEEXPR = '([%w-_]+)'
Thereby excluding character dot as part of the module name. I've tested this - renaming the file and changing loader.conf by removing the .dtb namepart makes it work under loader_lua.

Please enlighten me with your insight.

BTW. Why this is important. U-boot contains an embedded fdt which is picked up by the kernel. So boot seems to be succesfull, but it's missing vital stuff like aw_thermal and cpufreq. Furthermore U-boot sets default cpufreq at the highest level. Just a matter of time until the cpu will unsolder itself ;)
 
Hi,

Under 12.0 and legacy loader it was possible to load a dtb file with:
Code:
# Load our board's dtb.
sun50i-h5-nanopi-neo2.dtb_type="dtb"
sun50i-h5-nanopi-neo2.dtb_load="YES"
This conforms to loader.conf() under section *_load and *_type. When using the standard loader (4th) it loads the module sun50i-h5-nanopi-neo2.dtb from /boot/dtb.
However, when using loader_lua these loader.conf instructions are silently ignored.
My questions:
  1. Is this a correct way to load a dtb? Or should *_name be used for declaring the actual filename.

Right, this should have worked -- if you need to work around it, yeah, you should pick an arbitrary name without a dot in it (or just replace the dot with a 'safe' character) and use *_name as you've suggested to get it to do the right thing.

  1. Shouldn't it be considered a bug that no error is reported? loader.conf explicitly instructs to load a module, which did not succeed.

Nope, because it wasn't an error. :) If you use `show` at the loader prompt, you'll note that we fell back to the env var entry and physically set vars in the environment named sun50i-h5-nanopi-neo2.dtb_type and sun50i-h5-nanopi-neo2.dtb_name.

I've done some source digging and found why the lua version of loader does not load the dtb file. The definition of MODULEEXPR in /usr/src/stand/lua/config.lua states:

Code:
local MODULEEXPR = '([%w-_]+)'
Thereby excluding character dot as part of the module name. I've tested this - renaming the file and changing loader.conf by removing the .dtb namepart makes it work under loader_lua.

Good catch, I'll get this fixed ASAP. As noted above, _name to specify the actual filename is also a reasonable workaround if you'd prefer not to compromise on the filename.

Thanks,

Kyle Evans
 
Back
Top