Skip to content

Commit 32f0fde

Browse files
committedJun 28, 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 8ca4068 commit 32f0fde

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
@@ -238,6 +238,17 @@ function pre_umount_final_image__remove_esp() {
238238

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

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

293309
function pre_umount_final_image__write_raspi_cmdline() {
310+
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
311+
if [[ "${RPI_DEBUG_CONSOLE}" == "yes" ]]; then
312+
display_alert "Enabling debug console" "cmdline.txt - ${BOARD} - RPI_DEBUG_CONSOLE=yes" "warn"
313+
cmdline_consoles="console=tty1 console=ttyAMA0,115200 loglevel=7"
314+
fi
315+
294316
cat <<- EOD > "${MOUNT}"/boot/firmware/cmdline.txt
295-
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
317+
${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
296318
EOD
297319

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

0 commit comments

Comments
 (0)
Failed to load comments.