Skip to content

nixos/anbox: use mainline drivers when available#102341

Closed
mvnetbiz wants to merge 4 commits intoNixOS:stagingfrom
mvnetbiz:anbox-linux
Closed

nixos/anbox: use mainline drivers when available#102341
mvnetbiz wants to merge 4 commits intoNixOS:stagingfrom
mvnetbiz:anbox-linux

Conversation

@mvnetbiz
Copy link
Contributor

@mvnetbiz mvnetbiz commented Nov 1, 2020

Motivation for this change

virtualisation.anbox is broken on Linux 5.x

Things done
  • updated Anbox package to latest version
  • marked anbox kernel modules broken for Linux >= 5.7. They do not build because Linux 5.7 unexported kallsyms_lookup_name()
  • enable CONFIG_ options for the mainline kernel drivers needed
  • change Anbox NixOS module to use the correct drivers if using Linux 5.x

I have confirmed this working with Linux 4.19, 5.4, 5.7

  • 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.

@ofborg ofborg bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Nov 1, 2020
@ofborg ofborg bot requested a review from edwtjo November 1, 2020 10:59
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 1001-2500 This PR causes many rebuilds on Linux and should target the staging branches. labels Nov 1, 2020
@mvnetbiz mvnetbiz changed the title Anbox linux pkgs.anbox: unstable-2019-11-15 -> unstable-2020-10-26, nixos/anbox: use mainline drivers when available Nov 1, 2020
@mvnetbiz mvnetbiz marked this pull request as ready for review November 3, 2020 05:27
@mvnetbiz
Copy link
Contributor Author

mvnetbiz commented Nov 3, 2020

I've fixed the build inputs, fixed up some stuff like .desktop file and app menu category, and added a test for the service module.

@mvnetbiz
Copy link
Contributor Author

Rebased and fixed the nixos test to be reliable. Are there any concerns since this changes the kernel?

Copy link
Member

Choose a reason for hiding this comment

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

don't you have to add Type=fork if you use daemon here?
You are adding it only to avoid the warning or any other reason?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did add it to avoid the warning but the process doesn't fork anyways, or at least doesn't exit.

@spinus
Copy link
Member

spinus commented Nov 28, 2020

@mvnetbiz thanks, that looks pretty good.

@mvnetbiz
Copy link
Contributor Author

mvnetbiz commented Dec 3, 2020

I don't know what considerations should be taken for adding drivers to the default kernel, or if there is an alternative option.

Copy link
Member

@Atemu Atemu left a comment

Choose a reason for hiding this comment

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

Amazing work!

Working as wellpoorly as upstream allows AFAICT. Tested on linux_zen 5.9. Networking works too.

Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this stay but put behind a conditional for useAnboxModules?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As far as I can tell these rules don't do anything anyways.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can't recall but they either don't run or anbox works correctly with the default mode anyways.

Copy link
Member

Choose a reason for hiding this comment

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

Nixpkgs' adb has a proprietary license, not sure whether we could run this test in hydra.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will that just cause an evaluation error or any other problems? I am assuming it is still okay to keep the test here.

Copy link
Member

Choose a reason for hiding this comment

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

(Will probably adapt to the new PR)

I think it's time we have a non-SDK package for adb, fastboot and friends.

And there is one!

This is currently in use by Alpine Linux

Copy link
Member

Choose a reason for hiding this comment

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

@bqv
Copy link
Contributor

bqv commented Jan 7, 2021

Ping @mvnetbiz

@SuperSandro2000 SuperSandro2000 added the 2.status: merge conflict This PR has merge conflicts with the target branch label Jan 7, 2021
mkg20001 pushed a commit to mkg20001/nixpkgs that referenced this pull request Nov 28, 2021
This enables ashmem, binder so waydroid/anbox works with
the provided linux kernel

Cherry-picked from NixOS#102341
mkg20001 pushed a commit to mkg20001/nixpkgs that referenced this pull request Nov 29, 2021
This enables ashmem, binder so waydroid/anbox works with
the provided linux kernel

Cherry-picked from NixOS#102341
github-actions bot pushed a commit that referenced this pull request Dec 3, 2021
This enables ashmem, binder so waydroid/anbox works with
the provided linux kernel

Cherry-picked from #102341

(cherry picked from commit c2e142d)
mkg20001 pushed a commit to mkg20001/nixpkgs that referenced this pull request Dec 7, 2021
This enables ashmem, binder so waydroid/anbox works with
the provided linux kernel

Cherry-picked from NixOS#102341
mkg20001 pushed a commit to mkg20001/nixpkgs that referenced this pull request Dec 12, 2021
This enables ashmem, binder so waydroid/anbox works with
the provided linux kernel

Cherry-picked from NixOS#102341
mkg20001 pushed a commit to mkg20001/nixpkgs that referenced this pull request Dec 24, 2021
This enables ashmem, binder so waydroid/anbox works with
the provided linux kernel

Cherry-picked from NixOS#102341
mkg20001 pushed a commit to mkg20001/nixpkgs that referenced this pull request Dec 25, 2021
This enables ashmem, binder so waydroid/anbox works with
the provided linux kernel

Cherry-picked from NixOS#102341
aKriJcz pushed a commit to aKriJcz/nixpkgs that referenced this pull request Feb 16, 2022
As noted in NixOS#102341 this is not
actually running as a forked process. It only tells the process that it
is running "as a daemon, so shut the warning up".

See `daemon_` here

 - https://github.com/anbox/anbox/blob/9de4e87cdd05135e1c71e6eadb68bf82719cebdf/src/anbox/cmds/container_manager.cpp#L38-L79

It is **strictly** used to hide that message.

Co-authored-by: Matt Votava <[email protected]>
@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 31, 2022
@mvnetbiz mvnetbiz closed this Apr 7, 2023
rnhmjoj pushed a commit to rnhmjoj/nixpkgs that referenced this pull request Sep 5, 2023
As noted in NixOS#102341 this is not
actually running as a forked process. It only tells the process that it
is running "as a daemon, so shut the warning up".

See `daemon_` here

 - https://github.com/anbox/anbox/blob/9de4e87cdd05135e1c71e6eadb68bf82719cebdf/src/anbox/cmds/container_manager.cpp#L38-L79

It is **strictly** used to hide that message.

Co-authored-by: Matt Votava <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: kernel The Linux kernel 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 1001-2500 This PR causes many rebuilds on Linux and should target the staging branches.

Projects

None yet

Development

Successfully merging this pull request may close these issues.