@@ -113,6 +113,8 @@ function compile_uboot_target() {
113113 # @TODO: why?
114114 touch .scmversion
115115
116+ declare uboot_loglevel=" ${UBOOT_LOGLEVEL:- " 6" } " # default to info
117+
116118 # use `scripts/config` instead of sed if available. Cleaner results.
117119 if [[ ! -f scripts/config ]]; then
118120 display_alert " scripts/config not found" " u-boot ${version} $BOOTCONFIG ${target_make} " " debug"
@@ -139,10 +141,10 @@ function compile_uboot_target() {
139141 fi
140142
141143 # Hack, up the log level to 6: "info" (default is 4: "warning")
142- display_alert " Hacking log level in u-boot config" " LOGLEVEL=6 for ${target} " " info"
144+ display_alert " Hacking log level in u-boot config" " LOGLEVEL=${uboot_loglevel} for ${target} " " info"
143145 run_host_command_logged scripts/config --enable CONFIG_LOG
144- run_host_command_logged scripts/config --set-val CONFIG_LOGLEVEL 6
145- run_host_command_logged scripts/config --set-val CONFIG_LOG_MAX_LEVEL 6
146+ run_host_command_logged scripts/config --set-val CONFIG_LOGLEVEL ${uboot_loglevel}
147+ run_host_command_logged scripts/config --set-val CONFIG_LOG_MAX_LEVEL ${uboot_loglevel}
146148
147149 # Include Armbian version so UART bootlogs are drastically more useful
148150 run_host_command_logged ./scripts/config --disable " LOCALVERSION_AUTO"
@@ -160,14 +162,14 @@ function compile_uboot_target() {
160162 # 0 - emergency ; 1 - alert; 2 - critical; 3 - error; 4 - warning; 5 - note; 6 - info; 7 - debug; 8 - debug content; 9 - debug hardware I/O
161163 cat << - EXTRA_UBOOT_DEBUG_CONFIGS >> .config
162164 CONFIG_LOG=y
163- CONFIG_LOG_MAX_LEVEL=7
164- CONFIG_LOG_DEFAULT_LEVEL=7
165+ CONFIG_LOG_MAX_LEVEL=${uboot_loglevel}
166+ CONFIG_LOG_DEFAULT_LEVEL=${uboot_loglevel}
165167 CONFIG_LOG_CONSOLE=y
166168 CONFIG_SPL_LOG=y
167- CONFIG_SPL_LOG_MAX_LEVEL=6
169+ CONFIG_SPL_LOG_MAX_LEVEL=${uboot_loglevel}
168170 CONFIG_SPL_LOG_CONSOLE=y
169171 CONFIG_TPL_LOG=y
170- CONFIG_TPL_LOG_MAX_LEVEL=6
172+ CONFIG_TPL_LOG_MAX_LEVEL=${uboot_loglevel}
171173 CONFIG_TPL_LOG_CONSOLE=y
172174 # CONFIG_ERRNO_STR is not set
173175 EXTRA_UBOOT_DEBUG_CONFIGS
0 commit comments