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-generate-config: fix for swapless kernels #49835

Merged
merged 1 commit into from Nov 17, 2018

Conversation

Synthetica9
Copy link
Member

@Synthetica9 Synthetica9 commented Nov 6, 2018

Motivation for this change

Fixes #49826

I don't actually speak Perl, but this seems about right?

Things done
  • 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 compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

@joachifm
Copy link
Contributor

joachifm commented Nov 7, 2018

@GrahamcOfBorg test installer

@GrahamcOfBorg
Copy link

Success on x86_64-linux

Attempted: tests.installer

No partial log is available.

@GrahamcOfBorg
Copy link

Success on aarch64-linux

Attempted: tests.installer

No partial log is available.

@@ -314,14 +314,16 @@ sub findStableDevPath {

# Generate the swapDevices option from the currently activated swap
# devices.
my @swaps = read_file("/proc/swaps");
shift @swaps;
my @swaps = read_file("/proc/swaps", err_mode => 'carp');
Copy link
Member

Choose a reason for hiding this comment

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

Because I just spent 10 minutes trying to find the docs on this:

The err_mode option has three possible values: quiet, carp, or the default, croak. In quiet mode, all errors will be silent. In carp mode, all errors will be emitted as warnings. And, in croak mode, all errors will be emitted as exceptions. Take a look at Try::Tiny or Syntax::Keyword::Try to see how to catch exceptions.

From https://metacpan.org/pod/File::Slurp#read_file

@infinisil infinisil merged commit 5c4ed80 into NixOS:master Nov 17, 2018
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

5 participants