Difference between revisions of "Samsung Galaxy S Advance (samsung-i9070)"

From postmarketOS
Jump to navigation Jump to search
Line 1: Line 1:
[[Category:Supported Devices]]
=== Contributors ===
=== Contributors ===

Revision as of 14:56, 26 August 2017


  • drebrez

What works

  • Compiling the kernel
  • Flashing with heimdall (see below)
  • Booting initramfs
  • Network through USB
  • SSH
  • Weston with touchscreen
  • Wifi (Details below and in #138)

What does not work

  • Unknown, but probably everything else

Boot process

Unlike most other Android devices, the i9070 can not boot a boot.img (which consists of kernel + initramfs). Instead, the boot.img file is just a regular kernel.

However, it is possible to directly integrate a initramfs into the kernel at kernel compile time (this is totally different from the boot.img approach, if this is unclear to you, please ask in the channel), and this is what the Android ROMs do on the i9070. While it is not a big deal in the Android compilation process, it is a problem for postmarketOS, because we want to be able to build the initramfs independently from the kernel.

The following workaround is currently implemented:

  • We flash the real initramfs to the kernel2 partition (this partition usually contains a backup of the stock kernel)
  • The initramfs init script built into the kernel checks if the kernel2 partition contains a compressed initramfs, and if it does, it extracts it and passes execution to the real initramfs init script.
  • This idea is based on something called "isorec".

Device partitions

The following partitions are used for the postmarketOS:

  • Kernel => /dev/mmcblk0p15 (16MB)
  • Kernel2 => /dev/mmcblk0p17 (16MB)

Possible partitions for the postmarketOS system image:

  • SYSTEM => /dev/mmcblk0p3 (600MB)
  • DATAFS => /dev/mmcblk0p5 (2GB)

Flashing with heimdall

In order to flash the kernel and the initramfs using heimdall you simply have to call pmbootstrap flasher flash_kernel

This will write in the partitions specified in the deviceinfo file.

At the moment is not possible to write the system image file (samsung-i9070.img) using heimdall. A temporary solution is to use the TWRP shell to perform a command like this:
dd if=samsung-i9070.img of=/dev/mmcblk0p5

How drebrez made wifi work

  • build the kernel module (dhd.ko for the i9070)
  • get the vendor files for the Samsung U8500 devices
  • load the module using insmod with the firmware_path and nvram_path parameters

insmod dhd.ko firmware_path=/etc/wifi/bcmdhd_sta.bin nvram_path=/etc/wifi/nvram_net.txt

  • set a mac address

ifconfig wlan0 hw ether 01:02:03:04:05:06

  • bring the interface up

ifconfig wlan0 up

  • scan to find out what WiFi networks are detected

iw dev wlan0 scan

  • connect to WPA/WPA2 WiFi network

wpa_passphrase wifi_ssid wifi_key >> /etc/wpa_supplicant.conf

  • start wpa_supplicant to connect to the network

wpa_supplicant -B -D wext -i wlan0 -c /etc/wpa_supplicant.conf

  • verify that you are indeed connected to the SSID

iw wlan0 link

  • start udhcpc to get an ip address

udhcpc -b -i wlan0



  • Initramfs asking for the password via telnet


  • postmarketOS demo menu (XWayland)


  • Weston-terminal running in fullscreen mode