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

Grub: default is signed int. Fixes #42152 #42211

Merged
merged 3 commits into from Jun 19, 2018
Merged

Grub: default is signed int. Fixes #42152 #42211

merged 3 commits into from Jun 19, 2018

Conversation

dje4321
Copy link
Contributor

@dje4321 dje4321 commented Jun 19, 2018

Motivation for this change

grub.default is type signed int but grub supports passing "saved" as the default option to boot the previous os.

Breaks compatibility with exsisting nixos configs but just requires changing the option from int to str.

Things done

set boot.loader.grub.default to type.str and set install-grub.pl to use str

  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests) tested against boot.nix boot-stage1.nix
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • [N/A] Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

default = 0;
type = types.int;
default = "0";
type = types.str;
Copy link
Member

@Mic92 Mic92 Jun 19, 2018

Choose a reason for hiding this comment

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

How about?

type = types.either types.int types.str;
apply = toString;

or

type = types.either types.int (types.enum [ "saved" ]);
apply = toString;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh neat. didnt know you could do the either thing

@Mic92
Copy link
Member

Mic92 commented Jun 19, 2018

@GrahamcOfBorg test boot.biosUsb

@GrahamcOfBorg
Copy link

No attempt on aarch64-linux (full log)

The following builds were skipped because they don't evaluate on aarch64-linux: tests.boot.biosUsb

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: tests.boot.biosUsb

Partial log (click to expand)

machine# [  575.313458] [2031]: Failed to unmount /nix/.ro-store: Device or resource busy
machine# [  575.314430] [2032]: Unmounting '/iso'.
machine# [  575.314793] [2032]: Failed to unmount /iso: Device or resource busy
machine# [  575.316568] ACPI: Preparing to enter system sleep state S5
machine# [  575.317072] reboot: Power down
collecting coverage data
syncing
test script finished in 605.13s
cleaning up
/nix/store/p7ljxs6yc50y2cn81m36h3z963g6hdd1-vm-test-run-boot-bios-usb

@Mic92 Mic92 merged commit 81eaa7a into NixOS:master Jun 19, 2018
@dje4321 dje4321 deleted the dje4321 branch July 31, 2023 03:15
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

3 participants