-
-
Notifications
You must be signed in to change notification settings - Fork 18.3k
systemd: Fix systemd-cryptenroll TPM2 + fix systemd-tmpfiles-setup-dev.service #171242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| diff --git a/lib/luks2/luks2_token.c b/lib/luks2/luks2_token.c | ||
| index 88d84418..ed3a079b 100644 | ||
| --- a/lib/luks2/luks2_token.c | ||
| +++ b/lib/luks2/luks2_token.c | ||
| @@ -151,12 +151,10 @@ crypt_token_load_external(struct crypt_device *cd, const char *name, struct cryp | ||
|
|
||
| token = &ret->u.v2; | ||
|
|
||
| - r = snprintf(buf, sizeof(buf), "%s/libcryptsetup-token-%s.so", crypt_token_external_path(), name); | ||
| + r = snprintf(buf, sizeof(buf), "libcryptsetup-token-%s.so", name); | ||
| if (r < 0 || (size_t)r >= sizeof(buf)) | ||
| return -EINVAL; | ||
|
|
||
| - assert(*buf == '/'); | ||
| - | ||
| log_dbg(cd, "Trying to load %s.", buf); | ||
|
|
||
| h = dlopen(buf, RTLD_LAZY); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,7 @@ | |
| , fetchpatch | ||
| , fetchzip | ||
| , buildPackages | ||
| , makeBinaryWrapper | ||
| , ninja | ||
| , meson | ||
| , m4 | ||
|
|
@@ -345,6 +346,7 @@ stdenv.mkDerivation { | |
| nativeBuildInputs = | ||
| [ | ||
| pkg-config | ||
| makeBinaryWrapper | ||
| gperf | ||
| ninja | ||
| meson | ||
|
|
@@ -641,12 +643,6 @@ stdenv.mkDerivation { | |
| ''; | ||
|
|
||
| postInstall = '' | ||
| # sysinit.target: Don't depend on | ||
| # systemd-tmpfiles-setup.service. This interferes with NixOps's | ||
| # send-keys feature (since sshd.service depends indirectly on | ||
| # sysinit.target). | ||
| mv $out/lib/systemd/system/sysinit.target.wants/systemd-tmpfiles-setup-dev.service $out/lib/systemd/system/multi-user.target.wants/ | ||
|
|
||
| mkdir -p $out/example/systemd | ||
| mv $out/lib/{modules-load.d,binfmt.d,sysctl.d,tmpfiles.d} $out/example | ||
| mv $out/lib/systemd/{system,user} $out/example/systemd | ||
|
|
@@ -674,7 +670,14 @@ stdenv.mkDerivation { | |
| preFixup = lib.optionalString withEfi '' | ||
| mv $out/lib/systemd/boot/efi $out/dont-strip-me | ||
| ''; | ||
| postFixup = lib.optionalString withEfi '' | ||
|
|
||
| postFixup = '' | ||
| # Wrap in the correct path for LUKS2 tokens. Must be after the fixup phase | ||
| # or the rpath cleanup removes the directories again. | ||
|
Comment on lines
+675
to
+676
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This comment doesn't look right. Down there, we set |
||
| for f in lib/systemd/systemd-cryptsetup bin/systemd-cryptenroll; do | ||
| wrapProgram $out/$f --prefix LD_LIBRARY_PATH : ${placeholder "out"}/lib/cryptsetup | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we need to set
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No,
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed. Also, in |
||
| done | ||
| '' + lib.optionalString withEfi '' | ||
| mv $out/dont-strip-me $out/lib/systemd/boot/efi | ||
| ''; | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.