[Solved] Debugging First-Boot UCI Setup

Is there a reasonable way to debug the scripts used for initial UCI setup (/etc/board.d/* in particular)?

The usual set -x and printf approaches don't seem to be working for me, even with things like

printf "board_config_flush() '${CFG}'\n" >> /tmp/trace.log 

Is it because it's too early? Maybe redirecting to /dev/kmsg can help.

Well, found one way to do it...

root@OpenWrt:~# rm /etc/board.json 
root@OpenWrt:~# sh -x /bin/board_detect 2>&1 | less

or, perhaps better

root@OpenWrt:~# rm /etc/board.json 
root@OpenWrt:~# sh -x /bin/config_generate 2>&1 | less

Edit: Likely the reason I wasn't seeing anything is that it looks like if /etc/board.json is already present, it is directly used to (re-)create the /etc/config/* files, so nothing in /etc/board.d/ was being called at all.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.