Skip to content

Tried this with 5.6.0.0.68? #3

Description

@erebion

Bought an Xperia 10 III because of your docs to try this out myself, unfortunately some files have changed location or simply no longer exist:

Here are some in-line comments where I've noticed differences

setup-environment.txt

    # create aliendalvik-root user with UID and GID 500000
    useradd -u 500000 -U aliendalvik-root -> now named appsupport-root
    groupmod -g 500000 aliendalvik-root -> now named appsupport-root

    # own data directory
    mkdir -p /opt/alien/data/
    chown -R aliendalvik-root:aliendalvik-root /opt/alien/data/ -> now named appsupport-root

    # set subuids (no clue how correct this actually is, but works)
    # might have to create those files
    touch /etc/subuid
    touch /etc/subgid
    usermod --add-subuids 100000-100000 --add-subgids 100000-100000 root
    usermod --add-subuids 100000-100000 --add-subgids 100000-100000 aliendalvik-root -> now named appsupport-root
    usermod --add-subuids 500000-599999 --add-subgids 500000-599999 root
    usermod --add-subuids 500000-599999 --add-subgids 500000-599999 aliendalvik-root -> now named appsupport-root
    usermod --add-subuids 600001-700000 --add-subgids 600001-700000 root
    usermod --add-subuids 600001-700000 --add-subgids 600001-700000 aliendalvik-root -> now named appsupport-root

    usermod --add-subuids YOUR_UID-YOUR_UID --add-subgids YOUR_UID-YOUR_UID root

configure.txt

- remove the android settings app from blocklisted apps so it shows up in your apps for testing
    remove "com.android.settings" entry from /etc/apkd/app-blacklist -> file no longer exists

- edit central aliendalvik configuration in /etc/appsupport.conf.d/00-defaults.conf 
-> now a file in /opt/appsupport/etc/appsupport.conf.d/
    comment out "RequiredDevNodes=ashmem"
    comment out "DevNodes=ion"

