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

netboot: Support cmdline variable from netboot.xyz #150360

Merged
merged 1 commit into from Jan 19, 2022

Conversation

Enzime
Copy link
Member

@Enzime Enzime commented Dec 12, 2021

Motivation for this change

Allows the kernel params to be specified from netboot.xyz's utilities menu.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • 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/)
  • 22.05 Release Notes (or backporting 21.11 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
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@nshalman
Copy link
Member

The idea looks good to me. I'm getting confused by that ''
To my eye that looks like it would end the string in the wrong place rather than just adding the raw ${cmdline} in the right spot. Am I missing something?

@Enzime
Copy link
Member Author

Enzime commented Dec 12, 2021

${cmdline} gets expanded by Nix, you need the the double single quotes prefix to escape it

@nshalman
Copy link
Member

${cmdline} gets expanded by Nix, you need the the double single quotes prefix to escape it

A quick test with the repl shows me that you're correct (I find that syntax confusing all the same...):

nix-repl> foo = "bar"

nix-repl> ''${foo} ''${foo} ${foo}''
"bar ${foo} bar"

Copy link
Member

@nshalman nshalman left a comment

Choose a reason for hiding this comment

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

Thank you!

@Enzime Enzime requested a review from abbradar December 13, 2021 00:56
@Enzime
Copy link
Member Author

Enzime commented Dec 13, 2021

@GrahamcOfBorg test boot.uefiNetboot boot.biosNetboot

@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-already-reviewed/2617/424

@Enzime Enzime requested a review from Mic92 December 23, 2021 01:21
@nshalman
Copy link
Member

@Enzime noted:

Although I'm not sure if I should default cmdline to config.boot.kernelParams if cmdline is not set, or if it should remain as it is now.

For clarity, it looks like currently config.boot.kernelParams just contains loglevel=4 if that helps with decision making.

Maybe @antonym can quickly weigh in with a suggestion? I don't have a strong preference either way.

@Enzime
Copy link
Member Author

Enzime commented Jan 11, 2022

After thinking about it, I think just having cmdline be separate is better, that way you'll always get the kernel params you compiled with unless you explicitly override it in cmdline, otherwise you would have to retype all your kernel params in cmdline if you ever set it.

@nshalman
Copy link
Member

After thinking about it, I think just having cmdline be separate is better, that way you'll always get the kernel params you compiled with unless you explicitly override it in cmdline, otherwise you would have to retype all your kernel params in cmdline if you ever set it.

I agree.

@github-actions
Copy link
Contributor

Successfully created backport PR #155562 for release-21.11.

@Enzime Enzime deleted the fix-netboot-cmdline branch January 19, 2022 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants