Manifest: https://github.com/anbox/platform_manifests/blob/anbox/default.xml
Android base: 7.1.1_r13
Based on: AOSP
Goals:
Extra repositories (overridden or added):
path | URL | Comments |
art | https://github.com/anbox/platform_art | |
bionic | https://github.com/anbox/platform_bionic | |
frameworks/av | https://github.com/anbox/platform_frameworks_av | |
frameworks/base | https://github.com/anbox/platform_frameworks_base | |
frameworks/native | https://github.com/anbox/platform_frameworks_native | |
frameworks/opt/net/wifi | https://github.com/anbox/platform_frameworks_opt_net_wifi | |
hardware/libhardware | https://github.com/anbox/platform_hardware_libhardware | |
hardware/libhardware_legacy | https://github.com/anbox/platform_hardware_libhardware_legacy | |
system/core | https://github.com/anbox/platform_system_core | |
system/netd | https://github.com/anbox/platform_system_netd | |
system/vold | https://github.com/anbox/platform_system_vold | |
vendor/anbox | https://github.com/anbox/anbox |
At the time of writing, the most recent images are RC images for Android 9, but there are branches for Android 10.
As they use (mostly?) upstream kernels, they sometimes have interesting code.
Source code: https://git.osdn.net/view?a=project_list;pf=android-x86
Manifest: git://git.osdn.net/gitroot/android-x86/manifest.git
Branches1:
Branch | Android version |
q-x86 | 10.0 |
pie-x86 | 9.0 |
oreo-x86 | 8.1 |
nougat-x86 | 7.1 |
marshmallow-x86 | 6.0 |
lollipop-x86 | 5.1 |
kitkat-x86 | 4.4 |
jb-x86 | 4.3 |
ics-x86 | 4.0 |
honeycomb-x86 | 3.2 |
gingerbread-x86 | 2.3 |
froyo-x86 | 2.2 |
eclair-x86 | 2.1 |
donut-x86 | 1.6 |
cupcake-x86 | 1.5 |
1 https://www.android-x86.org/source.html
AOSP doesn't support many devices, but it seem to support some devboards.
The advantage is that in general devboards are well supported by upstream kernels.
Supported devboards1?:Devboard | Freedom issues | Comments |
Beagleboard-X15 | No free GPU driver | Well supported by GNU/Linux, free bootloader |
Cuttlefish emulator | ? | ? |
Other | ? | ? |
The official documentation also mentions some devboards .
1 Some of the devboards in this page are probably supported: https://wiki.linaro.org/AOSP#AOSP_Dev_Board_Reference_Information
website: https://github.com/aospm
manifest: https://github.com/aospm/android_local_manifests/blob/main/aospm.xml
Repositories:
Path | URL | Comments |
device/generic/sdm845 | https://github.com/aospm/android_device_generic_sdm845 | Use prebuilt kernels |
external/tinyhal | https://github.com/aospm/tinyhal | Generic HAL1 |
external/vibrator-ff | https://github.com/aospm/external_vibrator-ff | Generic HAL1 |
1 https://aosp-developers-community.github.io/#generic-hal-efforts
CustomROMs seem to be a space for unofficial port of LineageOS. The idea is probably to develop the port until they manage to meet LineageOS's device-support-requirements.md . When the requirements are met, they are probably included in LineageOS directly.
Interesting ports:This distribution is based on LineageOS. While they seem to reuse nonfree software to make the hardware work, they spent some time cleaning up LineageOS code itself.
For instance it contains patches to remove privacy issues and nonfree software included in CyanogenMod or LineageOS.
As we need to do that too in Replicant as long as we use LineageOS as base, it would be interesting to collaborate more with DivestOS on that part.
Web site:
https: https://divestos.org/
Onion: http://6sdlxbqgcxdbkvysoir2qvqqs5ro3fxgyl3phvuphcdyklv7rg57jhid.onion
As October 2020, they are porting the Fairphone 2 to Android 9. However to do that, they are using 3.4 kernel and not any upstream kernels.
In addition, they don't seem very interested in free software bootloaders, and the Fairphone 1 and 2 use Qualcomm System On a Chip.
However they are probably interested in free software libraries to make the port to newer Android versions easier.
Based on: AOSP
Manifest: https://github.com/GloDroid/glodroid_manifest/blob/master/glodroid.xml
url: https://github.com/glodroid/glodroid_device.git
Content:
Path | description | Comments |
common/ | * low memory configuration * selinux policies * Other (TODO) |
|
hals/power/ | power management (DVFS, CPU boost, etc) | |
hals/usb-aidl/ | USB gadget HAL | It seems to use the same API than our scripts. It also look very generic (for instance it uses the Google/Android VID/PID). |
hals/usb-gadget/ | ||
platform/kernel/kernel.mk | Kernel build system | Can it be moved? |
platform/uboot/uboot.mk | u-boot build system | Can it be moved? |
pinephone/lights/ | LEDS HAL | Is there a generic LED HAL ? |
pinephone/reference-ril/ | AT ril based on the reference RIL | We could use it for now, until we manage to use QMI |
pinephone/rild/ | ||
pinephone/vibrator/ | Vibrator HAL | AOSP Mainline has a separate vibrator |
Path | URL | Comments |
prebuilts/gcc/linux-x86/arm/gcc-linaro-arm-linux-gnueabihf | https://github.com/glodroid/linaro_gcc_prebuilts.git | |
prebuilts/gcc/linux-x86/aarch64/gcc-linaro-aarch64-linux-gnu | https://github.com/glodroid/linaro_gcc_prebuilts.git | |
prebuilts/gcc/linux-x86/arm/gcc-linaro-arm-eabi" | https://github.com/glodroid/linaro_gcc_prebuilts.git | |
prebuilts/gcc/linux-x86/or1k/gcc-linux-or1k" | https://github.com/glodroid/linaro_gcc_prebuilts.git |
Path | URL | Comments |
external/crust-firmware/arm-trusted-firmware | https://github.com/crust-firmware/arm-trusted-firmware.git | |
external/crust-firmware/crust | https://github.com/crust-firmware/crust.git |
It also contains various repositories for nonfree firmwares and nonfree bootloader components (BL1, etc), and a repository with just APKs (this might be an issue for license compliance).
See device-support-requirements.md for more information on LineageOS expectations.
Replicant has a script that is able to parse the LineageOS wiki data . That can be useful to find information on devices supported by LineageOS.
The devices supported by LineageOS 16 have either:It may be because they rely on nonfree software to support devices, which has not been ported to Android 9, or may be because they need more time to add devices with other SOCs like exynos.
Waydroid consist in some host tool that can containerize an Android distribution, and some changes on top of LineageOS.
Some repositories would only be useful if we decide to integrate Waydroid in Replicant to have some FSDG compliant way to run Android applications on top of GNU/Linux:snd_pcm_open(&out->pcm, "pulse", SND_PCM_STREAM_PLAYBACK, 0);
[1], so if I understood right, it uses Pulseaudio's alsa compatbility layer.There is some interest in Guix about having something like that as a patch serie was sent for adding the Waydroid host part in Guix.
What would be more interesting for Replicant as-is that in android_hardware_waydroid2, there is libraries that work with upstream kernels like the vibrator library. We also have our own vibrator library but it would probably be a good idea to share the maintenance somehow.
1 https://github.com/waydroid/android_hardware_waydroid/blob/lineage-18.1/audio/audio_hw.c
2 https://github.com/waydroid/android_hardware_waydroid
It could be a good idea to share the maintenance of the code used to make Replicant 9 with other distributions.
Feature | AOSP | LineageOS |
Code quality | Better than LineageOS | |
Documentation | Better than LineageOS | |
root | Not sure if supported or not | Supported |
Minor release versioning | supported with Git tags | Not supported. For instance frameworks/native has no LineageOS tags (only cm-1x tags) and has no other branch for lineage OS 16.0 than the lineage-16.0 branch, as the other branches name are for other things. This was confirmed after running 'git fetch github' in frameworks/native to fetch the other branches that are not fetched by repo by default. Despite that, some code was even merged in after the lineage-16.0 release: commit 22abc3cf4077644463a2dc1c59a5a74e9518ea16 Merge: 9e96d54 8a6b6c3 Date: Sat Jul 13 18:57:45 2019 +0200 Merge remote-tracking branch 'aosp/pie-gsi' into lineage-16.0-pie-gsi |
GUI features for developers * Advanced reboot |
? | Supported |
Integrated kernel builds | Unsupported | Supported |
Formfactor | Vendor | Product | signatures | Source code | u-boot status | Verdict |
---|---|---|---|---|---|---|
Smartphone | Samsung | Galaxy S - i9000 | The bootloader is probably signed | downstream u-boot | * u-boot mainline was placed in BL2, copying much of the bootloader work done on the i9300 and n7100 * That u-boot also supports being installed in place of the Linux kernel, leaving the stock bootloader in place |
* Probably signed * The port to run instead of the Linux kernel seem interesting as it could be used on "midas" to disable the MMU and caches |
Galaxy S 2 - I9100 | Signed, see emulating-exynos-4210-bootrom-in-qemu.html | downstream u-boot: * Sekilsgs2/i9100-uboot * Talustus/i9100-uboot * onny/i9100-uboot * TALUAtGitHub/i9100-uboot * uboot-bootloader-true-multiboot-t1680898 upstream u-boot for devices with same SoC: origen smdkv310 s5pc210 trats |
* xda post about i9100-uboot * How do the downstream u-boot boot (After BL1? As kernel?) * Are there other u-boots? (look on common git hosting providers) |
? | ||
Galaxy SIII - I9300 | * The first stage is signed. * The stock first stage checks the second stage signatures. * A signed first stage that doesn't enforce subsequent signatures exists but it's nonfree and non-redistributable |
downstream u-boot for the second stage. This was submitted upstream but it broke the Odroid U3, so the code was probably not merged because of that. * TODO: Make sure it works on the Odroid U3 and resubmit upstream |
* That u-boot version is meant to be used in combination with a nonfree and non-redistributable first stage bootloader. * This combination doesn't load the nonfree TrustZone OS * Replicant 9 can run on devices with this bootloader, but the current Replicant 6 kernel expects a TrustZone OS to work. |
* We need to find a way to completely replace the first bootloader stage (BL1) as the one that is used to run u-boot is nonfree and non-redistributable. * More details on that issue can be found in the Exynos4_Bootrom wiki page. |
||
Galaxy SIII 4G - I9305 | ||||||
Galaxy Note 2 - N7100 | ||||||
Galaxy Note 2 4G - N7105 | ||||||
Tablet | Samsung | Galaxy Note 8.0 - N51XX | ? | Has the same System On a Chip (SOC) as the Galaxy SIII and Note 2, the Exynos4412, but slightly modified u-boot might need to be written. Testing needed. | ||
Galaxy Note 10.1 - N8000 | SD Card Boot Touch Point | |||||
Camera | Samsung | Galaxy Camera 2 - EK-GC200 | ? | First Exynos4412 Samsung device to get u-boot support in 2012 | ||
Smartphone | Google and Samsung | Galaxy Nexus - I9250 | downstream u-boot for the second stage | |||
Smartphone | LG | Optimus Black | unsigned | upstream u-boot | no display(no driver), very few peripherals but enough to be usable | |
Tablet | Amazon | Kindle Fire (first generation) | upstream u-boot | |||
Smartphone | GTA04 A3 | downstream u-boot and xloader | ||||
GTA04 A4 | ||||||
GTA04 A5 | ||||||
Smartphone | Nokia | N900 | The bootloader is signed | Upstream u-boot | * Xloader which is the first stage bootloader is signed and loads a nonfree second stage bootloader which is called NOLO. | * The upstream u-boot is to be installed in the kenrel partition and runs instead of Linux. A similar implementation could also be used on midas to disable caches and the MMU and have generic images |
Some GNU/Linux distributions like Plasma Mobile, LuneOS, Ubuntu Touch use libhybris through the Halium project to reuse proprietary Android libraries
See the Mer architecture for more details.
PostmaketOS is probably not using libhybris at all and is instead working with upstream and probably doesn't depend on nonfree libraries
Replicant is currently involved with upstream GNU/Linux, but it would probably be a good idea to collaborate more with distributions that don't depend on libhybris.
Guix currently uses android-make-stub to build Android software using Android.mk.
There are some comments in Guix source code that cross compilation isn't supported for the android-ndk build system.
Practically speaking it means that Guix won't be able to build any BUILD_SHARED_LIBRARY, BUILD_SHARED_LIBRARY or BUILD_STATIC_EXECUTABLE, however building the HOST_* counterpart works fine.
To workaround that they simply do replace them in the Android.mk during the build procedude:For instance we have:
(arguments `(#:phases (modify-phases %standard-phases (delete 'bootstrap) (add-before 'build 'patch-host (lambda _ ;; TODO: Cross-compile. (substitute* "Android.mk" (("BUILD_SHARED_LIBRARY") "BUILD_HOST_SHARED_LIBRARY") ;; (("BUILD_STATIC_LIBRARY") "BUILD_HOST_STATIC_LIBRARY") ;; (("BUILD_STATIC_EXECUTABLE") "BUILD_HOST_STATIC_EXECUTABLE") ) #t)) )))
Here the (delete 'bootstrap) is because the build is done in several phases, and here the bootstrap phase wasn't overriden by the android-ndk build system yet. As a result it tried to run autogen.sh. That might be because in libsamsung-ipc there is both an android build system and an autotools based one.
There is some work in progress by Julien Lepiller / roptat to package more Android components (including build systems like blueprint / soong) in this android-build.scm .
Formfactor | Vendor | Product | Linux dts | Linux status | Verdict |
---|---|---|---|---|---|
Smartphone | LG | Optimus Black | omap3-sniper.dts | no display(no driver), very few peripherals | Too much work required |
Tablet | Amazon | Kindle Fire (first generation) | omap4-kc1.dts | no display(no driver), very few peripherals | Too much work required |
Smartphone | GTA04 A3 | omap3-gta04a3.dts | http://projects.goldelico.com/p/gta04-kernel/page/UpstreamStatus/ | Good fit: Free software bootloader, very few parts not upstream | |
Smartphone | GTA04 A4 | omap3-gta04a4.dts | |||
Smartphone | GTA04 A5 | omap3-gta04a5.dts |
Formfactor | Vendor | Product | Linux dts | Linux status page | Issues | Verdict |
---|---|---|---|---|---|---|
Smartphone | Samsung | Galaxy S (i9000) | s5pv210-galaxys.dts | https://github.com/PabloPL/linux/wiki (needs verified, but looks right) | * Probably has a signed bootloader. See the bootloader status below for more information on it. * Has shared memory between the modem and the processor running Replicant * Is supported by Replicant 4.2 but not Replicant 6.0 * Barely meets Android 9 requirements |
|
Smartphone | Samsung | Galaxy S II (i9100) | exynos4210-i9100.dts | * See the Samsung_Galaxy_SII_(samsung-i9100) page on the PostmarketOS wiki for more details. * This work was based on a 4.20 downstream kernel * JustChrono is regenerating some history / splitting the 4.2 port into smaller parts since there is not much history in the other repo * yurnam also has some recent commits |
* Probably has a signed bootloader * Attempts were made to get Samsung IPC modem support via oFono from this patchset but it was not accepted and does not build * postmarketOS is seeking help to support the modem |
|
Smartphone | Samsung | Galaxy S III (i9300) | exynos4412-i9300.dts | https://blog.forkwhiletrue.me/pages/midas-mainline/ + patch required for Samsung bootloader (reference) | The first stage is signed. See the bootloader status below for more information on it. | Good fit: Only the modem, touch keys, and small parts are missing upstream but are available as patches on top of it |
Smartphone | Samsung | Galaxy Note 2 3G (N7100) | exynos4412-n710x.dts (needs to be modified to exynos4412-n7100.dts via this patch.) | Good fit: the LCD, the modem, touch keys, and small parts are missing but are available as patches on top of it | ||
Tablet | Samsung | Galaxy Note 8.0 (N51XX) | The platform is kona, not midas, but it might be fairly easy to port to mainline since it uses the same SoC, same fuelgauge, same audio, same radio chip, and maybe other parts apart from LCD and touchscreen as the i9300 and n7100 | * The bootloader is most probably signed. See the bootloader status below for more information on it. * Soldered battery => Shops might be able to replace it * Need to find a way to get access to the serial port => The special connector might have serial on it |
Formfactor | Vendor | Product | Linux dts | Linux status page | Issues | Verdict |
---|---|---|---|---|---|---|
Smartphone | Samsung | Galaxy Nexus (I9250) | None | * Status on PostmarketOS wiki * mainline fork DTS |
? | ? |
Tablet | Samsung | Galaxy Tab 2 7.0 (P31xx) | None | * Status on PostmarketOS wiki * mainline fork DTS |
* Soldered battery => Shops might be able to replace it * Need to find a way to get access to the serial port => The special connector might have serial on it |
? |
Tablet | Samsung | Galaxy Tab 2 10.1 (P51xx) | mainline fork DTS |
Formfactor | Vendor | Product | Linux dts | Linux status page | Issues | Verdict |
---|---|---|---|---|---|---|
Tablet | Difrnce | DIT4350 | sun5i-a13-difrnce-dit4350.dts | |||
Tablet | Empire Electronix | D709 tablet | sun5i-a13-empire-electronix-d709.dts | |||
Tablet | Empire Electronix | M712 tablet | sun5i-a13-empire-electronix-m712.dts | |||
Tablet | Gemei | G9 Tablet | sun4i-a10-gemei-g9.dts | TODO in the dts | Missing touchscreen | |
Smartphone | Samsung | Galaxy SIII 4G (i9305) | exynos4412-i9305.dts | https://blog.forkwhiletrue.me/pages/midas-mainline/ + patch required for Samsung bootloader | The bootloader is signed. See the bootloader status below for more information on it. | Good fit: * Not fully supported by Replicant because it lacks modem support but the work can be reused by the Galaxy SIII, Galaxy SII, Note 2, Note 8.0, and Note 10.1 (2012 edition). * touch keys, and small parts are missing upstream but are available as patches on top of it. |
Smartphone | Samsung | Galaxy Note 2 4G (N7105) | exynos4412-n710x.dts needs to be modified to exynos4412-n7105.dts via this patch since it has a different modem than the n7100. | Good fit: the LCD, touch keys, and small parts are missing but are available as patches on top of it. The modem might be in mainline, but probably lacks firmware loading. | ||
Tablet | Samsung | Galaxy Note 10.1 (2012 edition) | exynos4412-p4note-n8010.dts | Support matrix: https://viciouss.github.io/static_pages/galaxy_note_10_1_mainline/ Blog post: https://viciouss.github.io/2020/11/18/note-10_1-journey/ |
A developer, Viciouss, is working to add upstream to this device. | |
Smartphone | Nokia | N900 | omap3-n900.dts | https://elinux.org/N900 | * Has a signed bootloader * Has only 256M of RAM |
Bad fit: not enough RAM |
Smartphone | Nokia | N9 | omap3-n9.dts | https://elinux.org/N9 | * Probably have a signed bootloader * The touchscreen 'firmware' is just some calibration data that can be generated with free software |
Some upstream support (missing display?), though not a lot seem left. See also the PostmarketOS and elinux.org wiki pages |
Smartphone | Nokia | N950 | omap3-n950.dts | https://elinux.org/N950 | ||
Smartphone | Motorola | Droid 4 (XT894) | omap4-droid4-xt894.dts | http://elektranox.org/droid4/ | Probably has a signed bootloader, may have a signed kernel requiring kexec | Bad fit: requires a signed Linux kernel in the boot chain |
Smartphone | Nexus 7 (2012) | qcom-apq8064-asus-nexus7-flo.dts | Qualcomm SOC (signed bootloader, unknown modem isolation) | Bad fit: * Would need more guarantees requarding the modem isolation on recent qualcomm SOCs * Would need more research to on the state of free software for more recent qualcom SOCs * Not enough support in the Linux kernel for devices with Qualcomm SOCs |
||
qcom-apq8064-sony-xperia-yuga.dts | ||||||
qcom-msm8974-sony-xperia-amami.dts | ||||||
Tablet | Sony | Xperia Z2 Tablet | qcom-msm8974-sony-xperia-castor.dts | |||
qcom-msm8974-sony-xperia-honami.dts | ||||||
Smartphone | Nexus 5 | qcom-msm8974-lge-nexus5-hammerhead.dts | ||||
Smartphone | Samsung | Galaxy S5 | qcom-msm8974-samsung-klte.dts | |||
Fairphone 2 | qcom-msm8974-fairphone-fp2.dts | |||||
Tablet | MSI | Primo81 | sun6i-a31s-primo81.dts | |||
Tablet | Yones TopTech | BS1078 v2 Tablet | sun6i-a31s-yones-toptech-bs1078-v2.dts | |||
Tablet | Allwinner? | Q8 A13 Tablet | sun5i-a13-q8-tablet.dts | |||
Tablet | Utoo | P66 | sun5i-a13-utoo-p66.dts | |||
Tablet | Primux | INet-98V Rev 02 | sun5i-a13-inet-98v-rev2.dts | |||
Tablet | Primux | INet-86DZ Rev 01 | sun8i-a23-inet86dz.dts | |||
Tablet | Wondermedia? | WM8650-MID Tablet | wm8650-mid.dts | |||
Tablet | Wondermedia? | WM8850-W70v2 Tablet | wm8850-w70v2.dts | |||
Tablet | Colorfly | E708 Q1 tablet | sun6i-a31s-colorfly-e708-q1.dts | |||
Tablet | Polaroid | MID2407PXE03 tablet | sun8i-a23-polaroid-mid2407pxe03.dts | |||
Tablet | Polaroid | MID2809PXE04 tablet | sun8i-a23-polaroid-mid2809pxe04.dts | |||
Tablet | Allwinner? | Q8 A23 Tablet | sun8i-a23-q8-tablet.dts | |||
Tablet | Allwinner? | Q8 A33 Tablet | sun8i-a33-q8-tablet.dts | |||
Tablet | TBS Biometrics | A711 Tablet | sun8i-a83t-tbs-a711.dts | |||
Tablet | iNet Tek | iNet Q972 tablet | sun6i-a31s-inet-q972.dts | |||
Tablet | Allwinner? | GT90H Dual Core Tablet (v4) | sun8i-a23-gt90h-v4.dts | |||
Tablet | Allwinner? | GA10H Quad Core Tablet (v1.1) | sun8i-a33-ga10h-v1.1.dts | |||
Tablet | Allwinner? | INet-D978 Rev 02 | sun8i-a33-inet-d978-rev2.dts |
More upcoming Exynos related mainlining work could potentially be discovered at this Tizen wiki page
For instance the Lime 2 from Olimex is pretty well supported and is easy to find.
However this device is a single board computer and, as such it doesn't have the have the usual peripherals that are commonly found in tablets and smartphones. This makes a port on this device less relevant and less useful.
Some research is needed to identify which devices are easiest to work with. Tablets that don't have a modem seem to be better than smartphones, as supporting the modem would require to have it supported in Linux and the userspace libraries. This might even require to write and upstream a Linux driver for the modem.
A good tablet for this task should have:It would also be better if the chosen tablet doesn't use an AllWinner SOC with a PowerVR GPU, as MALI GPU have more probability to be usable with free software in the future.
Formfactor | Vendor | Product | Linux dts | Linux status page | Issues | Verdict |
---|---|---|---|---|---|---|
Tablet | Acer | Chromebook Tab 10 D651N-K9WT - codenamed Scarlet (earliest EOL is Aug 2023) | rk3399-gru-scarlet.dtsi | The Asus Chromebook Flip C101PA (codenamed Bob) has the same RK3399 SoC and was recently added to mainline u-boot. RK3399 in upstream u-boot doesn't include these tablets yet. These tablets, like the C101PA, ship with Coreboot bootloaders. Google used the Depthcharge payload in Coreboot to boot Android on the Pixel C, which has a different SoC, but also shipped with Coreboot. Upstream Coreboot repo Android specific code in Depthcharge payload u-boot README.rockchip u-boot README.rockusb rkdevelopmenttool First (and only?) XDA thread about porting AOSP/CyanogenMod to a Chromebook These devices have ARM Trusted Firmeware support | ||
Tablet | Asus | Chromebook Tablet CT100 - codenamed Dumo | rk3399-gru-scarlet.dtsi (needs to be verified, but both device's Board Names and Base Boards are codenamed Scarlet) | |||
Tablet | CTL | Chromebook Tab Tx1 - codenamed Druwl |
We have a new issue tracker for tracking upstream status of various patches.
Currently, Replicant uses device specific Hardware Abstraction Layers, because device manufacturers implemented non-standard kernel interfaces. However, Android works with upstream kernels and supports plug-n-play hardware nowadays, so it makes sense to have generic Hardware Abstraction Layers for the standard interfaces of the Linux kernel (ALSA, V4L2, etc).
Benefits:It is also a good idea to keep one image per device at first, as trying to make a single image that
would work on all ARM device supported by upstream Linux is complicated: Even GNU/Linux
distributions have a hard time doing that for ARM devices.
In some cases, even if the upstream status looks good, nonfree bootloaders can get in the way. We have a list of stock bootloaders incompatible with upstream Linux in this page: BootloadersIncompatibleWithLinux.
See LinuxSupportedDevices in the upstreaming sub project for the upstream status for various devices.
See the BootloaderStatus page on the upstream subproject.
Protocols | Implmentation | comments |
---|---|---|
QMI | Android <-> RIL <-> libqmi-ril to be completed <-> libqmi | |
* QMI * AT * Other |
Android <-> RIL <-> libraries to be written | |
android_frameworks_opt_telephony_ril_ofono + ofono + ofono backend (AT, QMI, etc) | * Using ofono would enable us to share more effort with upstream GNU/Linux and support many other protocol like AT for the GTA04 or qmi-ril for the Galaxy SIII 4G (I9305) or the Galaxy Note II 4G (N7105) * According to the README, it has already been tested with most of Replicant 6 code but on a smartphones not yet supported by Replicant. Calls, Audio, SMS, etc are known to work. * BuildRilWrapper.java seems to use introspection to automatically generate the API between the Framework Java RIL and itself (which replaces rild) (See the official documentation for background information on the Android architecture) * Replicant and oFono based Java RIL video presentation |
|
samsung-ipc | Ofono (rilmodem backend/driver) <-> rild <-> libsamsung-ril <-> libsamsung-ipc | * Might be usable for GNU/Linux distributions with libhybris * Could be usable for testing Replicant as ofono could run on the host computer and the rild socket could be exported with adb * Some forks exist: check if they still have interesting patches * https://github.com/rilmodem/ofono |
Android <-> rild <-> libsamsung-ril <-> libsamsung-ipc | * Currently in use in Replicant * Well integrated with Android * Potentially usable by other distributions * No known way to support different modems protocols in the same Replicant image with that |
|
Android <-> Ofono <-> libsamsung-ipc | * An ofono fork with libsamsung-ipc support is available Patches to add that upstream were refused because upstream didn't want to make the project become GPLv3 (libsamsung-ipc was GPLv3 at the time) but now libsamsung-ipc has been relicensed to GPLv2+ * Could be used to have generic a Replicant image supporting many devices with very different modems protocols (like libsamsung-ipc or QMI based ones) and have ofono do the modem detection |
|
FSO <-> libsamsung-ipc | * Probably not easily usable in Replicant * Is FSO still actively maintained? * Was used by SHR and potentially other GNU/Linux distributions supporting the Openmoko GTA04 smartphones |
Usage | Replicant | GNU/Linux | comments |
---|---|---|---|
Bluetooth stack | BlueDroid | Bluez | |
GPS hardware support | ? | gpsd |
Usage | Replicant | GNU/Linux | comments |
---|---|---|---|
Unix command line tools | ? | * Busybox * Coreutils |
* Busybox already has Android specific code in it but no Android.mk * Busybox build is very similar to Linux, and Linux can be built by Android |
Feature | Advantages | Disadvantages | sustainability |
---|---|---|---|
glibc + libhybris | * You just need an Android.mk to compile GNU/Linux software | * You need to link the Android part that need bionic functions to libhybris | TODO: Evaluate how close to bionic is libhybris |
bionic | Android default | * You spend lot of time trying to run GNU/Linux debug tools like evtest on Android: * Parabola cannot be used on old kenrels (FATAL: kernel too old) * GuiX and libreCMC might not have the package and might need tweaking to be recompiled with an old glibc and kernel headers * TODO: try crosstool-ng * Most of the other GNU/Linux distributions are not FSDG compliant or do not support ARM * The software might not work on Android due to missing bionic functions like versionsort(...) |
See GNULinuxDistributions for more details.
There is a community that include various project (distributions, HAL, etc) meant to reduce code duplication between projects working with AOSP.
Website: https://aosp-developers-community.github.io/
We definitely need to collaborate with them.
For distributions review, see AndroidDistributions for more details.
Some decisions have been taken by upstream projects, for instance the the Android Open Source Project (AOSP) is pushing device manufacturers to use signed bootloaders and not give the users the ability to replace those bootloaders. Therefor it is best to revisit such decisions and decide whether or not to implement a given feature.
Feature | Advantages | Disadvantages |
adb and root at boot | Easier to debug: * We get the logs at boot * May be able to diagnose non-booting devices (partition not mountable, etc) |
Way less secure: * Vulnerable to Juice_Jacking * Vulnerable to an attacker that just connect an usb cable to a running phone * Breaks the user's expectation of security (lock screen etc) |
We can get both: we can enable users to get logs at boot while avoiding any security issues.
To do that we can keep disable adb and root disabled at boot, and enable users to add it back by editing the boot.img or recovery images. We have a tutorial for that in the AddingADBRootToAnImage page and we are working on script to automate it even more.
Feature | Advantages | Disadvantages | sustainability |
---|---|---|---|
System as root | * The kernel size can be bigger * You have to hardcode the root partition in the cmdline or use PARTLABEL which might be a security issue: if a microSD has a partition named SYSTEM, the kernel may boot on it instead |
having an initramfs adds some flexibility: * Selecting partitions can potentially be more flexible |
|
System as root + dm-verity + dm-init | * The kernel size can be bigger * The partition selection is flexible and secure |
||
read-only /system | * more secure and more easily understandable by users and developers | * need to ship in replicant user-scripts or add them to vendor/ |
Background information: Gatekeeper is a daemon that is used to store passwords and other secrets.
Backend used | Advantages | Disadvantages |
simple userspace implementation | * Fast to do * Simple to understand * Good enough for most use cases |
|
kernel keyring (man 7 keyrings) | * Secure * The Linux kernel is well known and updated regularly * Some users are already used to the userspace/kernel security model * Probably fun to implement, can learn how to implement Android daemons and how to use the keyring along the way |
|
Free software Trusted Execution Environment (TEE) | * Android does it | * Require access to TrustZone, which doesn't work for all SOCs * Unfamiliar to users and developers (it's supposed to tick in suspend, knowledge about TrustZone is less spread than Linux, etc) * Probably requires to port a TrustZone OS to every SOC or phone * The Linux kernel is well known and updated regularly |
Proprietary software Trusted Execution Environment (TEE) | None: we really want to get rid of it if possible | Cannot be trusted: * Not free software * Not under the user control |
Background information: We can manage to avoid this use case for now.
Backend used | Advantages | Disadvantages | sustainability |
Android default + Upstream Linux | * does not work by default, probably impossible to make it work as-is | ||
Android default + Upstream Linux + very dirty userspace scripts | * Minimal changes | * Not robust * Might eat up resources * Already implemented cleanly in mdev |
|
Android default + hacked drivers to use fixed major/minor | * Minimal changes in Linux * No changes required on Android side |
* Require to change userspace software (libsamsung-ipc) | * Not upstreamable in Linux |
devtmpfs + hacked Android init | * Minimal changes if upstreamed * Init is hard to debug |
* Complex to do as debugging at this stage is complicated | * Need to be upstreamed in Android |
Stock Andrdroid init + mdev (busybox) | * Bad integration in the Android build system | * Changes are minimal | * Android build system integration need to be upstreamed or maintained |
Backend used | Advantages | Disadvantages | sustainability |
system/core/init/firmware_handler.cpp | * Stock Android implementation | None | Already upstream in Android |
Something else | None | The stock Android implementation is good enough and firmware loading is trivial anyway | Not upstream in Android |
The Android API for embedding a web engine is WebView.
Project | Comments |
AOSP WebView API implemented with Chromium | * Built from Chromium compiled for WebView * Latest additions to the API seem more and more tied to Chromium (e.g. getWebViewRenderProcess, getWebChromeClient) |
Old AOSP WebView API implemented with WebKit | * Not used anymore, since Android 4.4 * Does not implement the current WebView API |
GeckoView | * Not the same API as WebView * Could be used to implement WebView * Would need to be modified to expose more features from Gecko (e.g. zoom) while others are straightforward |
Qt WebEngine | * Not the same API (C++ instead of Java) * Probably the smallest subset of Chromium available |
Wine Internet Explorer implementation | * Uses Gecko under the hood * Might be interesting to look at how they did it |
To solve that we need to find a solution that depends on a good upstream as we are not going to write a web browser engine ourselves.
This lists upstream projects that are not forks tracking another upstream project.
Project | Comments |
Gecko | * Clear licensing * Friendly upstream: The tor-browser project works with Mozilla to upstream privacy features in Firefox. So we could probably work with them as well too. |
Chromium | * Unclear licensing * Google has goals for Chromium that are directly opposed to our goals (tracking, linked to google) * Probably unfriendly upstream because of the opposed goals |
Webkit | ? |
TODO: Add various chromium versions here.
TODO
Replicant has an issue with licensing (bug #1973) where we don't know under which license is Replicant. This due to the fact that the Android build system doesn't use a package manager during the build, and so it doesn't have license definition for each repositories.
A good way to fix that and also gain the ability to natively build GNU/Linux components like MESA or ofono would be to use a build system that use a package during at least during the build.
Some other communities have issues that do or could also benefit from that:Project | use case | Comments |
---|---|---|
Android | - Build images - Build the Android NDK and SDK - Build the Android tools |
- Wrapping build systems (like autotools, cmake, etc) is way too primitive: -- In LineageOS (not AOSP) The kernel is wrapped with .mk files, but the downside is that it runs make inside Linux source each time it needs to compile something -- In AOSP there is no infrastructure for building software with other build systems, still mesa is built in it, but not the kernel |
Arch Linux | - Build and package Android tools(Fastboot, adb, etc) | Its PKGBUILD relies on a project that uses CMake to debuild such tools |
Past Archlinux versions | - Build and package Android tools(Fastboot, adb, etc) | - relies on a fragile script - The package for Android tools is self contained and doesn't have its dependencies (like liblog, libcutils, etc) splited in other packages |
Debian | relies on custom Makefiles | |
Guix | - Build android tools - Build the android ndk |
Findings: - Guix uses android-make-stub to wrap Android.mk - We have real packaging of dependencies, however not all dependencies are exported, most are though - The Android build system is wrapper in a ndk-android-build-system function - The package definition needs very light and straigtforward patching. See Guix for more details. |
Robotnix | - Build AOSP images with Nix with package definitions | This project is being funded by NLnet. Once completed it has the potential to replace the Android build system. Since it uses package definitions it could fix many issues we have in Replicant but we will need to understand how much maintenance from our side it would need (probably not a lot) Findings: - It depends on NixOS: inherit (inputs) nixpkgs nixpkgsUnstable androidPkgs; (from pkgs/default.nix). => We need to also look at how much work it would be to cleanup the nixOS dependencies (if we just have a toolchain we might just need to replace linux-headers by linux-libre-headers and remove what is not used). Alternatively it might be possible to reuse NixOS packages definition and create guix packages from them through guix import. |
The GNU/Linux distribution of quectel-modems | Mix an Android kernel with GNU/Linux userspace | |
AsteroidOS | Mix an Android kernel with GNU/Linux userspace | |
openembedded-android | Build the Android NDK? | strongly outdated version of openembedded |
Keep the Android build system | + Reduced maintenance cost - Hard to integrate software with other build systems (linux, mesa) - Hard to audit the licenses |
Package everything in Guix | + Fixes the licensing situation + Fixes prebuilt situation /!\ Replicant is dead if we can't maintain all the packages /!\ Replicant is dead if we depend on non-bootstrapable software |
Wrap Android build system to enable other build systems like autotools |
- Cannot use native Android build commands (they are wrapped) + Can use more build systems ? Unknown if solves the licensing issue |
Make guix produce tarball packages with Android.bp to import the prebuild and extract it in Android build system |
+ Integrated well enough in Android + Fixes the licensing situation + Incremental steps that can be reverted more easily than packaging everything in Guix /!\ We need to make sure to only depend on things that are buildable with AOSP build system if we want to be able to revert to that build system |
Language | Stadards | Used in | Tools | Comments |
C | Kernel coding style | * Linux kernel * libsamsung-ipc |
* Has scripts/checkpatch.pl to check that can easily be imported | |
C | curl3 | * curl | * Has scripts/checksrc.pl in (lib)curl source code | |
C | GNU coding style | GNU projects (GRUB, etc) | ? | |
C | pep71 | * Python C code | ? | |
C | sysexits.h | * libsamsung-ipc tools | ? | used to standardize exit codes |
Guile | ? | * Guix | * Has guix style (and guix lint) |
1 https://peps.python.org/pep-0007/
fn2. Example: https://git.replicant.us/replicant/hardware_replicant_libsamsung-ipc/commit/?id=3f706fe2556b5efe29aa16a1232a3dc5d5646f55
fn3. https://curl.se/dev/code-style.html
All the wikis in this Redmine instance are available under the Creative Commons BY-SA license.