- edit central aliendalvik configuration in /etc/appsupport.conf.d/10-hybris.conf 
-> now a file in /opt/appsupport/etc/appsupport.conf.d/
    comment out the 3 "Proxies=" entries (we don't have any libhybris android HALs running underneath that we can proxy into the container)
    comment out all the entries in "[Features]" block


- edit central aliendalvik configuration in /etc/appsupport.conf.d/80-aas-config.conf
    set "DataRoot=/opt/alien/"
    set "StoragePath=/opt/alien/data/media/0" -> Why do you want to change that?
    set "WaylandSocketPath=/run/user/100000/wayland-0"
    set "BinderDev=binder" -> check
    set "HwBinderDev=hwbinder" -> not available on my kernel, can I disable that? What does this do?
    set "VndBinderDev=vndbinder" -> not available on my kernel, can I disable that? What does this do?
    set "PackageBlacklistFiles=/etc/apkd/app-blacklist" -> entry no longer exists, file no longer exists
    set "NotifBlacklistFiles=/etc/apkd/notif-blacklist" -> entry no longer exists, file no longer exists

- edit LXC configuration in /opt/alien/lxc-config/config -> file does not exist
    replace the paths with /tmp/aliendalvik/config/

- edit LXC configuration in /opt/alien/lxc-config/10-bsp_config -> file does not exist, found one in /tmp/appsupport/defaultuser/ ..?
    replace "/dev/puddlejumper" with "/dev/binder"
    replace "/dev/hwpuddlejumper" with "/dev/hwbinder"
    replace "/dev/vndpuddlejumper" with "/dev/vndbinder"
    comment out the /dev/ashmem, /dev/ion, /dev/uhid and /dev/kgsl-3d0 mounts
    replace "/home/.android/data" with "__DATA_DIR__"
    replace "/run/display" mount with "/run/user/__UID__/wayland-0 run/display/wayland-0 none bind,nodev,nosuid,create=file 0 0"
    replace "/vendor" with "/tmp/waydroid-vendor"
    comment out /odm/lib, /odm/lib64, /system/etc/apns-conf.xml, /dev/alien_video32, /dev/alien_video33 and /dev/video mounts
    comment out /home/defaultuser, /home/defaultuser/android_storage and /run/media/defaultuser mounts

- edit LXC configuration in /opt/alien/lxc-config/20-privilege_config -> file does not exist, found one in /tmp/appsupport/defaultuser/ ..?
    # add a line to start properly on apparmor devices
    lxc.apparmor.profile = unconfined
    
    # replace "lxc.idmap = u 100000 100000 1" line with
    lxc.idmap = u 100000 __UID__ 1

    # replace "lxc.idmap = g 100000 100000 1" line with
    lxc.idmap = g 100000 __UID__ 1

- edit LXC configuration in /opt/alien/lxc-config/30-net_config -> file does not exist, found one in /tmp/appsupport/defaultuser/ ..?
    comment out tmpfs mount to "sys/fs/selinux"
    
- edit android props in /opt/alien/lxc-config/generated_props  -> file does not exist
    comment out these props: ro.vendor.extension_library, ro.hardware.vulkan, ro.board.platform
    update these props "ro.alien.no_camera=1", "ro.alien.no_soundtrigger=1", "ro.com.android.mobiledata=false"
    when you're on a pinephone pro, set "ro.opengles.version=196609"
    add these props at the end:
      ro.alien.qti.c2.service=0
      ro.alien.qti.allocator.service=0
      debug.stagefright.ccodec=0
      ro.hardware.gralloc=gbm
      ro.hardware.egl=mesa
      sys.use_memfd=true
      ro.alien.logcatdump=1

    update DPI and display size values for your device
      ro.sf.lcd_density=DPI
      ro.alien.host.display_width=WIDTH
      ro.alien.host.display_height=HEIGHT
      ro.alien.host.dpi_x=DPI
      ro.alien.host.dpi_y=DPI

running.txt

- create overlayfs for system img (as root) -> What are those folders for? Folder names are not obvious, couldn't figure that out.
    mkdir /tmp/from
    mkdir /tmp/to
    mkdir /tmp/work
    mount /opt/alien/system.img /tmp/from
    # if for some reason mount didn't work, go with this (and skip the mount -t overlay)
      unsquashfs /opt/alien/system.img
      mv squashfs-root/ /opt/alien/rootfs

    mount -t overlay -o lowerdir=/tmp/from,upperdir=/tmp/to,workdir=/tmp/work overlay /opt/alien/rootfs

- edit init file in rootfs to comment out memfd override
    nano /opt/alien/rootfs/system/etc/init/hw/init.rc -> file does not exist
    # comment out this line
      setprop sys.use_memfd false

- chmod device files (as root)
    # TODO: if there's no binder devices, either create using binder_linux -> What are those used for?
      modprobe binder_linux devices=
    # or binderfs module (and link whatever devices are available)
      mkdir /dev/binderfs
      mount -t binder binder /dev/binderfs
      ln -s /dev/binderfs/anbox-binder /dev/binder
      ln -s /dev/binderfs/anbox-hwbinder /dev/hwbinder
      ln -s /dev/binderfs/anbox-vndbinder /dev/vndbinder
    chmod 777 /dev/binder
    chmod 777 /dev/hwbinder
    chmod 777 /dev/vndbinder
    chmod 777 /dev/dri/card0

- chmod wayland socket
    chown YOUR_USER:aliendalvik-wayland /run/user/YOUR_UID/wayland-0
    chmod 775 /run/user/YOUR_UID/wayland-0

- setup the waydroid vendor blob with another overlayfs (as root) -> Why Waydroid? Does the other one from SF OS have issues outside of SF OS?
    mkdir /tmp/from2
    mkdir /tmp/to2
    mkdir /tmp/work2
    mkdir /tmp/waydroid-vendor
    mount waydroid/vendor.img /tmp/from2
    mount -t overlay -o lowerdir=/tmp/from2,upperdir=/tmp/to2,workdir=/tmp/work2 overlay /tmp/waydroid-vendor
    # remove gatekeeper, that seems to be the only HAL that's loaded (and it also crashes)
    rm /tmp/waydroid-vendor/lib64/hw/android.hardware.gatekeeper@1.0-impl.so
    rm /tmp/waydroid-vendor/lib/hw/android.hardware.gatekeeper@1.0-impl.so

- replace webview with waydroid one -> Why?
    mkdir /tmp/waydroid-system
    mount waydroid/system.img /tmp/waydroid-system
    cp /tmp/waydroid-system/system/product/app/webview/webview.apk /opt/alien/rootfs/system/app/webview/webview.apk

- optional: copy overlay for gesture navigation from waydroid into alien (as root)
    cp -r /tmp/waydroid-system/system/product/overlay /opt/alien/rootfs/product/

- copy lxc-config into /tmp/aliendalvik/config -> Why in /tmp? Why not have the config somewhere permanent?
    mkdir -p /tmp/aliendalvik/config/
    cp /opt/alien/lxc-config/* /tmp/aliendalvik/config/

- set data dir in LXC config -> file does not exist
    nano /tmp/aliendalvik/config/10-bsp_config
    # set __DATA_DIR__ to /opt/alien/data

- set UID in LXC config -> file does not exist
    nano /tmp/aliendalvik/config/10-bsp_config
    # set __UID__ to your UID in this line
    lxc.mount.entry = /run/user/__UID__/wayland-0 run/display/wayland-0 none bind,nodev,nosuid,create=file 0 0

    nano /tmp/aliendalvik/config/20-privilege_config -> fiel does not exist
    # set __UID__ to your UID (this maps your UID to UID 100000 inside the container)
    lxc.idmap = u 100000 __UID__ 1
    lxc.idmap = g 100000 __UID__ 1

How far I've got

appsupport-prepare@user.service

Jun 17 22:48:56 localhost systemctl[2291]: Failed to connect to user scope bus via local transport: No such file or directory
Jun 17 22:48:56 localhost appsupport-init[2211]: No such systemd service appsupportaudio.service
Jun 17 22:48:56 localhost systemctl[2325]: Failed to connect to user scope bus via local transport: No such file or directory
Jun 17 22:48:56 localhost appsupport-init[2211]: No such systemd service appsupportkeyboard.service
Jun 17 22:48:56 localhost systemctl[2353]: Failed to connect to user scope bus via local transport: No such file or directory
Jun 17 22:48:56 localhost appsupport-init[2211]: No such systemd service apkd-bridge.service
Jun 17 22:48:56 localhost systemctl[2372]: Failed to connect to user scope bus via local transport: No such file or directory
Jun 17 22:48:56 localhost appsupport-init[2211]: No such systemd service apkd-bridge-hw.service
Jun 17 22:48:56 localhost appsupport-init[2121]: Failed to run hook /opt/appsupport/init/stop-post-hook.d/50-stop-supplementary-services.sh : 1
Jun 17 22:48:56 localhost systemd[1]: appsupport-prepare@user.service: Control process exited, code=exited, status=32/n/a
Jun 17 22:48:56 localhost systemd[1]: appsupport-prepare@user.service: Failed with result 'exit-code'.
Jun 17 22:48:56 localhost systemd[1]: Failed to start appsupport-prepare@user.service - AppSupport prepare.

SF OS repos do not seem to contain any packages providing appsupportaudio.service, appsupportkeyboard.service, apkd-bridge.service, apkd-bridge-hw.service

appsupport@user.service

Jun 17 22:03:20 localhost systemd[1]: Starting appsupport@user.service - AppSupport...
Jun 17 22:03:20 localhost appsupport-init[100630]: Waiting for hwservicemanager...
Jun 17 22:03:20 localhost appsupport-init[100665]: cat: /home/.appsupport/instance/user/data/alien_boot_completed: No such file or directory
Jun 17 22:03:20 localhost systemd[1]: appsupport@user.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Jun 17 22:03:20 localhost systemd[1]: appsupport@user.service: Failed with result 'exit-code'.
Jun 17 22:03:20 localhost systemd[1]: Stopped appsupport@user.service - AppSupport.

Couldn't find out what's wrong here. Used a lot of set -x, but still no idea what's going on.

wtf

Is there something I'm missing? I feel like I might be missing something simple perhaps?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions