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

initramfs script output not sent to serial console #2863

Closed
kpfleming opened this issue Feb 18, 2019 · 6 comments
Closed

initramfs script output not sent to serial console #2863

kpfleming opened this issue Feb 18, 2019 · 6 comments
Labels
Waiting for external input Waiting for a comment from the originator of the issue, or a collaborator.

Comments

@kpfleming
Copy link
Contributor

kpfleming commented Feb 18, 2019

Describe the bug
When both serial and virtual (HDMI) consoles are configured, kernel startup messages appear on both consoles but output generated by scripts in the iniramfs only appears on the virtual console.

To reproduce

  1. Configure an initramfs using initramfs-tools and an 'initramfs' line in /boot/config.txt.
  2. Enable serial console and virtual console in /boot/cmdline.txt: console=serial0,115200 console=tty1.
  3. Reboot and observe both consoles.

Expected behaviour
Kernel messages (printk) and stdout/stderr from scripts in initramfs should appear on both consoles.

Actual behaviour
Only kernel messages appear on serial console.

System

  • Which model of Raspberry Pi? Pi3B+
  • Which OS and version (cat /etc/rpi-issue)? Raspbian 9.8
  • Which firmware version (vcgencmd version)? 1.20181112-1
  • Which kernel version (uname -a)? Linux home18 4.14.79-v7+ USB-Harddrive gets fully powered down #1159 SMP Sun Nov 4 17:50:20 GMT 2018 armv7l GNU/Linux

config.txt

# Enable serial port
enable_uart=1

# Use initramfs for mounting root filesystem
initramfs initramfs.gz

# Configure the activity LED to show SD card activity
dtoverlay=act_led_trigger=mmc1

# Disable Bluetooth hardware
dtoverlay=pi3-disable-bt

# Disable WiFi hardware
dtoverlay=pi3-disable-wifi

Problem also occurs if cmdline specifies ttyAMA0 for console.

@JamesH65
Copy link
Contributor

I'm not sure from the description if this is what is expected on a kernel, or whether it's what all kernels on all devices do. ie Is it specific to the Pi kernel. Not even sure how I would find out!

@kpfleming
Copy link
Contributor Author

That's a valid point! I don't have access to a system with a built-in serial port that is not a Pi in order to compare the behavior. I'll try to find someone who does.

@JamesH65
Copy link
Contributor

@kpfleming Did you have any luck with this?

@JamesH65 JamesH65 added the Waiting for external input Waiting for a comment from the originator of the issue, or a collaborator. label Feb 13, 2020
@burtyb
Copy link

burtyb commented Feb 13, 2020

I figured it was normal - on a Pi Zero to debug initramfs over serial to see the commands/output I've been appending " debug=y console=serial0" to cmdline.txt with " break=" for a BusyBox prompt.

@kpfleming
Copy link
Contributor Author

Unfortunately I have not had time to test this and my original project which required serial output is no longer needed.

@JeffPeters
Copy link

JeffPeters commented Oct 26, 2023

Try swaping your commandline
form console=serial0,115200 console=tty1
to console=tty1 console=serial0,115200

initramfs init script is only using the last console (as there is only one for that part of th boot)

This works for me to get initramfs working in qemu (which is using serial port in termal -nographic mode)

But it should also work on the pi zero

See: https://unix.stackexchange.com/a/736891

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Waiting for external input Waiting for a comment from the originator of the issue, or a collaborator.
Projects
None yet
Development

No branches or pull requests

4 participants