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: create /dev/std{in,out,err} symlinks #102938

Merged
merged 1 commit into from Nov 25, 2020
Merged

nixos/stage-1: create /dev/std{in,out,err} symlinks #102938

merged 1 commit into from Nov 25, 2020

Conversation

cruegge
Copy link
Contributor

@cruegge cruegge commented Nov 5, 2020

Motivation for this change

One of my activation scripts broke during boot after updating to 20.09, the error message saying that /dev/stdin is missing. It turns out that a recent change to udev (systemd/systemd@6b2229c) removes generation of the /dev/std{in,out,err} symlinks. They are still created by systemd at the end of stage-2, but are missing during the first run of the activation scripts. This PR adds them in stage-1, around the place where udevd is started and the /dev/fd symlink is created.

The other option would have been to revert 16bdaf3 and resurrect the stdio block in the activation scripts. However, since that block has been obsolete for a while, there may now be activation script snippets around that need /dev/stdin but do not declare a depencency on stdio.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-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.

This used to be done by udev, but that was removed in
systemd/systemd@6b2229c. The links are created by systemd at the end of
stage-2, but activation scripts might need them earlier.
@flokli
Copy link
Contributor

flokli commented Nov 11, 2020

@cruegge nice find! I hope we can avoid using all this, once we moved to systemd-in-initrd.

Do you have an idea which activation script was causing this, so I can test this?

@cruegge
Copy link
Contributor Author

cruegge commented Nov 11, 2020

It was triggered by one of my own scripts, or more specifically by a third-party tool that I use. I don't know whether it affects any scripts in nixpkgs at all, but I thought it would be best to fix it there nevertheless.

Copy link
Contributor

@flokli flokli left a comment

Choose a reason for hiding this comment

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

The symlinks look sane, and I was still able to successfully run the installer luks2 test with it. Let's merge this 👍

@flokli flokli merged commit 5b3a952 into NixOS:master Nov 25, 2020
@cruegge cruegge deleted the dev-symlinks branch November 30, 2020 11:13
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