warewulf/warewulf3

switch_root -- Kill init

jmstover opened this issue · 5 comments

So, ran into an issue where I'm using a simple cmds file system file.

Anytime I have FS set (--filesystem option), the switch_root call in the initramfs init causes a kernel panic from trying to kill PID 1.

The file is:

# Parted specific commands
select /dev/sda
mklabel gpt
mkpart primary ext4 0% 100%
name 1 scratch
mkfs 1 ext4 -L scratch

I'm provisioning a fstab file that mounts the drive. I just want the partition created during bootstrap.

Haven't been able to dig into it more than knowing that if I remove the --filesystem entry, the node boots as expected. With the --filesystem entry, there's a kernel panic on the switch_root call.

The fstab command for --filesystem is currently what causes 20-filesystems to mount the filesystem in the initramfs, so you'd need something that mounts it if you're not using the mount functionality in 20-filesystems.

I'm pretty sure we don't have a spot where you can inject a mount command between 20-filesystems and 30-getvnfs however.

I'm not using the fstab command. I'm just letting the init system mount the partition on boot, as the fstab file I'm provisioning has an entry for the disk. I just need the partition created.

Oh... you need to still into the tmpfs partitioning for root:

select tmpfs
fstab "" / tmpfs rw:relatime:mode=555 0 0

# Add you're extra lines here

Ahh... that's required to have in there for the tmpfs mount then?

Edit:
Added in, I'll test it when I'm able to. Thx.

Yep the default tmpfs specification is replaced any time you specify something for --filesystem.