Skip to content
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

syslinux: Use Nixpkgs' gnu-efi #317030

Merged
merged 2 commits into from
Jun 4, 2024

Conversation

samueldr
Copy link
Member

@samueldr samueldr commented Jun 3, 2024

Description of changes

#316878 aimed to change how gnu-efi was fetched. My understanding (after futzing about) is that sourceforge's git endpoint now doesn't provide direct commit access.

Instead of awkwardly fetching an older gnu-efi, prefer using Nixpkgs' gnu-efi.

Note that within Nixpkgs only the "legacy bios" syslinux is used. We could also drop the EFI build instead.

Closes #316878.

Things done

 $ nix-build -A syslinux -A pkgsi686Linux.syslinux

Ran the .efi output, from before the change, and after. Same result.

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@samueldr samueldr mentioned this pull request Jun 3, 2024
13 tasks
Copy link
Member

@raboof raboof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me, I can't really judge how risky it is to use a different version of gnu-efi than is referenced by the syslinux submodule...

pkgs/os-specific/linux/syslinux/default.nix Outdated Show resolved Hide resolved
@ofborg ofborg bot added 11.by: package-maintainer This PR was created by the maintainer of the package it changes 10.rebuild-darwin: 1-10 10.rebuild-darwin: 1 10.rebuild-linux: 1-10 labels Jun 4, 2024
@samueldr
Copy link
Member Author

samueldr commented Jun 4, 2024

Looks great to me, I can't really judge how risky it is to use a different version of gnu-efi than is referenced by the syslinux submodule...

The main risk would be that it stops building with it due to backwards-incompatible changes.

Technically the added patch works around a backwards-incompatible change, but barely so. (A feature was split off out into its own header.)

If it causes issues down the line, I believe it should be fine to disable building the EFI outputs entirely. Anyways they are not used within Nixpkgs nor NixOS. To do so would be relatively simple, removing the references to gnu-efi, and then removing the EFI targets.

I actually hesitated and almost went with just removing the EFI outputs.

This resolves awkwardness with the gnu-efi submodule.
Though this builds only the arch-appropriate EFI program, but since it
was not used within Nixpkgs, it shouldn't be an issue.
@samueldr samueldr force-pushed the fix/syslinux-gnu-efi-awkwardness branch from 31e1dcc to d38bc8b Compare June 4, 2024 01:59
@raboof raboof merged commit 391f667 into NixOS:master Jun 4, 2024
24 of 25 checks passed
Copy link
Contributor

github-actions bot commented Jun 4, 2024

Successfully created backport PR for release-24.05:

@K900
Copy link
Contributor

K900 commented Jun 4, 2024

Somehow, and I genuinely have no idea how, this breaks the ISO boot: https://cache.nixos.org/log/z24ffw9730kzaaljzy18g67jjnn2ix9h-vm-test-run-boot-bios-cdrom.drv

@raboof
Copy link
Member

raboof commented Jun 4, 2024

oof, thanks for the quick revert :/

I can indeed reproduce this with nix-build . -A nixosTests.boot.biosCdrom

@raboof
Copy link
Member

raboof commented Jun 4, 2024

created #317158

rev = "b40487005223a78c3bb4c300ef6c436b3f6ec1f7";
sha256 = "sha256-GqvRTr9mA2yRD0G0CF11x1X0jCgqV4Mh+tvE0/0yjqk=";
fetchSubmodules = true;
src = fetchFromRepoOrCz {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't know that existed. fetchgit defaults to fetching submodules, I assume this doesnt

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It also uses a zip instead of git.

Comment on lines +69 to +74
(fetchpatch {
# Fixes build with "modern" gnu-efi
# https://github.com/samueldr/syslinux/commit/68defee52f4eba82eefaeea17f21c7498448dd6b
url = "https://github.com/samueldr/syslinux/commit/68defee52f4eba82eefaeea17f21c7498448dd6b.patch";
hash = "sha256-5xIqM8Gq8D86HL1i7fBTHRB/ZR2XtCz5VsT4bI5vneo=";
})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tbh we would have been probably better off to just vendor that tiny patch to not rely on your repo 😅

@samueldr samueldr deleted the fix/syslinux-gnu-efi-awkwardness branch June 4, 2024 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Minimal ISO runtime
Development

Successfully merging this pull request may close these issues.

4 participants