Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 645508 - sys-apps/systemd-236-r5 with genkernel - cryptsetup device unit is not activated
Summary: sys-apps/systemd-236-r5 with genkernel - cryptsetup device unit is not activated
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo systemd Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-23 20:49 UTC by Guillaume Seren
Modified: 2023-07-22 20:19 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
fstab file (fstab,985 bytes, text/plain)
2018-01-23 20:49 UTC, Guillaume Seren
Details
boot log (boot-10,73.62 KB, text/plain)
2018-01-24 11:00 UTC, Guillaume Seren
Details
boot log (boot-1,94.63 KB, text/plain)
2018-01-24 13:17 UTC, Guillaume Seren
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Guillaume Seren 2018-01-23 20:49:04 UTC
Created attachment 516244 [details]
fstab file

Hey!
I upgraded my working laptop today with last systemd-236-r5 and I noticed a new flag was needed (CONFIG_CGROUP_BPF=y), then after all reboot, the laptop goes to emergency shell,
mount -a is working but there is not way to systemctl default.

Maybe I am unlucky or I miss something but to be sure I downgraded to 233 and it works fine,
so I masked the problematic (at least for me) version and come here to file a bug.

Some information about my setup:
profile: [20]  default/linux/amd64/17.0/desktop/plasma/systemd (stable) *
root and home are btrfs subvol
The btrfs system is in a dm-crypt setup (but it still ask me the key fine).

I did have a lot of information, but as the system is boot, I can access the journal,
here the mounting problem:

Jan 23 20:22:16 josekit470 systemd[1]: Mounted /boot.
Jan 23 20:22:16 josekit470 systemd[1]: home.mount: Bound to unit dev-mapper-crypt.device, but unit isn't active.
Jan 23 20:22:16 josekit470 systemd[1]: Dependency failed for /home.
Jan 23 20:22:16 josekit470 systemd[1]: Dependency failed for Local File Systems.
Jan 23 20:22:16 josekit470 systemd[1]: local-fs.target: Job local-fs.target/start failed with result 'dependency'.
Jan 23 20:22:16 josekit470 systemd[1]: local-fs.target: Triggering OnFailure= dependencies.
Jan 23 20:22:16 josekit470 systemd[1]: home.mount: Job home.mount/start failed with result 'dependency'.
Jan 23 20:22:16 josekit470 systemd[1]: Starting Setup Virtual Console...

The thing is there is no real error, so if there is someone that have a clue about why I got this error,
that would be really helpfull !
Comment 1 Mike Gilbert gentoo-dev 2018-01-23 20:56:36 UTC
Please attach the full journalctl output for the boot sequence that failed.
Comment 2 Leho Kraav (:macmaN @lkraav) 2018-01-24 07:43:51 UTC
I also experienced a cryptsetup boot failure upon updating from systemd-233 (initramfs dracut-045) -> 236 (initramfs dracut-046) today.

I was able to see something like "... luksx2d25e41d19x2d1580x2d4e7cx2d8875x2d134045008f33.service not found".

At first I thought it was https://github.com/systemd/systemd/issues/6381
After some tryouts with things like `rd.luks.timeout=30` or whatnot, it didn't help, so it seemed like this older systemd-234 issue may not be related.

Then I investigated dracut, and found this commit in current `master` branch https://github.com/dracutdevs/dracut/commit/0f6d93eb9d63695a64002ec8b0421fbc9fc8a7a3#diff-4b672151d9b37747d7241b418136ac98

```
crypt: escape backslashes for systemd unit names b/c udev/initqueue/bash

otherwise
luks\x2d25e41d19\x2d1580\x2d4e7c\x2d8875\x2d134045008f33
turns to
luksx2d25e41d19x2d1580x2d4e7cx2d8875x2d134045008f33
```

This looked bad and screen heuristics seemed to support this being related.

First, I tried to monkey-patch my dracut-046 system installation manually w/ adding `luksname="$(str_replace "$luksname" '\' '\\')"` as shown in the patch (one of the hunks is inapplicable, though).

This didn't work.

Then I ran a fresh `master` dracut copy from git checkout, and now I got a working initramfs that showed my crypted root device password prompt.

Main thing I saw changed is that the password prompt now showed a nice human-readable device name, instead of the UUID like before.
Comment 3 Guillaume Seren 2018-01-24 10:59:47 UTC
I added a complete log
Comment 4 Guillaume Seren 2018-01-24 11:00:16 UTC
Created attachment 516332 [details]
boot log
Comment 5 Guillaume Seren 2018-01-24 11:05:54 UTC
@lkraav: I don't known if it is the same issue because I can unlock the dm-crypt disk, my problem is later whem mounting the btrfs subvol
Comment 6 Guillaume Seren 2018-01-24 13:17:11 UTC
Created attachment 516338 [details]
boot log
Comment 7 Guillaume Seren 2018-01-24 13:19:01 UTC
I try to switch back to systemd-236 this afternoon and the issue is still here,
I added the new log (2018-01-24 13:17 UTC) but I think there is something wrong in this version.
Comment 8 Mike Gilbert gentoo-dev 2018-01-24 15:44:16 UTC
(In reply to Leho Kraav (:macmaN @lkraav) from comment #2)

I would be happy to backport that dracut patch, but please file a new bug for it.
Comment 9 Thomas Deutschmann (RETIRED) gentoo-dev 2019-07-16 20:48:09 UTC
I don't understand why genkernel is in the subject. Can somebody explain?
Comment 10 Guillaume Seren 2020-01-29 20:45:19 UTC
As the code of genkernel wasn't changed and the breaking factor was systemd version, I guess they changed something maybe the patch of dracut help I didn't test it.

Actually I didn't experience the issue anymore, so unless this is a active problem for someone, I suggest to close this.
Comment 11 Guillaume Seren 2020-01-29 20:45:39 UTC
As the code of genkernel wasn't changed and the breaking factor was systemd version, I guess they changed something maybe the patch of dracut help I didn't test it.

Actually I didn't experience the issue anymore, so unless this is a active problem for someone, I suggest to close this.