Skip to content

Commit c5b8b9d

Browse files
committedDec 30, 2024
bcm2711: restore lost RPI_DEBUG_CONSOLE
- if `RPI_DEBUG_CONSOLE=yes`: - `config.txt`: - `enable_uart=1` - `dtoverlay=disable-bt` - `cmdline.txt`: - `console=tty1 console=ttyAMA0,115200 loglevel=7` - this was lost in revision 1c3b7ec for some reason
1 parent bab9b3f commit c5b8b9d

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed
 

‎config/sources/families/bcm2711.conf

+23-1
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,17 @@ function pre_umount_final_image__remove_esp() {
239239

240240
# write the default config.txt config
241241
function pre_umount_final_image__write_raspi_config() {
242+
declare comment_if_debug=""
243+
declare not_comment_if_debug="#"
244+
if [[ "${RPI_DEBUG_CONSOLE}" != "yes" ]]; then
245+
comment_if_debug="#"
246+
not_comment_if_debug=""
247+
# for serial console, there is also 'BOOT_UART=1' in 'rpi-eeprom-config' but that is for an earlier stage.
248+
# look at with it rpi-eeprom-config, change with 'EDITOR=nano rpi-eeprom-config --edit'
249+
else
250+
display_alert "Enabling debug console" "config.txt - ${BOARD} - RPI_DEBUG_CONSOLE=yes" "warn"
251+
fi
252+
242253
cat <<- EOD > "${MOUNT}"/boot/firmware/config.txt
243254
# For more options and information see
244255
# http://rptl.io/configtxt
@@ -264,6 +275,11 @@ function pre_umount_final_image__write_raspi_config() {
264275
# Automatically load initramfs files, if found
265276
auto_initramfs=1
266277

278+
# bootloader logs to serial, second stage (Armbian: enable with RPI_DEBUG_CONSOLE=yes, currently: ${RPI_DEBUG_CONSOLE:-"no"})
279+
${not_comment_if_debug}enable_uart=1
280+
# if uart is enabled, disable Bluetooth which also uses UART
281+
${comment_if_debug}dtoverlay=disable-bt
282+
267283
# Enable DRM VC4 V3D driver
268284
dtoverlay=vc4-kms-v3d
269285
max_framebuffers=2
@@ -292,8 +308,14 @@ function pre_umount_final_image__write_raspi_config() {
292308
}
293309

294310
function pre_umount_final_image__write_raspi_cmdline() {
311+
declare cmdline_consoles="console=serial0,115200 console=tty1 loglevel=1" # default; no idea why Gunjan had serial0 in here, it wouldn't work, but I kept it
312+
if [[ "${RPI_DEBUG_CONSOLE}" == "yes" ]]; then
313+
display_alert "Enabling debug console" "cmdline.txt - ${BOARD} - RPI_DEBUG_CONSOLE=yes" "warn"
314+
cmdline_consoles="console=tty1 console=ttyAMA0,115200 loglevel=7"
315+
fi
316+
295317
cat <<- EOD > "${MOUNT}"/boot/firmware/cmdline.txt
296-
console=serial0,115200 console=tty1 loglevel=1 root=LABEL=${ROOT_FS_LABEL} rootfstype=${ROOTFS_TYPE} fsck.repair=yes rootwait logo.nologo cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory
318+
${cmdline_consoles} root=LABEL=${ROOT_FS_LABEL} rootfstype=${ROOTFS_TYPE} fsck.repair=yes rootwait logo.nologo cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory
297319
EOD
298320

299321
if [[ "${SHOW_DEBUG}" == "yes" ]]; then

0 commit comments

Comments
 (0)
Failed to load comments.