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/binfmt: move systemd-binfmt.service to binfmt module #87742

Merged
merged 2 commits into from May 18, 2020

Conversation

@flokli
Copy link
Contributor

flokli commented May 13, 2020

Also, remove the dangling systemd.services.systemd-binfmt.wants = [ "proc-sys-fs-binfmt_misc.mount" ]; in systemd.nix.

If boot.binfmt.registrations != {}, systemd will install
proc-sys-fs-binfmt_misc.automount, which will auto-mount
/proc/sys/fs/binfmt_misc as soon as systemd-binfmt tries to access it.

Fixes #87687
Fixes NixOS/nixops#574

Motivation for this change

#87687

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.
@flokli
Copy link
Contributor Author

flokli commented May 13, 2020

I'd appreciate especially some input from people making use of the binfmt functionality.

cc @lovesegfault

@lovesegfault
Copy link
Contributor

lovesegfault commented May 13, 2020

I don't use binfmt, but I know @cleverca22 does

@flokli flokli requested a review from cleverca22 May 14, 2020
Also, remove the dangling systemd.services.systemd-binfmt.wants = [
"proc-sys-fs-binfmt_misc.mount" ]; in systemd.nix.

If boot.binfmt.registrations != {}, systemd will install
proc-sys-fs-binfmt_misc.automount, which will auto-mount
`/proc/sys/fs/binfmt_misc` as soon as systemd-binfmt tries to access it.

Fixes #87687
Fixes NixOS/nixops#574
@flokli flokli force-pushed the flokli:systemd-binfmt branch from e6b1512 to f472705 May 18, 2020
This adds a simple test running GNU Hello cross-compiled for armv7l and
aarch64 inside a x86_64 VM with configured binfmt.

We already build the cross toolchains in other invocations, and building
hello itself is small.
@flokli flokli force-pushed the flokli:systemd-binfmt branch from f472705 to fd49155 May 18, 2020
@flokli
Copy link
Contributor Author

flokli commented May 18, 2020

I added a small VM test to verify boot.binfmt.emulatedSystems still works after this change, and rebased on master.

I picked the configuration example from NixOS_on_ARM#Compiling_through_QEMU.

@flokli flokli requested review from mweinelt and samueldr May 18, 2020
@flokli flokli merged commit 528d35b into NixOS:master May 18, 2020
14 checks passed
14 checks passed
Evaluation Performance Report Evaluator Performance Report
Details
grahamcofborg-eval ^.^!
Details
grahamcofborg-eval-check-maintainers matching changed paths to changed attrs...
Details
grahamcofborg-eval-check-meta config.nix: checkMeta = true
Details
grahamcofborg-eval-darwin nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="fd49155"; rev="fd49155848a8ee8aa2f103fe765ddb9aed1b3d2d"; } ./pkgs/t
Details
grahamcofborg-eval-lib-tests nix-build --arg pkgs import ./. {} ./lib/tests/release.nix
Details
grahamcofborg-eval-nixos nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="fd49155"; rev="fd49155848a8ee8aa2f103fe765ddb9aed1b3d2d"; } ./nixos/
Details
grahamcofborg-eval-nixos-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="fd49155"; rev="fd49155848a8ee8aa2f103fe765ddb9aed1b3d2d"; } ./nixos/
Details
grahamcofborg-eval-nixos-options nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="fd49155"; rev="fd49155848a8ee8aa2f103fe765ddb9aed1b3d2d"; } ./nixos/
Details
grahamcofborg-eval-nixpkgs-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="fd49155"; rev="fd49155848a8ee8aa2f103fe765ddb9aed1b3d2d"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-tarball nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="fd49155"; rev="fd49155848a8ee8aa2f103fe765ddb9aed1b3d2d"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-unstable-jobset nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="fd49155"; rev="fd49155848a8ee8aa2f103fe765ddb9aed1b3d2d"; } ./pkgs/t
Details
grahamcofborg-eval-package-list nix-env -qa --json --file .
Details
grahamcofborg-eval-package-list-no-aliases nix-env -qa --json --file . --arg config { allowAliases = false; }
Details
@flokli flokli deleted the flokli:systemd-binfmt branch May 18, 2020
@datafoo datafoo mentioned this pull request May 22, 2020
3 of 19 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.