core: on switching root do not emit device state change based on enumeration results#12013
core: on switching root do not emit device state change based on enumeration results#12013keszybz merged 4 commits intosystemd:masterfrom
Conversation
…thod_switch_root()
When system manager is started first time or after switching root, then the udev's device tag data do not exist yet. So, let's not honor the enumeration results. Fixes systemd#11997.
|
A test for the issue is added. I confirm that the test fails without the third commit. |
|
LGTM. @poettering? |
|
Thanks for working on this @yuwata! I rebuilt the Fedora 30 v241 packages with this patch set on top and:
|
|
@owtaylor Thank you for testing this PR. |
|
So I am not sure about this one. I think we actually do the right thing here currently in systemd, as we make sure the .device unit state stays in sync with the udev db. The problem though is that the udev db is flushed out during the transition ( |
|
After a process of elimination, it seems that this PR is the one to merge. I grok the fact that we might get some stale device information if the device is unplugged at the wrong time during boot, but this seems to be mostly a theoretical problem. Let's merge this, and maybe we can come up with some solution for this potential problem later. @owtaylor reports that this fixes his case, and my laptop with encrypted LVM also boots successfully. |
|
urks, i wished this wasn't merge. This is racy... if pid1 is reloaded between the switch root and udev being started up everything is still fucked... |
|
Well, the state before this patch was broken (failed boots on Fedora Silverblue), and there were three proposed PRs, two of which broke boot with LVM. With this patch, we at least boot to login prompt. I'd be very happy to merge a more "proper" solution, once its proposed. Dunno, maybe we should revert both this, and the preceding changes that caused the problem, and start from scratch. |
Definitively, especially since it's still broken : see https://bugzilla.suse.com/show_bug.cgi?id=1137373. And I'm not sure why it was reworked in the first place (in commit 66f3fdb) but it's broken since then :-/ |
Fixes #11997.