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 stage-1: fix init existence test #49537

Merged
merged 1 commit into from Apr 18, 2019

Conversation

lheckemann
Copy link
Member

@lheckemann lheckemann commented Oct 31, 2018

Motivation for this change

The previous version contained a false positive case, where boot would
continue when the stage 2 init did not exist at all, and a false
negative case, where boot would stop if the stage 2 init was a symlink
which cannot be resolved in the initramfs root.

Fixes #49519.

Thanks @michas2 for finding and reporting the issue!

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.

The previous version contained a false positive case, where boot would
continue when the stage 2 init did not exist at all, and a false
negative case, where boot would stop if the stage 2 init was a symlink
which cannot be resolved in the initramfs root.

Fixes NixOS#49519.

Thanks @michas2 for finding and reporting the issue!
@lheckemann
Copy link
Member Author

@GrahamcOfBorg test boot boot-stage1

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: tests.boot, tests.boot-stage1

Partial log (click to expand)

machine: exit status 1
syncing
machine: running command: sync
machine: exit status 0
test script finished in 12.29s
cleaning up
killing machine (pid 597)
vde_switch: EOF on stdin, cleaning up and exiting
vde_switch: Could not remove ctl dir '/build/vde1.ctl': Directory not empty
/nix/store/bxnr3695v6pkc753iym2rysg91jmb3bq-vm-test-run-boot-stage1

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: tests.boot, tests.boot-stage1

Partial log (click to expand)

machine: exit status 1
syncing
machine: running command: sync
machine: exit status 0
test script finished in 13.12s
cleaning up
killing machine (pid 631)
vde_switch: EOF on stdin, cleaning up and exiting
vde_switch: Could not remove ctl dir '/build/vde1.ctl': Directory not empty
/nix/store/95yf32k1b1kwgmbnzdsbdd9fb3rkzy82-vm-test-run-boot-stage1

@lheckemann
Copy link
Member Author

I don't know if there are any other tests I should really do for this. cc @edolstra @abbradar @vcunat, major contributors to stage-1-init.sh

Copy link
Contributor

@tomberek tomberek left a comment

Choose a reason for hiding this comment

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

Seems reasonable.

@lheckemann lheckemann merged commit 42c107c into NixOS:master Apr 18, 2019
@lheckemann lheckemann deleted the stage1-symlink-fix branch April 18, 2019 15:59
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.

Stage 1 boot script does not recognize existing init
4 participants