# loader_lua fails  to load dtb



## aribi (Jun 10, 2019)

Under 12.0 and legacy loader it was possible to load a dtb file with:

```
# 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:

 Is this a correct way to load a dtb? Or should *_name be used for declaring the actual filename.
 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:


```
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


----------

