I built linux on x86_64 with defconfig where BLK_DEV_INITRD=y and INITRAMFS_SOURCE=initramfs. The initramfs source directory has only empty directories: bin, dev, etc, lib, lib64, mnt/root, proc, root, run, sbin, sys.
I tried to run this in qemu
qemu-system-x86_64 -kernel arch/x86_64/boot/bzImage -nographic -append console=ttyS0
but it panicked:
[ 2.391692] /dev/root: Can't open blockdev
[ 2.394729] VFS: Cannot open root device "" or unknown-block(0,0): error -6
[ 2.395504] Please append a correct "root=" boot option; here are the available partitions:
[ 2.397263] 0b00 1048575 sr0
[ 2.397855] driver: sr
[ 2.398794] List of all bdev filesystems:
[ 2.399181] ext3
[ 2.399244] ext2
[ 2.399562] ext4
[ 2.399739] vfat
[ 2.399898] msdos
[ 2.400061] iso9660
[ 2.400274]
[ 2.401402] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[ 2.403495] CPU: 0 UID: 0 PID: 1 Comm: swapper/0 Not tainted 6.12.48 #4
[ 2.404153] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[ 2.405391] Call Trace:
[ 2.407642] <TASK>
[ 2.408358] dump_stack_lvl+0x4e/0x70
[ 2.409508] panic+0x10e/0x2bd
[ 2.409763] mount_root_generic+0x1c9/0x270
[ 2.410179] prepare_namespace+0x1e7/0x230
[ 2.410511] kernel_init_freeable+0x200/0x210
[ 2.410803] ? __pfx_kernel_init+0x10/0x10
[ 2.411014] kernel_init+0x15/0x130
[ 2.411197] ret_from_fork+0x2f/0x50
[ 2.411388] ? __pfx_kernel_init+0x10/0x10
[ 2.411625] ret_from_fork_asm+0x1a/0x30
[ 2.411941] </TASK>
[ 2.413070] Kernel Offset: 0x2d800000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff)
[ 2.414159] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) ]---