Couple of observations and questions on serial console setup (completely headless from the start):
Q1: Is there a reason the bt-disable overlay is only set for [PI3] devices?
Q2: Should the standard .img be modified to avoid having to edit config.txt and/or remaster in order to get serial console login working?
At the moment /etc/inittab does not contain an entry for serial console login. Instead bootlocal.sh calls /usr/sbin/startserialtty. However startserialtty doesn't always choose the correct dev (ttyS0 vs ttyAMA0).
It decides which one to use, based on the model Pi. However the overlay (bt-disable) switches ttyS0 and ttyAMA0 around. Startserialtty doesn't account for that overlay.
I guess (actually not my use case yet), that it's best to use the inferior PL011 uart for the console, and keep the full fledges 16550 uart available for other tasks.
My tactics to get completely headless setup done (I guess more relevant to Pi zero W than to Pi3B+, but here goes anyway):
Write fresh 11beta1a image to SD card
For a Pi3B+Mount boot partition somewhere (in my case on OS X laptop)
Comment out the pi3-disbale-bt overlay at the end of config.txt. This swaps ttyS0 and ttyAMA0 around. And so ttyS0 (which is what startserialtty picks based on seeing a pi3) now serves a login over serial console.
No boot messages displayed (need to change cmdline3.txt for that), but that's okay for now: 'we're in':
piCore
box login: tc
Password:
( '>')
/) TC (\ Core is distributed with ABSOLUTELY NO WARRANTY.
(/-_--_-\) www.tinycorelinux.net
tc@box:~$ tty
/dev/ttyS0
tc@box:~$ dmesg | grep tty
[ 0.000000] Kernel command line: coherent_pool=1M 8250.nr_uarts=1 bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=416 bcm2708_fb.fbswap=1 vd
[ 0.000295] console [tty1] enabled
[ 1.159824] 3f201000.serial: ttyAMA0 at MMIO 0x3f201000 (irq = 81, base_baud = 0) is a PL011 rev2
[ 1.160673] console [ttyS0] disabled
[ 1.160692] 3f215040.serial: ttyS0 at MMIO 0x0 (irq = 53, base_baud = 31250000) is a 16550
[ 1.160727] console [ttyS0] enabled
tc@box:~$ dmesg | grep serial
[ 1.159770] uart-pl011 3f201000.serial: cts_event_workaround enabled
[ 1.159824] 3f201000.serial: ttyAMA0 at MMIO 0x3f201000 (irq = 81, base_baud = 0) is a PL011 rev2
[ 1.160692] 3f215040.serial: ttyS0 at MMIO 0x0 (irq = 53, base_baud = 31250000) is a 16550
tc@box:~$ dmesg | grep PL011
[ 0.031554] Serial: AMBA PL011 UART driver
[ 1.159824] 3f201000.serial: ttyAMA0 at MMIO 0x3f201000 (irq = 81, base_baud = 0) is a PL011 rev2
tc@box:~$ dmesg | grep 16550
[ 0.660824] Serial: 8250/16550 driver, 1 ports, IRQ sharing enabled
[ 1.160692] 3f215040.serial: ttyS0 at MMIO 0x0 (irq = 53, base_baud = 31250000) is a 16550
For a 0W: add a section towards the end to add the disbale-bt overlay. Again it swap ttyS0 and ttyAMA0 around. This time making ttyAMA0 the 'correct' choice:
piCore
box login: tc
Password:
( '>')
/) TC (\ Core is distributed with ABSOLUTELY NO WARRANTY.
(/-_--_-\) www.tinycorelinux.net
tc@box:~$ tty
/dev/ttyAMA0
tc@box:~$ dmesg | grep tty
[ 0.000000] Kernel command line: coherent_pool=1M 8250.nr_uarts=1 bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=416 bcm2708_fb.fbswapd
[ 0.000616] console [tty1] enabled
[ 1.519604] 20201000.serial: ttyAMA0 at MMIO 0x20201000 (irq = 81, base_baud = 0) is a PL011 rev2
[ 1.519682] console [ttyAMA0] enabled
tc@box:~$ dmesg | grep serial
[ 1.519496] uart-pl011 20201000.serial: cts_event_workaround enabled
[ 1.519604] 20201000.serial: ttyAMA0 at MMIO 0x20201000 (irq = 81, base_baud = 0) is a PL011 rev2
[ 12.470861] uart-pl011 20201000.serial: no DMA platform data
tc@box:~$ dmesg | grep PL011
[ 0.090326] Serial: AMBA PL011 UART driver
[ 1.519604] 20201000.serial: ttyAMA0 at MMIO 0x20201000 (irq = 81, base_baud = 0) is a PL011 rev2
tc@box:~$ dmesg | grep 16550
[ 1.001088] Serial: 8250/16550 driver, 1 ports, IRQ sharing enabled
tc@box:~$
From there (both 3b+ and zeroW) I can then:
- remaster the initramfs (11.0beta1a[v7].gz to (1) edit /etc/inittab and (2) edit /opt/bootlocal.sh to disable the startserialtty script
- edit /opt/bootlocal.sh to disable startserialtty (followed by filetool.sh -bv)
I typically make a ttyS0.gz and a ttyAMA0.gz variant so that depending on config.txt and cmdline.txt, the correct one can be picked.
So, coming back to my opening questions: the 11.0beta1a doesn't provide 'out of the box' serial console login on a 3B+ or a Zero W. For both a small change to the config.txt is needed. This seems unnecessary, unless I'm missing something.
Perhaps startserialtty can be modified to include some logic that checks the configured overlays?