This is becoming more interesting! Those messages are purely from the last stages of boot under the Linux kernel, so kernel command line should do the job. Normally the kernel considers only the last instance of some setting passed to it on command line. Earlier on you have “console=tty0”, which is the specification causing print in Linux. Then, at the end, this should be overridden since it has “console=” (and no “tty0”). I am thinking that perhaps some of the code related to what prints at the very end might not be looking at the last specification for “console=”. This seems reasonable since “console=” is one of the few tokens one can pass and it might have meaning in both the first and last instance (all due to having serial console plus regular console).
If this is the case, then you might need to use the device tree. You would edit node “chosen->bootargs”, and remove the “console=tty0” from it, then install the tree again. An example for doing this:
# If dtc is not installed, then:
sudo apt-get install device-tree-compiler
# This might have warnings, ignore them for now unless something fails.
dtc -I fs -O dts -o extracted.dts /proc/device-tree
# Now use a text editor on extracted.dts, find "bootargs" under "chosen". Look for "console=tty0",
# and remove it. Then create a binary from this:
dtc -I dts -O dtb -o edited.dtb extracted.dts
# Place a copy of this at:
/boot
# Add an FDT key/value pair naming this in "/boot/extlinux/extlinux.conf", causing it to become:
LABEL primary
MENU LABEL primary kernel
LINUX /boot/Image
FDT /boot/edited.dtb
INITRD /boot/initrd
APPEND ${cbootargs} vt.global_cursor_default=0 root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 net.ifnames=0 quiet
Once this boots you should find that file “/proc/device-tree/chosen/bootargs” no long has “console=tty0”, and this would be reflected in “cat /proc/cmdline”.
Alternate: Create a second boot entry instead of modifying the first. Use serial console to select this alternate entry (which would be the one with a new “LABEL” and new “MENU LABEL”). This is safer and leaves the original entry always available.
If there is no more “console=tty0”, and the problem persists, then you have found a bug. The workaround would then probably become one of setting the log level such that those logs are ignored during boot.