Write boot log to the serial port
Mail from: https://github.com/patrakov
Some cloud providers provide convenient read-only access to the serial port of the guest, and name this "Get logs" (AWS) or "Syslog" (Selectel). So, unless it breaks something e.g. in VirtualBox where the serial port is not connected, I would recommend adding this to the default kernel command line of the cloud image:
console=ttyS0 console=tty0
Then, because of https://github.com/systemd/systemd/issues/9899, edit /etc/systemd/journald.conf:
[Journal]
ForwardToConsole=yes
TTYPath=/dev/ttyS0And then you can probably use this in the CI for better debugging, by adding this instead of the -nographic qemu command line argument:
-display none -chardev file,id=moo,path=/dev/stdout,mux=off -device isa-serial,chardev=moo
Also mentioned in the OpenStack doc: https://docs.openstack.org/image-guide/openstack-images.html#ensure-image-writes-boot-log-to-console and Debian does it: https://salsa.debian.org/openstack-team/debian/openstack-debian-images/-/blob/09050c2863d7104c52459715f13024796e9e2b8e/build-openstack-debian-image#L1897
I'm not sure about this, need more research..