On Mon, 24 Jul 2023 22:05:04 +0000 Azat Khusainov <xycain...@gmail.com> wrote: > Package: cloud.debian.org > Severity: important > X-Debbugs-Cc: xycain...@gmail.com > > Dear Maintainer, > > I've tried to run "genericcloud" arm64 image on QEMU with "device virtconsole" argument and direct kernel boot with "console=hvc0" kernel parameter. > When "hvc0" is the only console argument in kernel parameters - debian doesn't boot. > But when i configure additional console argument like this: "console=ttyAMA0 console=hvc0" - it boots normally. > In this case "/sys/class/tty/console/active" contains both consoles "ttyAMA0 hvc0". > However "serial-getty" doesn't start at hvc0 as expected. Systemd has to spawn getty on hvc0 when it's present. > I've tried to boot VM using GRUB with 'GRUB_CMDLINE_LINUX="console=hvc0"' option. > It runs - but ttyAMA0 activates anyway and "/sys/class/tty/console/active" again contains both consoles "ttyAMA0 hvc0". > I've tested debian-12-genericcloud-arm64 and debian-11-genericcloud-arm64 images with same result. > Noteworthy i've tried another distributions (Ubuntu, Fedora and openSUSE "cloud" arm64 images) and they all work with "hvc0" configured as the only console, "/sys/class/tty/console/active" contains only "hvc0" and serial-getty automatically started on hvc0. > >
Debian's initramfs is missing the virtio_console module, and so systemd doesn't see hvc0 when its getty-generator runs early in the boot process. You can verify the absence of virtio_console in your initramfs by running "lsinitramfs `readlink -f /boot/initrd.img` | grep virtio_console". A simple way to fix this is to add "virtio_console" to /etc/initramfs-tools/modules and then run "update-initramfs -u" After you reboot, systemd's getty generator will be able to find hvc0 and will automatically start serial-getty@hvc0 Could debian please consider automatically adding virtio_console to the initramfs for the cloud images? Or better yet, build the kernel with CONFIG_VIRTIO_CONSOLE set to 'y' instead of 'm' ?