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

stage-1 init: fix debug menu #65379

Merged
merged 1 commit into from Aug 19, 2019
Merged

stage-1 init: fix debug menu #65379

merged 1 commit into from Aug 19, 2019

Conversation

abbradar
Copy link
Member

@abbradar abbradar commented Jul 25, 2019

Motivation for this change

Make stage 1 debug menu work as intended.

With help from https://busybox.net/FAQ.html#job_control .

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 nix-review --run "nix-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)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Tested with boot.debug1devices; both i and other options work.

* Read one char at a time, so user doesn't have to enter "i<ENTER>"
  contrary to the menu;
* Exec shell inside setsid.
@grahamc
Copy link
Member

grahamc commented Jul 25, 2019

What is the problem exactly this is fixing?

@abbradar
Copy link
Member Author

abbradar commented Jul 25, 2019

@grahamc Sorry, didn't explain it better: the problem is that in the menu we say "press key" but actually user has to enter e.g. i and press RET because we read line, not a character.

exec is a small optimization; I noticed it when I tried to understand what's wrong reading busybox FAQ.

EDIT: Actually I think without exec interactive shell won't work at all because it won't be the session leader.
EDIT2: I tested it and it works without exec too, so this is just an optimization.

@abbradar
Copy link
Member Author

I tested this on several machines before and now; it works. Let's merge this.

@abbradar abbradar merged commit fca97df into NixOS:master Aug 19, 2019
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

2 participants