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

app request anbox #1710

Open
sakagsakag opened this issue Apr 19, 2022 · 9 comments
Open

app request anbox #1710

sakagsakag opened this issue Apr 19, 2022 · 9 comments

Comments

@sakagsakag
Copy link

anbox, android emu.
please.

@Crilum
Copy link
Contributor

Crilum commented Apr 19, 2022

Install instructions: https://docs.anbox.io/userguide/install.html
I've tried to install Anbox a few times, but it hasn't worked so far...

@Crilum
Copy link
Contributor

Crilum commented Apr 19, 2022

Wow, it's actually installing: snap install --devmode --edge anbox
I think what held me up last time was installing the required kernel modules, which I didn't do this time..

@theofficialgman theofficialgman mentioned this issue Apr 19, 2022
3 tasks
@sakagsakag
Copy link
Author

https://docs.anbox.io/userguide/install_kernel_modules.html

i think we need compile kernel module ashmem and binder,
am i right?
but i dont have no compiling env.

@Crilum
Copy link
Contributor

Crilum commented Apr 20, 2022

Well, I tried installing the anbox-modules-dkms package from here, and got this:

$ sudo apt install /home/pi/Downloads/anbox-modules-dkms_13_all.deb 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'anbox-modules-dkms' instead of '/home/pi/Downloads/anbox-modules-dkms_13_all.deb'
The following additional packages will be installed:
  dctrl-tools dkms raspberrypi-kernel-headers
Suggested packages:
  debtags
The following NEW packages will be installed:
  anbox-modules-dkms dctrl-tools dkms raspberrypi-kernel-headers
0 upgraded, 4 newly installed, 0 to remove and 3 not upgraded.
Need to get 28.8 MB/28.8 MB of archives.
After this operation, 183 MB of additional disk space will be used.
Do you want to continue? [Y/n] 
Get:1 /home/pi/Downloads/anbox-modules-dkms_13_all.deb anbox-modules-dkms all 13 [38.0 kB]
Get:2 http://archive.raspberrypi.org/debian bullseye/main armhf raspberrypi-kernel-headers armhf 1:1.20220331-1 [28.6 MB]
Get:3 http://mirrors.syringanetworks.net/raspbian/raspbian bullseye/main armhf dctrl-tools armhf 2.24-3 [94.2 kB]
Get:4 http://mirrors.syringanetworks.net/raspbian/raspbian bullseye/main armhf dkms all 2.8.4-3 [78.2 kB]
Fetched 28.8 MB in 5s (5,586 kB/s)                                             
Selecting previously unselected package dctrl-tools.
(Reading database ... 206783 files and directories currently installed.)
Preparing to unpack .../dctrl-tools_2.24-3_armhf.deb ...
Unpacking dctrl-tools (2.24-3) ...
Selecting previously unselected package dkms.
Preparing to unpack .../archives/dkms_2.8.4-3_all.deb ...
Unpacking dkms (2.8.4-3) ...
Selecting previously unselected package anbox-modules-dkms.
Preparing to unpack .../anbox-modules-dkms_13_all.deb ...
Unpacking anbox-modules-dkms (13) ...
Selecting previously unselected package raspberrypi-kernel-headers.
Preparing to unpack .../raspberrypi-kernel-headers_1%3a1.20220331-1_armhf.deb ..
.
Unpacking raspberrypi-kernel-headers (1:1.20220331-1) ...
Setting up raspberrypi-kernel-headers (1:1.20220331-1) ...
Setting up dctrl-tools (2.24-3) ...
Setting up dkms (2.8.4-3) ...
Setting up anbox-modules-dkms (13) ...
Loading new anbox-1 DKMS files...
It is likely that 5.15.32-v7l+ belongs to a chroot's host
Building for 5.15.32+, 5.15.32-v7+, 5.15.32-v7l+ and 5.15.32-v8+
Building initial module for 5.15.32+
Error! Bad return status for module build on kernel: 5.15.32+ (armv7l)
Consult /var/lib/dkms/anbox/1/build/make.log for more information.
dpkg: error processing package anbox-modules-dkms (--configure):
 installed anbox-modules-dkms package post-installation script subprocess return
ed error exit status 10
Processing triggers for man-db (2.9.4-2) ...
Errors were encountered while processing:
 anbox-modules-dkms
E: Sub-process /usr/bin/dpkg returned an error code (1)

and then I tried building the module itself (for which the source is in the deb), and got this:

