lkrg-org / lkrg

Linux Kernel Runtime Guard
https://lkrg.org
Other
402 stars 72 forks source link

mkosi-mainline "Failed to start initrd-switch-root.service - Switch Root." #287

Closed solardiz closed 9 months ago

solardiz commented 9 months ago

@vt-alt mkosi-mainline is failing for 2 days with:

 [  OK  ] Reached target initrd-switch-root.target - Switch Root.
         Starting initrd-switch-root.service - Switch Root...
[FAILED] Failed to start initrd-switch-root.service - Switch Root.
See 'systemctl status initrd-switch-root.service' for details.

Generating "/run/initramfs/rdsosreport.txt"
vt-alt commented 9 months ago

Looks like boot failure. Ubuntu seems diverging more and more from that old mkosi we use.

vt-alt commented 9 months ago

It seems that GitHub does not even plan to add Ubuntu newer than 22.04 on runners in foreseeable future, so we still cannot start to use latest mkosi again.

solardiz commented 9 months ago

@vt-alt So we need to use mkosi v14 tag, right? Will you please make this change? Thanks!

vt-alt commented 9 months ago

We already using v14.

I thought - maybe we finally can switch to a newer mkosi to fix the issue, but it's not time yet.

solardiz commented 9 months ago

@vt-alt Ah, so since we have to stay with v14, we should also stay with older Ubuntu? Can we?

vt-alt commented 9 months ago

Cannot, because (the) mainline kernels are for bleeding edge Ubuntu-s by design.

vt-alt commented 9 months ago

I debugged the boot process and found that the immediate cause of the boot failure is Dracut not mounting the root filesystem even though all devices are present.

Dracut does not say why but with debug enabled (rd.debug rd.debugverbose) it says too much and it's still unclear why.

Instead of delving deeper and becoming Dracut expert, it occurs to me that we can simply pass root=LABEL=root into cmdline, as mkosi creates root fs with the label root. And the experiment shows that this works.

ps. When failure first occurred dracut version is unchanged being dracut-059-4ubuntu2. pps. What is changed:

-Preparing to unpack .../systemd_253.5-1ubuntu4_amd64.deb ...
+Preparing to unpack .../systemd_253.5-1ubuntu5_amd64.deb ...

Perhaps we are affected by this change backporting https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=a366279a84730e92ed734710560ea833709f359d deleting systemd-gpt-auto-generator for unspecified reasons.