Discussion about Waydroid(especially the kernel)

Ok, I finally managed to get it working with the (almost) stock kernel. Basically running the stock kernel with a small systemd service to load the ashmem module on boot. It’s hacky but it works.

The first thing I needed to make this works came from here:

git clone https://github.com/JayDoubleu/silverblue-toolbox-ashmem.git
make -C silverblue-toolbox-ashmem/ashmem
sudo insmod silverblue-toolbox-ashmem/ashmem/ashmem_linux.ko

Since I run a secure boot system, I had to manually sign the module before being able to use it. I was so used to having to manually sign the NVIDIA kernel modules that this part was relatively easy:

sudo /usr/src/kernels/$(uname -r)/scripts/sign-file sha256 /etc/pki/akmods/private/private_key.priv /etc/pki/akmods/certs/public_key.der ~/silverblue-toolbox-ashmem/ashmem/ashmem_linux.ko

(In my case I changed the folder where I cloned the git repo, so you’d have to change the command accordingly if you don’t want to leave that folder in your /home.

Now running sudo insmod silverblue-toolbox-ashmem/ashmem/ashmem_linux.ko works (if you have a secure boot system).

After that I just created a small script with that command and a systemd service to load that on boot. I’m sure that there are 100 different, cleaner ways to make this work. But that’s the one I found, and it works! Except it doesn’t.

Whenever I reboot I get this error. And just like you can find in the end of that issue, I tried this workaround

You need to create a systemd mount file for binderfs and override a waydroid-container.service to symlink binderfs devices to /dev .

/etc/systemd/system/dev-binderfs.mount

Description=/dev/binderfs mount
ConditionCapability=CAP_SYS_ADMIN

[Mount]
What=binder
Where=/dev/binderfs
Type=binder
Options=context=system_u:object_r:device_t:s0

/etc/systemd/system/waydroid-container.service.d/override.conf

[Unit]
RequiresMountsFor=/dev/binderfs
After=dev-binderfs.mount

[Service]
ExecStartPre=/bin/sh -c ‘ln -fs /dev/binderfs/* /dev/’

…which worked!