Skip to content

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

Merged
Mic92 merged 3 commits intoNixOS:masterfrom
dje4321:dje4321
Jun 19, 2018
Merged

Grub: default is signed int. Fixes #42152#42211
Mic92 merged 3 commits intoNixOS:masterfrom
dje4321:dje4321

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.

@GrahamcOfBorg GrahamcOfBorg 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/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Jun 19, 2018
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

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: 0 This PR does not cause any packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants