Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bcm2711: restore lost RPI_DEBUG_CONSOLE #6425

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion config/sources/families/bcm2711.conf
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,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 @@ -264,6 +275,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 @@ -292,8 +308,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