$ make
make -C /lib/modules/5.15.32-v7l+/build V=0 M=$PWD
make[1]: Entering directory '/usr/src/linux-headers-5.15.32-v7l+'
  CC [M]  /home/pi/Downloads/anbox-modules-dkms_13_all/data/usr/src/anbox-1/ashmem/deps.o
  CC [M]  /home/pi/Downloads/anbox-modules-dkms_13_all/data/usr/src/anbox-1/ashmem/ashmem.o
  LD [M]  /home/pi/Downloads/anbox-modules-dkms_13_all/data/usr/src/anbox-1/ashmem/ashmem_linux.o
  MODPOST /home/pi/Downloads/anbox-modules-dkms_13_all/data/usr/src/anbox-1/ashmem/Module.symvers
ERROR: modpost: "kallsyms_lookup_name" [/home/pi/Downloads/anbox-modules-dkms_13_all/data/usr/src/anbox-1/ashmem/ashmem_linux.ko] undefined!
make[2]: *** [scripts/Makefile.modpost:134: /home/pi/Downloads/anbox-modules-dkms_13_all/data/usr/src/anbox-1/ashmem/Module.symvers] Error 1
make[2]: *** Deleting file '/home/pi/Downloads/anbox-modules-dkms_13_all/data/usr/src/anbox-1/ashmem/Module.symvers'
make[1]: *** [Makefile:1783: modules] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.15.32-v7l+'
make: *** [Makefile:8: all] Error 2

It looks like the problem is that the kallsyms_lookup_name function got removed from linux, 5.7 and up...
anbox/anbox-modules#67

@Crilum
Copy link
Contributor

Crilum commented Apr 20, 2022

@Botspot This would be an amazing app for Pi-Apps, if it were somehow able to be installed (which I guess it could, but you'd have to build an old kernel to get it to work...).
Being able to install an Android compatibility layer would be awesome..

@theofficialgman
Copy link
Collaborator

theofficialgman commented Apr 20, 2022

downgrading the kernel is a hard NO.

however.. if you had looked, there is already a PR ongoing with the "dirty hack" for kernel >=5.7 support anbox/anbox-modules#76

hopefully the actual anbox developers step up and fix this

@theofficialgman
Copy link
Collaborator

also, with the piOS desktop now supporting wayland officially. waydroid may be an option as well https://waydro.id/#wdlinux

I'm not sure if their debian repo actually properly supports armhf/arm64 or not yet

@Crilum
Copy link
Contributor

Crilum commented Apr 20, 2022

@theofficialgman Waydroid doesn't have the armhf version of python3-gbinder in their repos..
https://repo.waydro.id/erfan/bullseye/

@Botspot
Copy link
Owner

Botspot commented Apr 24, 2022

A couple of months ago I tried to get Waydroid working. I thought it may be possible to run it inside a nested Mutter window that was running in Wayland mode. It didn't work, and I think this was mutter's fault.

But I did get Waydroid to install, after a lot of attempts.
Here are my notes for the process:

From: https://wiki.mobian-project.org/doku.php?id=waydroid

mkdir Waydroid-build && cd $_
git clone https://github.com/sailfishos/libglibutil.git
git clone https://github.com/mer-hybris/libgbinder.git
git clone --single-branch --branch bullseye https://github.com/erfanoabdi/gbinder-python.git

sudo apt install devscripts dh-make

cd libglibutil/
sudo apt build-dep .
debuild -us -uc
cd ..
sudo dpkg -i libglibutil*.deb

cd libgbinder/
#patch makefiles to avoid "undefined reference to __atomic_load_8" error
sed -i 's/\-lpthread$/-lpthread -latomic/g' ./unit/common/Makefile
sed -i 's/\-lpthread$/-lpthread -latomic/g' ./Makefile
sudo apt build-dep . -y
debuild -us -uc
cd ..
sudo dpkg -i libgbinder*.deb

cd gbinder-python/
sudo apt build-dep .
dch --create --package "gbinder-python" --newversion "1.0.0~git20210909-1" foo bar
dh_make --createorig -p "gbinder-python_1.0.0~git20210909"
# Select "p" when prompted for the package type, leave the rest at the defaults
debuild -us -uc
cd ..
sudo dpkg -i python3-gbinder*.deb

git clone --single-branch --branch bullseye https://github.com/waydroid/waydroid.git
cd waydroid/
sudo apt build-dep .
debuild -us -uc
cd ..
sudo dpkg -i waydroid_*_all.deb

cd ..

#run
sudo waydroid init

#these variables need to be set by the window manager for waydroid to work. Setting them manually won't work if the WM is not wayland.
XDG_SESSION_TYPE=wayland WAYLAND_DISPLAY=wayland-0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants