dracut icon indicating copy to clipboard operation
dracut copied to clipboard

Dracut root=<fstype>:<tag> conflicts with systemd-fstab-generator

Open hexchain opened this issue 3 years ago • 0 comments

Describe the bug When the root is specified via root=<fstype>:<tag> (e.g. virtfs, virtiofs), systemd-fstab-generator generates a sysroot.mount with the literal value of the root parameter and fails in the boot process before dracut actually mounts sysroot.

Distribution used Arch Linux

Dracut version 056

Init system systemd

To Reproduce

  1. Install arch-install-scripts (available in Fedora, Debian and Arch)
  2. Create an Arch sysroot:
    # pacstrap arch base linux dracut
    
  3. Enter the Arch sysroot and prepare the kernel and initramfs (kver is 5.18.0-arch1-1 as of now, please adjust accordingly):
    # arch-chroot arch
    (chroot) # cp /usr/lib/modules/<kver>/vmlinuz /boot/vmlinuz-linux
    (chroot) # dracut -f -N --kver <kver> -a virtfs /boot/initramfs-linux.img
    
  4. Try to start a virtual machine with the sysroot:
    # qemu-system-x86_64 -nographic -smp 2 -m 2G -accel kvm -kernel arch/boot/vmlinuz-linux -initrd arch/boot/initramfs-linux.img -virtfs local,id=rootfs,security_model=passthrough,mount_tag=root,path=arch -append "root=virtfs:root rw debug console=ttyS0 rd.shell"
    

Expected behavior The virtual machine should boot into system without any problem.

Additional context It works if the systemd dracut module is disabled.

hexchain avatar May 29 '22 08:05 hexchain