Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix(tool): parse osrel sections without trailing null #423

Merged
merged 1 commit into from
Jan 19, 2025

Conversation

mjm
Copy link
Contributor

@mjm mjm commented Jan 10, 2025

In systemd 257.1, which is currently on staging-next in nixpkgs, systemd-boot no longer terminates its PE sections with null bytes: systemd/systemd#34950. This leads to an error when installing Lanzaboote:

Installing Lanzaboote to "/boot"...
Failed to read systemd-boot version from "/nix/store/qz2c1an9hyg1paah2xx6d1fdllq0lw09-systemd-257.1/lib/systemd/boot/efi/systemd-bootx64.efi".: Failed to parse C string.: data provided is not nul terminated
Failed to install bootloader

This change has us check the last byte of the section, expecting either a NUL or a newline, and then we create a &str from that accordingly.

I tested this on two machines: one with staging-next and one with nixos-unstable, and both were able to install Lanzaboote successfully.

@mjm mjm force-pushed the push-qqpoontouoop branch from 5395ba3 to 0952e5c Compare January 10, 2025 22:36
@mjm mjm marked this pull request as ready for review January 10, 2025 22:52
@RaitoBezarius
Copy link
Member

Tested manually.

@RaitoBezarius RaitoBezarius merged commit 64d20cb into nix-community:master Jan 19, 2025
1 of 2 checks passed
@peigongdsd
Copy link

Will this patch get backported to v0.4.1?

@RaitoBezarius
Copy link
Member

We should do a new minor release v0.4.2 to fix this bug.

@RaitoBezarius
Copy link
Member

@nikstur @blitz could I have your assistance there?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants