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

nixos/iso-image: improved grub and media config #279994

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gray-heron
Copy link

@gray-heron gray-heron commented Jan 10, 2024

Description of changes

Added capability to add custom grub options and modify contents of the Boot Catalog of the iso images produced by the iso-image installer module. This, for example, allows users to create custom, pre-installation, pre-boot routines, such as hardware tests, BIOS updates, etc.

Things done

  • 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
  • Extensively tested added functionality
  • 23.11 Release Notes (or backporting 23.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.

@gray-heron gray-heron requested a review from samueldr as a code owner January 10, 2024 08:47
@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Jan 10, 2024
@gray-heron gray-heron self-assigned this Jan 10, 2024
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 labels Jan 10, 2024
@gray-heron gray-heron force-pushed the feature/boot-contents2 branch 4 times, most recently from 92306d4 to b622c43 Compare January 10, 2024 16:02
@gray-heron gray-heron requested a review from nbp February 23, 2024 09:29
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/3764

@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Sep 27, 2024
@gray-heron gray-heron requested review from ElvishJerricco and removed request for samueldr October 26, 2024 09:20
@gray-heron gray-heron force-pushed the feature/boot-contents2 branch from b622c43 to 7974721 Compare October 26, 2024 09:44
@ofborg ofborg bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Oct 26, 2024
Copy link
Contributor

@misuzu misuzu left a comment

Choose a reason for hiding this comment

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

Please also rebase your PR to make sure the new CI passes

nixos/modules/installer/cd-dvd/iso-image.nix Outdated Show resolved Hide resolved
nixos/modules/installer/cd-dvd/iso-image.nix Outdated Show resolved Hide resolved
nixos/modules/installer/cd-dvd/iso-image.nix Show resolved Hide resolved
@misuzu misuzu changed the title nixos/modules/installer/cd-dvd/iso-image: improved grub and media config nixos/iso-image: improved grub and media config Dec 13, 2024
@gray-heron gray-heron force-pushed the feature/boot-contents2 branch from 7974721 to 309663d Compare December 13, 2024 17:07
@gray-heron gray-heron force-pushed the feature/boot-contents2 branch from 309663d to 4dd3bc0 Compare December 13, 2024 17:09
@gray-heron gray-heron requested a review from misuzu December 13, 2024 17:10
Copy link
Contributor

@misuzu misuzu left a comment

Choose a reason for hiding this comment

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

I had another look and I don't think I like it. The isoImage.bootContents seems redundant given there's already isoImage.contents and this change also doesn't handle the syslinux menu.
I think something like this but which also handles the syslinux part would be a right way and would also allow replacing all entries and not just adding extra stuff. It won't be easy though...

@gray-heron
Copy link
Author

When you say redundant do you mean it's possible to write to the El Torito boot catalog with just isoImage.contents? How?

Okay, I will look into the bootloader entries, it shouldn't be that difficult to make something like grubEntries and syslinuxEntries. Just a question what to expose so it makes most sense. Any ideas appreciated.

@misuzu
Copy link
Contributor

misuzu commented Dec 16, 2024

When you say redundant do you mean it's possible to write to the El Torito boot catalog with just isoImage.contents? How?

It's already handled by https://github.com/NixOS/nixpkgs/blob/3ee96dbd19fe1487a6c987b88963081c699e7309/nixos/lib/make-iso9660-image.sh and it's unrelated to the grub/syslinux menu entries so I'm no sure what you mean.

Just a question what to expose so it makes most sense. Any ideas appreciated.

I think it makes sense to be able to change the names of menu entries and kernel command lines without having to deal with the kernel/initrd details needlessly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants