Samsung Galaxy S Advance (samsung-i9070)

From postmarketOS
Jump to: navigation, search
Samsung Galaxy S Advance
Samsung Galaxy S Advance running Weston demos
Samsung Galaxy S Advance running Weston demos
Manufacturer Samsung
Name Galaxy S Advance
Codename i9070
Released 2012
Original software Android 2.3.6 on Linux 2.6.35
Hardware
Chipset NovaThor U8500
CPU Dual-core 1.0 GHz Cortex-A9
GPU Mali-400
Display 480x800 AMOLED
Storage 8/16 GB
Memory 768 MB

Contributors

  • 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

Links

Photos

Videos