base-files: execute uboot-env script before calling config_generate
authorJohn Crispin <john@phrozen.org>
Sun, 22 Sep 2024 07:04:55 +0000 (09:04 +0200)
committerJohn Crispin <john@phrozen.org>
Wed, 2 Oct 2024 13:41:33 +0000 (15:41 +0200)
This allows /etc/board.d/* scripts to use values from the uboot environment.

Signed-off-by: John Crispin <john@phrozen.org>
package/base-files/files/etc/init.d/boot

index d17754d087942b71422fa5b15f2a25fb9274cc6e..c7d1d4af3ad375aff14e08156cde119ce3a8a815 100755 (executable)
@@ -10,7 +10,6 @@ uci_apply_defaults() {
        cd /etc/uci-defaults || return 0
        files="$(ls)"
        [ -z "$files" ] && return 0
-       mkdir -p /tmp/.uci
        for file in $files; do
                ( . "./$(basename $file)" ) && rm -f "$file"
        done
@@ -47,6 +46,8 @@ boot() {
                sleep 1
        }
 
+       mkdir -p /tmp/.uci
+       [ -f /etc/uci-defaults/30_uboot-envtools ] && (. /etc/uci-defaults/30_uboot-envtools)
        /bin/config_generate
        rm -f /tmp/.config_pending
        /sbin/wifi config