Skip to content
This repository was archived by the owner on Nov 24, 2026. It is now read-only.

[v251] fix LUKS issue - #203

Merged
yuwata merged 6 commits into
systemd:v251-stablefrom
yuwata:v251-stable-fix
May 27, 2022
Merged

yuwata merged 6 commits into
systemd:v251-stablefrom
yuwata:v251-stable-fix

Conversation

@yuwata

@yuwata yuwata commented May 26, 2022

Copy link
Copy Markdown
Member

yuwata and others added 6 commits May 27, 2022 08:32
Co-Authored-By: Yu Watanabe <[email protected]>
(cherry picked from commit b22d90e)
dm-crypt device units generated by systemd-cryptsetup-generator
habe BindsTo= dependencies on their backend devices. The dm-crypt
devices have the db_persist flag set, and thus survive the udev db
cleanup while switching root. But backend devices usually don't survive.
These devices are neither mounted nor used for swap, thus they will
seen as DEVICE_NOT_FOUND after switching root.

The BindsTo dependency will cause systemd to schedule a stop
job for the dm-crypt device, breaking boot:

[   68.929457] krypton systemd[1]: systemd-cryptsetup@cr_root.service: Unit is stopped because bound to inactive unit dev-disk-by\x2duuid-3bf91f73\x2d1ee8\x2d4cfc\x2d9048\x2d93ba349b786d.device.
[   68.945660] krypton systemd[1]: systemd-cryptsetup@cr_root.service: Trying to enqueue job systemd-cryptsetup@cr_root.service/stop/replace
[   69.473459] krypton systemd[1]: systemd-cryptsetup@cr_root.service: Installed new job systemd-cryptsetup@cr_root.service/stop as 343

Avoid this by not setting the state of the backend devices to
DEVICE_DEAD.

Fixes the LUKS setup issue reported in #23429.

(cherry picked from commit cf1ac0c)
On switching root, a device may have a persistent databse. In that case,
Device.enumerated_found may have DEVICE_FOUND_UDEV flag, and it is not
necessary to downgrade the Device.deserialized_found and
Device.deserialized_state. Otherwise, the state of the device unit may
be changed plugged -> dead -> plugged, if the device has not been mounted.

Fixes #23429.

[mwilck: cherry-picked from #23437]

(cherry picked from commit 4fc69e8)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Boot to emergency mode if devices are switched to SYSTEMD_READY=0 (multipath scenario)

3 participants