all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: phodina <phodina@protonmail.com>
To: Tobias Geerinckx-Rice <me@tobias.gr>
Cc: help-guix <help-guix@gnu.org>
Subject: Re: Custom libre kernel configuration devolving into Anbox review I guess
Date: Sun, 14 Nov 2021 07:13:51 +0000	[thread overview]
Message-ID: <WRl_j54mz0iXZBkomsIZpVCPyGynvy5YQR9TpLFCP82mBLPfcCiUg6rZYYX1So6KyuS2MuVzN-qKXsEahzIyYAdSXvaDEiizlgOaawh3xFA=@protonmail.com> (raw)
In-Reply-To: <87ee7kjhzw.fsf@nckx>

Tobias,

On Saturday, November 13th, 2021 at 1:23 PM, Tobias Geerinckx-Rice <me@tobias.gr> wrote:

> Petr,
>
> phodina 写道:
>
> > Though the issue seems to come from the Archlinux Wiki[1] where > they supply wrong CONFIG options.
>
> Well… yes, it's a wiki. The Arch one in particular has a reputation to uphold.
>
> Still, it[1] doesn't suggest either of the problematic
>
> -   ("CONFIG_ASHMEM" . m)
> -   ("CONFIG_ANDROID_BINDER_IPC" . m)
>
>     values. These can't work:
>
>     config ASHMEM
>
>     bool "Enable the Anonymous Shared Memory Subsystem"
>
>     config ANDROID_BINDER_IPC
>
>     bool "Android Binder IPC Driver"
>
>     So don't waste time hunting down dependencies which don't exist. The third-party modules[2] were never part of Linux and are by now well obsolete.

I checked the kernel KConfig help on that one and compared the options with Fedora 35, where I have a running Waydroid instance.

>
>     From the same wiki:
>
> > CONFIG_ANDROID_BINDER_DEVICES="binder,hwbinder,vndbinder"
> >
> > [lalala lala]
> >
> > With your new kernel, you will need to append the following to > your
> >
> > boot arguments:
> >
> > binder.devices=binder,hwbinder,vndbinder,anbox-binder,\
> >
> > anbox-hwbinder,anbox-vndbinder
>
> Why does it first recommend a different value from what ‘you will need’ to boot with later? Merely because it's the Kconfig default? This does not fill me with confidence.

As you already mentioned this sounds fishy. I'm also noticing the inconsistencies and would like to get it right here in Guix.

>
> Later(!) on, it suggests yet a third, seemingly preferred, option:
>
> > scripts/config --set-str CONFIG_ANDROID_BINDER_DEVICES ""
> >
> > [because]
> >
> > Not everybody was happy with the binder module in Linux. To > address
> >
> > the issues, binderfs was created. One has to choose between the > old
> >
> > and the new way when compiling the kernel. With the options > [above],
> >
> > one will use binderfs instead.
>
> So… maybe that's the cool (and more secure) new thing and we should be using binderfs without any DEVICES instead? Is binderfs some kind of /dev/pts for them? Have you tested Waydroid without any?

I'm trying to test/port Waydroid now on Guix. However, firstly it requires the modification of the kernel as already discussed (though not resolved on what exact configuration is needed).

Secondly there needs to be the Waydroid Python userspace app. I've created a patch for that here [1]. Still awaits review.

In order to run Waydroid you need Wayland compositor and LXD service. The latter is not yet implemented. I've found a patch implementing the support, but it need some polishing [2]. Though at the current state the LXD runs.

After adding the LXD service to the system I managed to initiate the Waydroid.

But as I attempt to open a session I get error regarding not running wayland session which is strange.

# waydroid.py session start
Password:
[07:40:41] XDG Session is not "wayland"

The official setup is Debian with systemd, so I'll investigate this issue further on the repo's github issues.

On Fedora and Archlinux I don't have this issue.

>
> I'm picky because I want to suggest the following, which makes it important that at least one person understands these changes and that we get them right:
>
> Do we really need yet another kernel variant? Building nearly-identical kernels on CI is quite expensive, especially on ARM. Let's not add them lightly.
>

I totally agree with you as another kernel variant is huge demand on the CI resources. On the other hand people not wanting running the Android apps on their machine would probably prefer to have this disabled, right?

Also is it possible to add the kernel variant but mark it not to build on the CI?

> Is this code so dubious — compared to the rest of CONFIG_STAGING, which we already enable — that it must be quarantined in a separate kernel? If so, why?
>

Well you add additional code complexity, creating kernel which needs more resources and creating a potential security issue with new syscall. Though I'm not expert in this area and it definitely need deeper discussion.

I also used/I'm using Fedora/Archlinux and the current status there is that they these setting are not enabled by default in the "main" kernel, but they build one - Zen (Arch) and XanMod (Fedora) - where these options are enabled.

Don't know the reason why they separate it, IMHO it might be due to the reasons mentioned above.

> Do these options make practical sense to enable on non-ARM kernels? Does Android run on them?
>

Yes, you can run Android images for x86 [3]. You can play Android game or in my case I run unfortuantely a proprietary messaging app to chat with friends without touching the phone.

At the moment I run Waydroid on my x86 machine and on PinePhone (aarch64).

> Why was CONFIG_ANDROID_BINDERFS set to #f in your previous patch[0]? Typo? Evolved knowledge?
>

Yes, this was a typo. Sorry for the confusion.

> I often forget to do so myself but still recommend adding a human-readable ‘v1 -> v2’ changelog (that won't be added to the git commit message) to explain such changes and catch any unintented ones.
>

Good idea, I'll add it to my list of this to check.

> Kind regards,
>
> T G-R
>
> PS: Another nitpick, but as CONFIG_ANDROID ‘unlocks’ CONFIG_ASHMEM, please move the latter to the end of the list.

Sure.

>
> [0]: https://issues.guix.gnu.org/51771#1
>
> [1]: https://wiki.archlinux.org/title/Waydroid
>
> [2]: https://github.com/anbox/anbox-modules/issues/75


 [1]: https://issues.guix.gnu.org/51737
 [2]: https://issues.guix.gnu.org/50133
 [3]: https://www.android-x86.org/
 [4]: https://googleprojectzero.blogspot.com/2016/12/bitunmap-attacking-android-ashmem.html


      parent reply	other threads:[~2021-11-14  7:14 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-11 12:31 Custom libre kernel configuration phodina
2021-11-11 12:49 ` André A. Gomes
2021-11-11 13:08   ` phodina
2021-11-11 13:23 ` Tobias Geerinckx-Rice
2021-11-11 14:13   ` phodina
2021-11-11 15:01     ` Tobias Geerinckx-Rice
2021-11-11 15:19       ` phodina
2021-11-12 23:38         ` Tobias Geerinckx-Rice
2021-11-13  8:08           ` phodina
2021-11-13 12:23             ` Custom libre kernel configuration devolving into Anbox review I guess Tobias Geerinckx-Rice
2021-11-13 13:44               ` Tobias Geerinckx-Rice
2021-11-14  7:13               ` phodina [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='WRl_j54mz0iXZBkomsIZpVCPyGynvy5YQR9TpLFCP82mBLPfcCiUg6rZYYX1So6KyuS2MuVzN-qKXsEahzIyYAdSXvaDEiizlgOaawh3xFA=@protonmail.com' \
    --to=phodina@protonmail.com \
    --cc=help-guix@gnu.org \
    --cc=me@tobias.gr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.