LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Waydroid SlackBuild? (https://www.linuxquestions.org/questions/slackware-14/waydroid-slackbuild-4175736319/)

Geremia 04-22-2024 12:55 PM

Waydroid SlackBuild?
 
Is there a SlackBuild to package Waydroid Android emulator for Slackware?
If not, are there build instructions to build Waydroid on Slackware?

rizitis 04-22-2024 01:49 PM

I had in the past build it and it was running with this command: /usr/bin/waydroid -w container start
I search and found my old slackbuilds for this packages, i build and install ok but it not running because it need a dependency python3-gbinder

But i tried to build from ponce repo as i m in current and I have errors. Give me some time ...

edit: take the Slackbuild maybe you have better luck before me
Code:

cd $(dirname $0) ; CWD=$(pwd)

PRGNAM=waydroid                       
VERSION=${VERSION:-1.4.2}
BUILD=${BUILD:-1}
TAG=${TAG:-_rtz}               
PKGTYPE=${PKGTYPE:-txz}
LINK=https://github.com/waydroid/waydroid/archive/refs/tags/
GVERS=$VERSION.tar.gz       

wget -c "$LINK""$GVERS"

# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) ARCH=i586 ;;
    arm*) ARCH=arm ;;
    # Unless $ARCH is already set, use uname -m for all other archs:
      *) ARCH=$( uname -m ) ;;
  esac
fi


if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  exit 0
fi

TMP=${TMP:-/tmp/rtz}       
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}       
JOBS=-j$(getconf _NPROCESSORS_ONLN)

if [ "$ARCH" = "i586" ]; then
  SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
  SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-O2 -fPIC"
  LIBDIRSUFFIX="64"
else
  SLKCFLAGS="-O2"
  LIBDIRSUFFIX=""
fi

set -e

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
chown -R root:root .
find -L . \
 \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  -o -perm 511 \) -exec chmod 755 {} \; -o \
 \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;


CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
make "$JOBS"
make install DESTDIR=$PKG

# Don't ship .la files:
rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la


find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true


mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a CODE_OF_CONDUCT.md LICENSE* README* \
  $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild


mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc


cd $PKG
/sbin/makepkg -l n -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE


marav 04-22-2024 02:11 PM

Doesn't it need the kernel's binder module?
That's not enabled in Slackware, so you will have to compile your own

Geremia 04-22-2024 02:44 PM

Quote:

Originally Posted by marav (Post 6497751)
Doesn't it need the kernel's binder module?
That's not enabled in Slackware, so you will have to compile your own

SlackBulids for that already exist.

Update: Actually, those aren't the binder_linux module. Is there a binder_linux SlackBuild somewhere?
Update 2: Here it is: https://github.com/choff/anbox-modul.../master/binder
But I get an error:
Code:

Your kernel does not support KProbes, but this is required to compile binder as a kernel module
If I bypass that error and "insmod binder_linux.ko binder_linux.ko", I get this when running "./waydroid init":
Code:

No such file or directory: '/dev/binderfs/binder-control'

rizitis 04-22-2024 06:36 PM

I builded 3 times kernel 6.7.8
Code:

CONFIG_ANDROID=y
CONFIG_ANDROID_BINDER_IPC=m
CONFIG_ANDROID_BINDERFS=n
CONFIG_ANDROID_BINDER_DEVICES="binder,hwbinder,vndbinder"

BUT
Code:

[02:25:19] Failed to load binder driver
[02:25:19] modprobe: FATAL: Module binder_linux not found in directory /lib/modules/6.8.7
[02:25:19] ERROR: Binder node "binder" for waydroid not found
[02:25:19] See also: <https://github.com/waydroid>

enough for today...

Geremia 04-22-2024 07:20 PM

Quote:

Originally Posted by rizitis (Post 6497782)
Code:

