diff --git a/config/sources/families/bcm2711.conf b/config/sources/families/bcm2711.conf index 850ea7b366a0..3b8e1f97494f 100644 --- a/config/sources/families/bcm2711.conf +++ b/config/sources/families/bcm2711.conf @@ -238,6 +238,17 @@ function pre_umount_final_image__remove_esp() { # write the default config.txt config function pre_umount_final_image__write_raspi_config() { + declare comment_if_debug="" + declare not_comment_if_debug="#" + if [[ "${RPI_DEBUG_CONSOLE}" != "yes" ]]; then + comment_if_debug="#" + not_comment_if_debug="" + # for serial console, there is also 'BOOT_UART=1' in 'rpi-eeprom-config' but that is for an earlier stage. + # look at with it rpi-eeprom-config, change with 'EDITOR=nano rpi-eeprom-config --edit' + else + display_alert "Enabling debug console" "config.txt - ${BOARD} - RPI_DEBUG_CONSOLE=yes" "warn" + fi + cat <<- EOD > "${MOUNT}"/boot/firmware/config.txt # For more options and information see # http://rptl.io/configtxt @@ -263,6 +274,11 @@ function pre_umount_final_image__write_raspi_config() { # Automatically load initramfs files, if found auto_initramfs=1 + # bootloader logs to serial, second stage (Armbian: enable with RPI_DEBUG_CONSOLE=yes, currently: ${RPI_DEBUG_CONSOLE:-"no"}) + ${not_comment_if_debug}enable_uart=1 + # if uart is enabled, disable Bluetooth which also uses UART + ${comment_if_debug}dtoverlay=disable-bt + # Enable DRM VC4 V3D driver dtoverlay=vc4-kms-v3d max_framebuffers=2 @@ -291,8 +307,14 @@ function pre_umount_final_image__write_raspi_config() { } function pre_umount_final_image__write_raspi_cmdline() { + 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 + if [[ "${RPI_DEBUG_CONSOLE}" == "yes" ]]; then + display_alert "Enabling debug console" "cmdline.txt - ${BOARD} - RPI_DEBUG_CONSOLE=yes" "warn" + cmdline_consoles="console=tty1 console=ttyAMA0,115200 loglevel=7" + fi + cat <<- EOD > "${MOUNT}"/boot/firmware/cmdline.txt - 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 + ${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 EOD if [[ "${SHOW_DEBUG}" == "yes" ]]; then