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 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
Member

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

@flokli flokli requested a review from cleverca22 May 14, 2020 15:15
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 NixOS#87687
Fixes NixOS/nixops#574
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
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 09:29
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.

nixos/systemd: missing systemd units proc-sys-fs-binfmt_misc.mount proc-sys-fs-binfmt_misc.mount
3 participants