[02:25:19] Failed to load binder driver
[02:25:19] modprobe: FATAL: Module binder_linux not found in directory /lib/modules/6.8.7
[02:25:19] ERROR: Binder node "binder" for waydroid not found
[02:25:19] See also: <https://github.com/waydroid>


You need the binder kernel module.

rizitis 04-22-2024 07:41 PM

2 Attachment(s)
I builded a zen kernel and it works

Geremia 04-22-2024 09:54 PM

Quote:

Originally Posted by rizitis (Post 6497784)
I builded a zen kernel and it works

You rebuild the entire kernel?
Can't you just build the binder kernel module?

rizitis 04-23-2024 11:41 AM

Quote:

Originally Posted by Geremia (Post 6497798)
You rebuild the entire kernel?
Can't you just build the binder kernel module?

there are multiple options for this, since "Building a kernel" failed 3 times, I decided to build the zen kernel and not only use zen headers... sometimes we want a stable good result even if more time needed than a forth failure at 4:00 AM :D

Geremia 04-23-2024 12:35 PM

Quote:

Originally Posted by rizitis (Post 6497918)
I decided to build the zen kernel and not only use zen headers

I'm not familiar with zen kernel. Why'd you chose that one?

rizitis 04-23-2024 02:11 PM

Quote:

Originally Posted by Geremia (Post 6497926)
I'm not familiar with zen kernel. Why'd you chose that one?

It was a spur of the moment decision. First because I knew waydroid will finally run for sure, and then I test it on the specific laptop (cpu)...
Builded using my oldconfig just edit and add
Code:

CONFIG_ANDROID=y
CONFIG_ANDROID_BINDER_IPC=y
CONFIG_ANDROID_BINDERFS=n
CONFIG_ANDROID_BINDER_DEVICES="binder,hwbinder,vndbinder"

No initrd used, with grub everything ok...

Geremia 04-25-2024 01:41 PM

Quote:

Originally Posted by rizitis (Post 6497940)
It was a spur of the moment decision. First because I knew waydroid will finally run for sure, and then I test it on the specific laptop (cpu)...
Builded using my oldconfig just edit and add
Code:

CONFIG_ANDROID=y
CONFIG_ANDROID_BINDER_IPC=y
CONFIG_ANDROID_BINDERFS=n
CONFIG_ANDROID_BINDER_DEVICES="binder,hwbinder,vndbinder"

No initrd used, with grub everything ok...

I have two differences. I enabled binderfs and I used an initrd. And I can't get it working.

Running
Code:

./waydroid.py show-full-ui
as non-root user in Weston, I get:
Code:

WayDroid container is not listening.
Code:

./waydroid.py container start
still hangs.
What do you think I should change?


Update: I noticed that I didn't have a "CONFIG_ANDROID=y" line in my .config. I'm rebuilding now and will let you know if that helps. It probably will.

rizitis 04-25-2024 03:22 PM

@Geremia https://github.com/rizitis/waydroid-...ADME.Slackware

But its not working properly imo...
And its not slackware problem... there are Waydroid bugs which effects lot of distros.
In other words I m not happy with it... there are better solutions out there... ;)

Geremia 04-26-2024 03:52 PM

Quote:

Originally Posted by rizitis (Post 6498268)

Thank you!
I built the kernel with
Code:

CONFIG_ANDROID_BINDERFS=y
And am running under Weston.
I get this issue when trying to install an APK:
Code:

Failed to get service waydroidplatform, trying again...
Thanks to the tg://resolve?domain=WayDroid channel, I got the help I needed. I needed to run
Code:

waydroid upgrade -o
to get rid of the ashmem references that were lying around from before. It works now, in Weston!

rizitis 04-26-2024 05:13 PM

nice, I have a simple app in google-play store just for fun, but you can download apk from here https://github.com/rizitis/SofoRevma/releases/tag/10.0

of course it will be Greeks for u :D but if you want tell me if its running ok for you in waydroid..


All times are GMT -5. The time now is 09:13 AM.