Samsung Galaxy SII (samsung-i9100)/Installation

Installation
We're using the  flash method, see deviceinfo_flash_methods for more information.

Enable ODIN (download) mode

 * Turn off phone
 * Connect USB cable
 * Hold  +   +   until you get the "Warning!!" screen
 * Push  to continue to ODIN mode, as per the instructions appearing on the screen

Option #1: Install to the internal memory (easiest)
$ pmbootstrap init
 * Configure the image:

Use the channel "edge", vendor "samsung", device codename "i9100". It is recommended to use the mainline kernel, with the Phosh UI, and the WiFi firmwares for the best experience, but you can customize it to your needs.

$ pmbootstrap install
 * Build the image:

$ pmbootstrap flasher flash_kernel $ pmbootstrap flasher flash_rootfs
 * Flash the OS to the internal memory:

The phone will reboot between the two commands, make sure to re-enter the ODIN (download) mode to execute the last command. This one can take a very long time to start. Once the transfer is complete, the phone will reboot again and your phone should boot into PostmarketOS.

Option #2: Install to a SD card
$ pmbootstrap init
 * As above, configure the image with:

One way is to run  in a terminal and find the path to the SD card (e.g.  ). In the following steps, we will use   as a placeholder, which you should adapt to your system.
 * Insert the SD card and find its path

$ pmbootstrap install --sdcard=/path/to/sdcard
 * Install PostmarketOS to the SD card


 * Insert the SD card into your Galaxy S2 and reboot. The system should boot (JonesV tested it with xfce4 and weston on 2020-08-20).

Option #3: Install from the recovery zip installer

 * Install a recovery like TWRP on your device

$ pmbootstrap init
 * Configure the image

$ pmbootstrap install --android-recovery-zip
 * Prepare the installation


 * Flash the image on the phone

$ pmbootstrap flasher --method=adb sideload

Option #4: Export the recovery zip into the eMMC's UMS partition over MTP and install from recovery
$ pmbootstrap pull $ pmbootstrap init $ pmbootstrap install --android-recovery-zip $ unzip recovery-Lanchon-IsoRec-TWRP-2.8.7.0-20160113-i9100-\(by-arnab\).zip $ unzip kernel-Lanchon-20160406-cm-13.0-i9100.zip $ heimdall flash --RECOVERY recovery-Lanchon-IsoRec-TWRP-2.8.7.0-20160113-i9100-\(by-arnab\)/isorec-ramdrive.cpio.lzo --KERNEL kernel-Lanchon-20160406-cm-13.0-i9100/boot.img --no-reboot $ pmbootstrap export $ cd $(dirname $(readlink /tmp/postmarketOS-export/pmos-*.zip)) $ cp pmos-samsung-i9100.zip /run/user/1000/gvfs/mtp:host=samsung_GT-I9100_0123456789ABCDEF/eMMC/ $ pmbootstrap flasher flash_kernel
 * Update pmbootstrap
 * Configure the image, select samsung i9100
 * Download, prepare and compress postmarketOS into a recovery package for TWRP
 * Extract the required temporary recovery and kernel created by Lanchon on XDA Forums
 * Start the device in download mode (hold  +   ->   for d710) -> plug device into PC
 * Flash the temporary kernel and TWRP using
 * Unplug the device -> reboot to recovery (hold  +   for d710)-> plug device back in -> in TWRP, mount -> disable MTP -> enable MTP -> back
 * Export the pmbootstrap chroot contents and create a symlink to them in
 * Change directory to the location of
 * Use an MTP client, for example gvfs-mtp with GNOME, to mount the device's eMMC UMS partition (virtual SD card) filesystem. If the one included with your Desktop Environment isn't working with this device, keep trying other MTP clients until you find one that does. The path it is mounted to may vary for you.
 * When the transfer is complete, in TWRP, install -> eMMC -> select pmos-samsung-i9100.zip -> swipe to flash postmarketOS into DATAFS
 * When complete, reboot to download mode and flash the postmarketOS kernel and recovery, overwriting the temporary ones
 * When complete, the device will reboot into postmarketOS

Mainline kernel
The Galaxy SII can be used with the mainline kernel for Exynos devices, packaged by PostmarketOS. Simply choose the mainline kernel when running pmbootstrap init.

Firmware files
When running "pmbootstrap init", it will ask you if you want to enable the "device-samsung-i9100-nonfree-firmware" package. Write "y" to be able to use the embedded WiFi chip.

U-Boot bootloader (legacy)
Sekilsgs2 on Github created a u-boot bootloader port, based on the work done by the user astarasikov at this repository. It is possible to use it with PostmarketOS but it requires some things to be done by hand.


 * In, add   to the list of extra packages to enable.


 * Run  to build the image.


 * Flash the OS using one of the methods listed above.


 * Now, we want both u-boot and the kernel to be installed to the same partition (KERNEL). So you need to concatenate the two files and flash the result:

$ cp ~/.local/var/pmbootstrap/chroot_rootfs_samsung-i9100/boot/u-boot.bin /tmp/u-boot-with-kernel.img $ dd if=~/.local/var/pmbootstrap/chroot_rootfs_samsung-i9100/boot/vmlinuz-dtb of=/tmp/u-boot-with-kernel.img bs=512K seek=1 conv=notrunc $ heimdall flash --KERNEL /tmp/u-boot-with-kernel.img

Once flashed, the phone will reboot and you should see u-boot appear. Configuring the boot options is not trivial as it can only be done by editing the source code (file: ). The critical part for me was to change boot parameters in the section "boot_android" to something like this:

root=/dev/mmcblk1p1 rw rootfstype=ext4 rootwait init=/sbin/init ;

Where  was the ext4 partition with the root filesystem on the sd-card.

User:Onny is interested in porting the i9100 u-boot patches to newer versions of u-boot but currently u-boot fails with the newer s5p_sdhci driver introduced in newer versions, see Github issue here.

Sekilsgs2 is also working on (March 2020) supporting the Galaxy S2 in the latest u-boot version.

TALUAtGitHub has a recent commit (March 2020) git commit that might be helpful