Skip to content

Commit

Permalink
Merge pull request #206 from nix-community/generic-lzbt
Browse files Browse the repository at this point in the history
lzbt: abstraction for multiple backends
  • Loading branch information
nikstur authored Sep 14, 2023
2 parents 7ef2b13 + ff442cd commit 45b529c
Show file tree
Hide file tree
Showing 28 changed files with 403 additions and 344 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Boot effective:

These steps will not be covered here.

### `lzbt`, the Lanzaboote tool
### `lzbt-*`, the Lanzaboote tool

At the moment, boot loaders, kernels and initrds on NixOS are signed
on the current system. These then need to be prepared as [Unified
Expand All @@ -68,7 +68,13 @@ installs the UKI along with other required files to the
ESP. `lzbt` is also aware of multiple NixOS generations and will
sign all configurations that should be bootable.

`lzbt` lives in [`rust/tool`](rust/tool).
We have multiple backends for `lzbt`:

- `lzbt-systemd` lives in [`rust/tool/systemd`](rust/tool/systemd)

In the future, `lzbt` may support more backends.

Shared code lives in [`rust/tool/shared`](rust/tool/shared).

### Stub

Expand Down
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,10 @@
stub = stubCrane.package;
fatStub = fatStubCrane.package;

# TODO: when we will have more backends
# let's generalize this properly.
toolCrane = buildRustApp {
pname = "lanzaboote-tool";
pname = "lzbt-systemd";
src = ./rust/tool;
extraArgs = {
TEST_SYSTEMD = pkgs.systemd;
Expand All @@ -187,7 +189,7 @@
# Clean PATH to only contain what we need to do objcopy. Also
# tell lanzatool where to find our UEFI binaries.
makeWrapper ${tool}/bin/lzbt $out/bin/lzbt \
makeWrapper ${tool}/bin/lzbt-systemd $out/bin/lzbt \
--set PATH ${lib.makeBinPath [ pkgs.binutils-unwrapped pkgs.sbsigntool ]} \
--set LANZABOOTE_STUB ${stub}/bin/lanzaboote_stub.efi
'';
Expand Down
Loading

0 comments on commit 45b529c

Please # to comment.