Ich habe das Projekt PostmarketOS (Wikipedia-Eintrag) entdeckt, das versucht für gängige Handys (Liste der unterstützten Geräte) eine richtige Linux-Distribution zu bieten. Das System ist also kein Android, sondern ein Linux-Kernel nah am Mainline mit einem richtigen Paketsystem. Die Idee klingt sehr gut, denn Android hat nicht mehr viel mit den FOSS-Zielen gemein, aber ich habe es noch nicht ausprobiert und kann nicht sagen, wie brauchbar das System ist.

Kontakt

PostmarketOS verwendet sowohl Matrix, als auch IRC. Neben dem Hauptraum #main:postmarketos.org gibt es noch diverse Entwicklerräume.

Bugreports kann man bei Gitlab abgeben.

Installation auf Galaxy S3 (i9300)

PostmarketOS-Umgebung auf dem Laptop einrichten

  • Installation guide - postmarketOS

    % sudo apt install python3-pip % pip3 install --user pmbootstrap % alias pmbootstrap=$HOME/.local/bin/pmbootstrap

  • Mit Tab-Vervollständigung

    % pmbootstrap init Work path: /home/joerg/kein_Backup/pmbootstrap Vendor: samsung Device codename: i9305 This device has proprietary components, which trade some of your freedom with making more peripherals work. We would like to offer full functionality without hurting your freedom, but this is currently not possible for your device. device-samsung-i9305-nonfree-firmware: Wifi firmware Enable this package? (y/n): y Username: user User interface: weston Use this timezone (Europe/Berlin) instead of GMT? (y/n): y Device hostname: i9300

    % pmbootstrap config [pmbootstrap] aports = /home/joerg/kein_Backup/pmbootstrap/cache_git/pmaports ccache_size = 5G device = samsung-i9305 extra_packages = none hostname = i9300 jobs = 7 kernel = mainline keymap = nonfree_firmware = True nonfree_userland = False ssh_keys = False timezone = Europe/Berlin ui = weston user = user work = /home/joerg/kein_Backup/pmbootstrap

    % pmbootstrap config nonfree_userland true % pmbootstrap config ssh_keys true

  • Logs mit pmbootstrap log aus /home/joerg/kein_Backup/pmbootstrap/log.txt

    % pmbootstrap install … * SET LOGIN PASSWORD FOR: 'user' * … Run the following to flash your installation to the target device:

    • pmbootstrap flasher flash_rootfs Flashes the generated rootfs image to your device: /home/joerg/kein_Backup/pmbootstrap/chroot_native/home/pmos/rootfs/samsung-i9305.img (NOTE: This file has a partition table, which contains /boot and / subpartitions. That way we don't need to change the partition layout on your device.)
    • pmbootstrap flasher flash_kernel Flashes the kernel + initramfs to your device: /home/joerg/kein_Backup/pmbootstrap/chroot_rootfs_samsung-i9305/boot
    • If the above steps do not work, you can also create symlinks to the generated files with 'pmbootstrap export' and flash outside of pmbootstrap.

    % sudo du -sh ~/kein_Backup/pmbootstrap 1,2G kein_Backup/pmbootstrap

    % pmbootstrap flasher flash_rootfs … Session begun.

    Downloading device's PIT file... PIT file download successful.

    Uploading SYSTEM 5% ERROR: Failed to confirm end of file transfer sequence! ERROR: SYSTEM upload failed!

    Ending session... ERROR: Failed to send end session packet!

Installation from recovery mode - postmarketOS

% pmbootstrap export pmos-i9300
% adb push pmos-i9300/samsung-i9305.img /data/sys.img
% adb shell dd if=/data/sys.img of=/dev/block/mmcblk0p9 bs=4M
127+0 records in
127+0 records out
532676608 bytes (508.0MB) copied, 15.010529 seconds, 33.8MB/s

% sudo heimdall flash --BOOT pmos-i9300/boot.img-samsung-i9305

% ssh user@172.16.42.1
user@172.16.42.1's password:
Welcome to postmarketOS!

This distribution is based on Alpine Linux.
Read both our wikis to find a large amount of how-to guides and
general information about administrating and development.
See <https://wiki.postmarketos.org> and <https://wiki.alpinelinux.org>.

You may change this message by editing /etc/motd.

samsung-i9300:~$ cat /proc/version
Linux version 3.0.101-lineage (pmos@build) (gcc version 6.4.0 (postmarketOS 6.4.0) ) #7-Alpine SMP PREEMPT Tue Nov 5 16:15:41 UTC 2019
samsung-i9300:~$ cat /proc/cpuinfo
Processor       : ARMv7 Processor rev 0 (v7l)
processor       : 0
BogoMIPS        : 1592.52

Features        : swp half thumb fastmult vfp edsp neon vfpv3 tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x3
CPU part        : 0xc09
CPU revision    : 0

Chip revision   : 0011
Hardware        : SMDK4x12
Revision        : 000c
Serial          : 1cc45f0f4df115fb
samsung-i9300:~$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: sit0: <NOARP> mtu 1480 qdisc noop state DOWN 
    link/sit 0.0.0.0 brd 0.0.0.0
3: ip6tnl0: <NOARP> mtu 1452 qdisc noop state DOWN 
    link/tunnel6 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 brd 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
4: p2p0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether 8a:30:8a:5b:ad:fa brd ff:ff:ff:ff:ff:ff
5: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state DORMANT qlen 1000
    link/ether 88:30:8a:5b:ad:fa brd ff:ff:ff:ff:ff:ff
6: rndis0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 16:41:bd:64:27:71 brd ff:ff:ff:ff:ff:ff
    inet 172.16.42.1/16 brd 172.16.255.255 scope global rndis0
    inet6 fe80::1441:bdff:fe64:2771/64 scope link 
       valid_lft forever preferred_lft forever

WLAN reparieren

-iwlan0 bei wpa_supplicant_args in /etc/conf.d/wpa_supplicant ergänzen

Shell in der Initrd

% pmbootstrap initfs hook_add debug-shell
% pmbootstrap flasher flash_kernel
% telnet 172.16.42.1
…
Type 'pmos_continue_boot' to continue booting:
# /
…

% pmbootstrap initfs hook_del debug-shell
% pmbootstrap flasher flash_kernel

Syslog-Meldungen dauerhaft speichern

% sudo vi /etc/conf.d/syslog
SYSLOGD_OPTS="-O /var/log/messages -L -R 172.16.42.2:5144 -t"
% sudo service syslog restart

TWRP

https://eu.dl.twrp.me/i9300/

U-Boot für das S3

http://github.com/fourkbomb/u-boot

Samsung Stock ROM

Samsung Galaxy S3 GT-I9300 Stock Firmware - SamsungFirmware Download Stock Recovery for Samsung Galaxy Phones - SamsungFirmware

Android sparse image öffnen

% sudo apt install android-sdk-libsparse-utils
% tar xf I9300XXUGPB1_I9300OJVGPB1_I9300XXUGNA8_HOME.tar.md5 system.img
% simg2img system.img system.ext4
% sudo mount system.ext4 /mnt/other
% scp /mnt/other/vendor/firmware/mfc_fw.bin user@172.16.42.1:
% ssh user@172.16.42.1 sudo cp mfc_fw.bin /lib/firmware

Kernel bauen

% pmbootstrap kconfig edit samsung-i9305
% pmbootstrap build linux-samsung-i9305 --force
% pmbootstrap chroot -r -- apk fix linux-samsung-i9305
% pmbootstrap flasher flash_kernel

CONFIG_CMDLINE="console=tty1 ignore_loglevel console=ttySAC2,115200 consoleblank=0 androidboot.hardware=smdk4x12"

kein_Backup/pmbootstrap/cache_git/pmaports/device/testing/linux-samsung-i9305/APKBUILD

source=" $pkgname-$hash.tar.gz::https://github.com/LineageOS/androidkernel_samsung_smdk4412/archive/$hash.tar.gz $config compiler-gcc6.h "

tar xf kein_Backup/pmbootstrap/cache_distfiles/linux-samsung-i9305-fa8fa332fdec11744ffe0c742775cc22efe0d041.tar.gz emacs … git diff > ~/kein_Backup/pmbootstrap/cache_git/pmaports/device/testing/linux-samsung-i9305/fix-fbcon.patch emacs kein_Backup/pmbootstrap/cache_git/pmaports/device/testing/linux-samsung-i9305/APKBUILD pmbootstrap checksum linux-samsung-i9305

unter kein_Backup/pmbootstrap/cache_git/pmaports ist ein git, so dass man sie die Änderungen an der Kconfig ansehen kann.

Netzwerk

auf dem Host systemd anpassen udevadm info /sys/class/net/usb0 E: ID_NET_DRIVER=rndis_host

auf dem Handy resolv.conf anpassen, ip route add default via 172.16.42.2 dev rndis0

WAYLAND_DEBUG=1

adb logcat -L