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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member

spinus commented Nov 28, 2020

@mvnetbiz thanks, that looks pretty good.

@mvnetbiz
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member

Choose a reason for hiding this comment

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

@bqv
Copy link
Copy Markdown
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
@mvnetbiz
Copy link
Copy Markdown
Contributor Author

mvnetbiz commented Jun 5, 2021

It looks like it didn't notifiy automatically, but I think I will close this in favor of #125600, which includes more fixes and some new options for image customization as well, and hopefully the NixOS test from here can be integrated, which now includes the standalone adb.

@samueldr samueldr mentioned this pull request Jun 6, 2021
14 tasks
samueldr added a commit to samueldr/nixpkgs that referenced this pull request Jun 8, 2021
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 <mvnetbiz@gmail.com>
herkhinah pushed a commit to herkhinah/nixpkgs that referenced this pull request Jun 25, 2021
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 <mvnetbiz@gmail.com>
considerate pushed a commit to considerate/nixpkgs that referenced this pull request Aug 24, 2021
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 <mvnetbiz@gmail.com>
mkg20001 pushed a commit to mkg20001/nixpkgs that referenced this pull request Nov 13, 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 15, 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 17, 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 18, 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 18, 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 20, 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 21, 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 21, 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 24, 2021
This enables ashmem, binder so waydroid/anbox works with
the provided linux kernel

Cherry-picked from NixOS#102341
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.