Skip to content

Commit

Permalink
bcm2711: restore lost RPI_DEBUG_CONSOLE
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
rpardini committed Jul 8, 2024
1 parent c84703d commit e441e8e
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion config/sources/families/bcm2711.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e441e8e

Please sign in to comment.