recycle your android devices

39
Recycle Your Android Devices Run real Linux on them

Upload: others

Post on 11-May-2022

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Recycle Your Android Devices

Recycle Your Android Devices

Run real Linux on them

Page 2: Recycle Your Android Devices

Who am I?

David Greaves

lbt on #mer #sailfishos ...

Co-founder of the Mer Project

work at Jolla

systems and infrastructure (OBS, QA, gitlab, bz ... VMs)

HA Documentation

Mer tools

Page 3: Recycle Your Android Devices

This is not a Jolla pitch

Page 4: Recycle Your Android Devices

This is not a Jolla pitch...but

Page 5: Recycle Your Android Devices

This is not a Jolla pitch...but

Page 6: Recycle Your Android Devices

This is not a Jolla pitch...but

Good case study

Galaxy S3 & Nexus 4 / 5 & more

Sailfish for Android

Page 7: Recycle Your Android Devices

This is not a Jolla pitch...but

HADK ToC:

• Prerequisites

• Preparing Your Device

• Setting up the SDKs

• Building the Android HAL

• Setting up Scratchbox2 Target

• Packaging Droid HAL

• Creating the Sailfish OS root fs

• Getting In

• Flashing the rootfs image

• Manual Installation

• List of Repositories

• Tweaks and Patches

• Building a new Device

• List of Supported Devices

Page 8: Recycle Your Android Devices

Talk about Technology

Page 9: Recycle Your Android Devices

Talk about Technology

JEOS

Just Enough OS

Page 10: Recycle Your Android Devices

Talk about Technology

wayland

systemd

btrfs

connman

ofono/pulseaudio

git

dbus

rpm

blueZ

Gecko

libzypp

gstreamer

eglibc

glib

kcalcore

GeoClue

kernel

Page 11: Recycle Your Android Devices

Talk about Technology

wayland

systemd

btrfs

connman

ofono/pulseaudio

git

dbus

rpm

blueZ

Gecko

libzypp

gstreamer

eglibc

glib

kcalcore

GeoClue

kernel

Page 12: Recycle Your Android Devices

Talk about Technology

Why?

• QML

• Performant

• Open

• Not Java

• Huge developer base

5.2

Qt 5.2-ish

Page 13: Recycle Your Android Devices

Talk about Technology

QtWayland replaces SurfaceFlinger

More to come using hwcomposer.

Qt 5.2-ish

Page 14: Recycle Your Android Devices

Talk about Technology

QtWayland replaces SurfaceFlinger

More to come using hwcomposer.

Qt 5.2-ish

Page 15: Recycle Your Android Devices

Talk about Technology code

Page 16: Recycle Your Android Devices

Routing around the breakage of closed binary blobs

Page 17: Recycle Your Android Devices

Talk about Technology

Shim between GNU libc and bionic libc

Enables use of glibc stack on top of Android BSPlibhybris

Page 18: Recycle Your Android Devices

Talk about Technology

Android linker code

dlopen

dlsym

dlclose

become

android_dlopen

android_dlsym

android_dlcloselibhybris

Page 19: Recycle Your Android Devices

Talk about Technology

Patches to bionic - relatively few:

• Thread local storage

• pthreads

• errno

• hard vs softfp float-abi

• /dev/log

libhybris

Page 20: Recycle Your Android Devices

Talk about Technology

 

android_dlopen(“libEGL.so”);

myeglCreateWindowSurfaceFP = android_dlsym(“eglCreateWindowSurface”);

*myeglCreateWindowSurface(....)

Gets you

• libEGL.so

or

• libGLESv2.so 

as wrappers which present to glibc space

libhybris

Page 21: Recycle Your Android Devices

Talk about Technology

Rinse and repeat for:

• Gralloc

• OpenGL ES 1.1/2.0

• NFC

• Hardware HAL

• OpenCL

• SurfaceFlinger

• OpenMAX

• Camera

• Hwcomposer

• and so on ...

libhybris

Page 22: Recycle Your Android Devices

Building it

HA DK

• Mer SDK

• Scratchbox2•Device target

• Minimal Ubuntu (for Android build)

Page 23: Recycle Your Android Devices

Building it

HA DK• Explaining the layout

• Bridge Android / Linux

Host OS (linux – but all kinds of variants)

Mer SDK

HABUILD SDK (ARM)

Android HA :Kernel; bionic;

SB2 Device Target (ARM)

Mer HA :(libhybris)

Qt / Wayland drivers, Pulseaudio, ...

Page 24: Recycle Your Android Devices

Building it

Mer SDK

• Minimal install

• Some tools

• SB2 ready

Page 25: Recycle Your Android Devices

Building it

HABUILD SDK

• Grab a tarball

• Install 'repo'

Page 26: Recycle Your Android Devices

Building it

HABUILD DK

• Device specific XML manifest

• Sync the git repos

• Mix of CM & Mer

• Run 'make'

• Fix problems :)

Page 27: Recycle Your Android Devices

Building it

Mer DK

• Package up the HABUILD built:

•binaries

•headers

•kernel

•boot & recovery .img

• Create a local rpm repository (headers)

• Make an SB2 'Target'

Page 28: Recycle Your Android Devices

Building it

Mer SDK

• Build hybris

• Build drivers: • Qt hwcomposer

• Audio

• Haptic

• Sensors

Page 29: Recycle Your Android Devices

Building it

Mer SDK

• Build SailfishOS rootfs

• Build <insert your system here> rootfs

Page 30: Recycle Your Android Devices

Running it

Flashing

• Use adb or equiv

Page 31: Recycle Your Android Devices

Running it

Booting

What happens?

• Bootloader

• Kernel

• Initrd and /init

• Systemd

• Android 'init'

Page 32: Recycle Your Android Devices

Running it

Running

• ssh

• nodejs

• ruby/python

• webserver

• ...

Page 33: Recycle Your Android Devices

SailfishOS Porters

• Currently around 25 active developers

• Working on 22 devices•Galaxy Nexus/Note/Tab2/S3/S4

•Nexus One/4/5/7's

•OnePlus, Photon Q, HTC Desire HD

•Ascend P6, G525-u00, Xperia Z1

•HP Touchpad

•N900, N9(50)

• N4, N5, Galaxy Nexus, are most mature and images are available

Page 34: Recycle Your Android Devices

Where are we?

Status:http://bit.ly/port-devices-status

Page 35: Recycle Your Android Devices

Working Together

• MultiromWorked with tassadar to add multirom support for sailfishOs images

• Upstreaming bugfixes code back to CM

During N5 port we contributed bugfix back to the upstream CM

http://review.cyanogenmod.org/#/c/67489/

Page 36: Recycle Your Android Devices

Talk to us

• Xdadev sailfish section and also individual device forums have SailfishOs threads

• IRC channel #sailfishos-porters

• All source at https://github.com/mer-hybris• SailfishOs meetups , London, Berlin, Finland

• Regular IRC meeting where developers drive the agenda

Page 37: Recycle Your Android Devices

Open Source

Open Working

Mer @ merproject.org

• Core & some MW

• Systems

• Community

Code is not enough

Page 38: Recycle Your Android Devices

Unlike

freenode: #mer #sailfishos

github/mer-hybris

merproject.org

Not that hard

90 people made this:

Page 39: Recycle Your Android Devices

Jolla's FOSDEMDiscountCode

Code: “FOSDEM2015”

€50 discount (€199)

31 Jan – 8 Feb

(One per person)

EU / Switzerland / Norway

Tablet : See us on Indiegogo