[BeagleBoard][Debian] Help with serial console and systemd

Hello.

So, recently acquired a few original Beagle Boards. Working with a Rev C4 currently. Running Debian on it is my end goal. Have made a lot of progress thanks to RCN’s omap-image-builder utility. I modified the kernel versions for Debian (stretch) to use 5.13.7-armv7-x14 and 5.10.41-ti-rt-r10 in the image. Then did the following to create my MMC card:

./RootStock-NG.sh -c rcn-ee_console_debian_stretch_armhf
./setup_sdcard.sh --mmc /dev/sdc --dtb omap3-beagle

Powered the board on then did the following U-Boot commands:

ext2load mmc 0:2 ${fdt_addr_r} boot/dtbs/5.13.7-armv7-x14/omap3-beagle.dtb
ext2load mmc 0:2 ${kernel_addr_r} boot/vmlinuz-5.13.7-armv7-x14
setenv bootargs 'console=ttyS2,115200n8 root=/dev/mmcblk0p2 rootwait'
bootz ${kernel_addr_r} - ${fdt_addr_r}

and Debian booted up just fine until mounting the root filesystem. It mounted fine then stopped outputting any text on the terminal:

[ 8.695556] systemd[1]: System time before build time, advancing clock.
[ 9.349334] random: systemd: uninitialized urandom read (16 bytes read)
[ 9.371551] random: systemd: uninitialized urandom read (16 bytes read)
[ 15.345703] systemd[1]: systemd 232 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN)
[ 15.368286] systemd[1]: Detected architecture arm.

Welcome to Debian GNU/Linux 9 (stretch)!

[ 15.448272] systemd[1]: Set hostname to <arm>.
[ 15.851074] random: crng init done

I then had to keep pressing periodically to get output showing up on the serial console. Eventually it started all the services (a bunch of stuff) and then never ending messages:

[ *** ] (2 of 2) A start job is running for dev-ttyGS0.device (24s / 1min 30s)

So, I did some tweaks to the root filesystem:

rm -rf timers.target.wants
cd sockets.target.wants
rm avahi-daemon.socket
cd ../getty.target.wants
rm getty\@tty1.service
mv serial-getty\@ttyGS0.service serial-getty\@ttyS2.service
cd ../multi-user.target.wants
rm apache2.service pppd-dns.service
rm capemgr.service connman.service
rm dundee.service avahi-daemon.service
rm ofono.service

and created four new files:

/etc/systemd/system/serial-getty@ttyO2.service
/etc/systemd/system/serial-getty@ttyS2.service
/etc/systemd/system/getty.target.wants/serial-getty@ttyO2.service
/etc/systemd/system/getty.target.wants/serial-getty@ttyS2.service

Rebooted the board and after startup is complete, similar messages:

[ **] (1 of 3) A start job is running for dev-ttyO2.device (36s / 1min 30s)

What is going on with my serial console? Thanks in advance.

-Nevets

I wonder if it’s tripping over the udev compatibility rule (ttyS* → ttyO*)… Systemd will automatically spawn a terminal based on console=ttyS2,115200n8…

What happens if you nuke:

(under: /etc/udev/rules.d/ )

Regards,

Instead of removing the file, I just removed the ttyO2 entry from systemd. Here is what my /etc/systemd/system/ directory looks like now:

network-online.target.wants/networking.service
getty.target.wants/serial-getty@ttyS2.service
multi-user.target.wants/ssh.service
multi-user.target.wants/cron.service
multi-user.target.wants/generic-board-startup.service
multi-user.target.wants/rsync.service
multi-user.target.wants/networking.service
multi-user.target.wants/rsyslog.service
multi-user.target.wants/remote-fs.target

Still seeing the same thing unfortunately:

[ *** ] (1 of 2) A start job is running for�…Board Startup (1min 1s / no limit
[ *** ] (2 of 2) A start job is running for�…-ttyS2.device (1min 1s / 1min 30s
[*** ] (2 of 2) A start job is running for�…-ttyS2.device (1min 2s / 1min 30s
[** ] (2 of 2) A start job is running for�…-ttyS2.device (1min 2s / 1min 30s
[* ] (1 of 2) A start job is running for�…Board Startup (1min 3s / no limit
[** ] (1 of 2) A start job is running for�…Board Startup (1min 3s / no limit

do you want to disable the serial terminal completely?

sudo systemctl mask serial-getty@ttyS2.service

Regards,

No, need it to login. Tried booting to rescue mode:

setenv bootargs 'console=ttyS2,115200n8 root=/dev/mmcblk0p2 rootwait systemd.debug-shell=1 systemd.unit=rescue.target'

and I get do a shell prompt eventually, then:

systemctl start serial-getty@ttyS2.service

then get:

A dependency job for serial-getty@ttyS2.service failed. See 'journalctl -xe' for details.

I have attached the output for you to examine. Now, after doing that command and doing a <Ctrl-D> then I get a login prompt!!! I’m wondering that since all of the drivers are built as modules, that maybe I should rebuild the kernel with everything linked in. Also, it is also suspect that I have to keep pressing a key to get any console output to scroll after the root filesystem is mounted. Thanks for all your help thus far.

journalctl-fail.txt (67.3 KB)

I did some investigation and built a new Debian SD card with the following kernels:

  • 4.20.16-armv7-x11
  • 5.1.1-armv7-x2
  • 5.2.20-armv7-x12
  • 5.3.15-armv7-x17
  • 5.4.129-armv7-x55
  • 5.5.19-armv7-x27
  • 5.6.19-armv7-x24
  • 5.7.19-armv7-x28
  • 5.8.18-armv7-x38
  • 5.9.16-armv7-x36

Kernels 4.20.16-armv7-x11 through and including 5.7.19-armv7-x28 boot all the way to a login prompt on the serial console. The first broken kernel is 5.8.18-armv7-x38 and it is interrupt related. The 5.8.18 kernel boots then stops after the following console messages:

[ 8.797241] systemd[1]: System time before build time, advancing clock.
[ 20.630187] systemd[1]: systemd 232 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN)
[ 20.650848] systemd[1]: Detected architecture arm.

Welcome to Debian GNU/Linux 9 (stretch)!

The board will hang and not go any further unless I start pressing the USER button on the board or entering any characters on the serial console which causes interrupts which then makes the console continue to print out boot messages. Even after holding down the <Enter> key, the serial port login console will fail to be started by systemd. Doing a difference between the config files for the 5.7 and 5.8 kernels does not show anything that should effect the serial port. However, the device trees 5.7 and 5.8 are drastically different with a lot of changes having to do with timers and clocks. I need to go figure out how to get the sources for the above kernels so that I can compare the .dts files between 5.7 and 5.8 as well as do source builds of the kernels and figure out what is going on. Any further ideas very welcome.

-Nevets

I have managed to get my BeagleBoard connected to the Internet using the 5.7.19 kernel. I still plan on investigating why newer kernels are broke, but the serial console is working so this thread could be considered resolved. I would like to know why it takes almost 90 seconds for the ttyS2 console to come up and if there was a way to make it faster.