Samsung Galaxy SII (samsung-i9100)

From postmarketOS
Jump to: navigation, search
Samsung Galaxy S II
First photo ever released of postmarketOS (from the original introduction post).
First photo ever released of postmarketOS (from the original introduction post).
Manufacturer Samsung
Name Galaxy S II
Codename i9100, d710
Released 2011
Original software Android 2.3.4
Hardware
Chipset Exynos 4210 Dual
CPU Dual-core 1.2 GHz Cortex-A9
GPU Mali-400MP4
Display 480x800 AMOLED
Storage 16/32 GB
Memory 1 GB
Running XFCE

Contributors

  • ollieparanoid
  • veggie

What works

  • Installation to sdcard (pmbootstrap install --sdcard=/dev/mmcblk...)
  • Installation to device memory (partial)
  • Touchscreen
  • Weston (only on SD card)
  • XWayland
  • Wifi
  • Display brightness control
  • Accerelometer sensor
  • rtc
  • Xfce

What does not work

  • The rest (bluetooth, making calls, ...)
  • Auto resizing partitions during installation to device memory (probably)

How to enter flash mode

  • Connect a USB cable
  • Make sure, the device is powered off
  • Hold power + Home + volume down
  • When prompted, release all buttons and press volume up

Installation

If you get a "no space left on device" error, see #928.

The normal installation does not work yet (#581, we might fix that in the future with our own flashing method which basically automatizes the netcat method). Right now you have the following options. If you use any of these, please expand the wiki with details.

  • use pmbootstrap install --sdcard (you will need a real sd card, but this is the easiest method)
  • use the netcat method (see below)
  • use the recovery zip installer (you need to install a recovery like TWRP on your device, then run pmbootstrap install --android-recovery-zip and pmbootstrap flasher --method=adb sideload.)

netcat method

Flashing to device memory should be possible using drebrez's netcat method (#456).

Init pmbootstrap. Make sure to choose none for the user interface instead of weston because weston makes the image just a little bit too large for the unresized partition.

$ ./pmbootstrap.py init

Start the build process

$ ./pmbootstrap.py install

Flash postmarketOS to the device:

https://github.com/postmarketOS/pmbootstrap/issues/456

For the d710, on step 5 use /dev/mmcblk0p11 as the install partition.

On step 8, use
pv /home/pmos/rootfs/samsung-i9100.img | nc 172.16.42.1 60000
instead.
Step by step guide for Flashing to device memory

Please do not hesitate to remove or edit if this does not belong here or match intended wiki content. This does not bring anything new just summary.

- Build image (on your computer)

-- Install pmboostrap

 $ git clone https://github.com/postmarketOS/pmbootstrap.git

-- Change working directory to the pmboostrap

 $ cd pmbootstrap/

-- Configure

 $ ./pmbootstrap.py init
 [18:27:09] Device [samsung-i9100]: samsung-i9100
 [18:27:45] User interface [weston]: weston
 [18:28:05] Work path [/home/<USER>/.local/var/pmbootstrap]:
 [18:28:29] Jobs [5]:
 [18:28:46] Timestamp based rebuilds (y/n) [y]:
 [18:29:05] Extra packages [none]:

-- Prepare the installation

 $ ./pmbootstrap.py install

- Flash to phone memory - This will replace (break) your current phone system! The description is using the alternative flash method because there it did not work for me with heimdall - https://github.com/Benjamin-Dobell/Heimdall/issues/418

-- Set phone to ODIN mode

 1. Turn off phone
 2. Connect USB cable
 3. Hold VOLUME_DOWN + HOME + POWER until you get Warning!! screen
 4. Push VOLUME_UP to continue to ODIN mode screen

-- Set image for NETCAT flash method

 $ ./pmbootstrap.py initfs hook_add usb-shell

-- Flash Kernel and Recovery (phone will reboot to screen "boot partition not found")

 $ ./pmbootstrap.py flasher flash_kernel

-- Check USB network connection to phone

 ping 172.16.42.1

(if it does not ping, try replugging usb cable few times)

-- Connect to phone with telnet

 $ telnet 172.16.42.1 24

-- Start netcat to listen for image (on the phone) /dev/mmcblk0p9 should be FACTORYFS partition you check by running fdisk -l /dev/mmcblk0

 / # nc -v -l -p 60000 > /dev/mmcblk0p9

-- Switch to pmboostrap chroot (on the computer in other terminal)

 $ ./pmbootstrap.py chroot --suffix native

-- Install pv (in the chroot)

 / # apk add pv

-- Send image from computer to netcat (on the computer)

 / # pv /home/pmos/rootfs/samsung-i9100.img | nc 172.16.42.1 60000

-- Close both nc with CTRL+C when transfer finishes and reboot the phone with power button

-- Telnet to phone to enter password

 $ telnet 172.16.42.1

-- Follow further instructions from telnet

Boot process

We're using the heimdall-isorec flash method, see deviceinfo_flash_methods for more information.

Links

Photos

Wifi

- Create conf for wpa_supplicant

 $ wpa_passphrase "SSID" "password" > wifi

Note : If you are connecting to a hidden wireless network, make sure to add line "scan_ssid=1" after the ssid line in your generated conf file

- Connect to wifi AP

 $ sudo wpa_supplicant -i wlan0 -c wifi &

- Get ip address from dhcp server (in another terminal)

 $ sudo udhcpc -i wlan0

To set wifi connection to start automatically on boot, please refer here wifi

ofono

Best way seems to get Samsung IPC modem support from the patchset https://lists.ofono.org/pipermail/ofono/2012-September/013766.html (but it was not accepted) and does not build https://github.com/tssk/pmbootstrap/commits/device-samsung-i9100_modem . I would appreciate help from someone that understands C.

Second idea was to build Andoird RIL + Samsung RIL and get ofono working with ofono-ril support - https://redmine.replicant.us/projects/replicant/wiki/Samsung-RIL .

GPS

https://univers-libre.net/posts/galaxy-s2-gps-on-replicant.html

https://redmine.replicant.us/projects/replicant/wiki/GSD4t

https://github.com/mnalis/gsd4t_parser

https://redmine.replicant.us/boards/21/topics/897

Setting the hardware clock

If you have already setup chrony and if your hardware clock doesn't have the time set you can set it with,

localhost:~# hwclock -w  # Write the current system time to the hardware clock

Setting the display brightness

To adjust display brightness write a value between 0-255 to file given below,

localhost:~# echo 0 > /sys/class/backlight/panel/brightness #set the display to its lowest brightness

localhost:~# echo 255 > /sys/class/backlight/panel/brightness #set the display to maximum brightness

Reading Accelerometer sensor

Accelerometer sensor data can read from following file

localhost:~$ cat /sys/class/accelerometer/accelerometer/acc_file

Hardware specifications for i9100

SoC

Samsung Exynos 4 Dual 45 nm (GT-I9100, SHW-M250S/K/L) source

CPU

1.2 GHz dual-core ARM Cortex-A9 (GT-I9100, GT-I9105, GT-I9100G, SHW-M250S/K/L) source

GPU

ARM Mali-400 MP4 (GT-I9100, SHW-M250S/K/L) source

WiFi / Bluetooth / FM radio

Broadcom BCM4330 (SWB-B42) Bluetooth 4.0 Dual Band WLAN FM source source

Driver? - https://wireless.wiki.kernel.org/en/users/drivers/brcm80211

Firmware? - https://packages.debian.org/sid/kernel/firmware-brcm80211

Memory

1 GB RAM source

Storage

16 GB or 32 GB flash memory source

Removable storage

microSD (up to 128 GB SDXC) source

TODO

gps, sensors, camera...