Jump to content

Samsung Galaxy S III (samsung-m0): Difference between revisions

From postmarketOS Wiki
Svargas (talk | contribs)
Fixed typo; removed dhclient config as PostmarketOS now defautls to dhcpcd with NetworkManager
Halamix2 (talk | contribs)
mNo edit summary
 
(143 intermediate revisions by 36 users not shown)
Line 1: Line 1:
{{Infobox device
{{Infobox device
| manufacturer = Samsung
| manufacturer = Samsung
| name =  Galaxy S III LTE
| name =  Galaxy S III
| codename = samsung-i9305
| codename = samsung-m0
| image = File:Samsung-i9300-galaxy-s-iii-ofic.jpg
| image = File:Samsung-m0.png
| imagecaption = Samsung Galaxy SIII LTE
| imagecaption = Samsung Galaxy S III
| releaseyear = 2012
| releaseyear = 2012
| originalsoftware = Android 4.1.1
| category = community
| chipset = Exynos 4412 Quad
| originalsoftware = Android
| originalversion = 4.1.1
| chipset = Samsung Exynos 4412 Quad
| cpu = Quad-core 1.4 GHz Cortex-A9
| cpu = Quad-core 1.4 GHz Cortex-A9
| gpu = Mali-400MP4
| gpu = Mali 400 MP4
| storage = 16 GB
| storage = 16 GB/32 GB
| display = 720x1280 Super AMOLED
| display = 720x1280 Super AMOLED
| memory = 2 GB
| memory = 1 GB (GT-i9300 & SHW-M440S)
| architecture = armhf
| architecture = armv7
| status_usbnet = Y
| type = handset
| status_flashing =  
<!-- the following status_* questions should be answered with Y - yes, P - partial, N - no, or left blank (for untested or unknown) -->
| status_usbnet = P
| status_flashing = Y
| status_touch = Y
| status_touch = Y
| status_screen = Y
| status_screen = Y
| status_wifi = Y
| status_wifi = Y
| status_xwayland = Y
| status_fde = Y
| status_fde = Y
| status_mainline =  
| status_mainline = Y
| status_battery =
| status_battery = Y
| status_3d =  
| status_3d = Y
| status_accel =  
| status_accel = Y
| status_audio =  
| status_audio = P
| status_bluetooth =
| status_bluetooth = P
| status_camera =
| status_camera = P
| status_gps =  
| status_gps = N
| status_mobiledata =  
| status_mobiledata = N
| status_sms =  
| status_sms = N
| status_calls =  
| status_calls = N
| status_light = Y
| status_hdmidp = P
| status_otg = Y
| status_sdcard = Y
| status_emmc = Y
| status_nfc = -
| status_barometer = -
| status_powersensor = -
| status_keyboard = -
| status_touchpad = -
| status_usba = -
| status_irtx = -
| status_irrx = -
| status_stylus = -
| status_haptics = -
| status_dvb = -
| status_ethernet = -
| status_uart = Y
| status =
| status_fossbootloader = P
| status_uboot = yes
| status_uboot_mainline = N
| status_uboot_primary = Y
| status_uboot_secondary = -
| status_uboot_keyboard = -
| booting = yes
| booting = yes
}}
}}
'''So far, what works for samsung-i9305 (Galaxy SIII LTE version) also works for the samsung-i9300 (Galaxy SIII international GSM version without LTE).  (Neither of these SIII models should be confused with the North American SIII models, which require OS builds.)'''
== Contributors ==
== Contributors ==
* [[User:Thiagaoplusplus|Thiagaopluplus]]
* tyxieblub
* tyxieblub
* colaur
* [[User:Newbyte|Newbyte]]
* [[User:Grimler|Grimler]]


== Maintainer(s) ==
== Maintainer(s) ==
<!-- Only if this device doesn't run on linux-postmarketos yet! -->
* [[User:Newbyte|Newbyte]]
<!-- This person needs to be willing to answer questions from users of this device -->
 
== Basic Info ==
 
So far, what works for [[Samsung Galaxy S III LTE (samsung-m3)]] also works for the samsung-m0 (Galaxy S III international GSM version without LTE, Also known as Galaxy S III 3G SHW-M440S in South Korea) and samsung-shv-e210s (a Korean variant). (None of these S III models should be confused with the North American S III models, which require OS builds.)
 
Code name is MIDAS. Search for midas-mainline to find more info.
 
== Users owning this device ==
{{Device owners}}


== How to enter flash mode ==
== How to enter flash mode ==
Line 52: Line 87:
== Installation ==
== Installation ==


Set phone to ODIN mode
=== Step 1: Flash the system ===
 
==== Option 1: Flash the system to an SD card ====
 
Start by flashing a pre-built postmarketOS rootfs image onto an SD card, as described in the [[installation]] article.
 
==== Option 2: Flash the system to the phone's internal storage ====
 
{{note|'''Note:''' If this runs into errors, please use option 1.}}
 
'''Prepare img2simg'''
 
Start by downloading and building [https://github.com/anestisb/android-simg2img/ simg2img], make sure that it's runnable from somewhere, you can just copy the generated binaries, (only 'img2simg' is needed), in /usr/bin and make them executable with chmod.
 
'''Prepare needed images - Option 1: Use a ''pre-built'' image'''
 
Download a pre-built postmarketOS rootfs image (GNOME mobile recommended, others ran into errors for me, more testing required), and extract it with any xz-supporting archive software, make sure to NOT extract the .img itself, only the .xz.
 
'''Prepare needed images - Option 2: Use a image you built yourself with ''pmbootstrap'''''
 
Follow the instructions at [[Installation/Using_pmbootstrap|this Wiki page]] till "''Flashing''", since you won't flash the image yet, instead do
pmbootstrap export
and copy your rootfs image (usually named '''samsung-m0.img''') from the output directory to a working directory.
 
'''Convert the image into ''Android sparse format'''''
 
The next step is to convert the rootfs image into an ''Android sparse image''.
 
This is needed so we can flash the image in ''download mode''.
 
To do this, we will use ''img2simg''. Run this in the directory where you downloaded/saved the rootfs image:
img2simg path-to-rootfs.img pmos-sparse.img
The command might take some time to be executed, but once done, you will have an Android sparse image of postmarketOS ("pmos-sparse.img").
 
'''Flash the image'''
 
The next step is to flash that image with Heimdall. Note: you might need to repeat these steps if Android overwrites the USERDATA partition. Anyways, to flash the image, we need to enter ODIN mode as described in [https://wiki.postmarketos.org/wiki/Samsung_Galaxy_S_III_(samsung-m0)#Step_2:_Enter_ODIN_mode Enter ODIN mode], and run this command:
heimdall flash --USERDATA pmos-sparse.img
 
=== Step 2: Enter ODIN mode ===
 
To enter ODIN mode, follow these steps:


   1. Turn off phone
   1. Turn off phone
  3. Hold Volume Down + Home + Power until you get Warning!! screen
   2. Connect USB cable
   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
   4. Push VOLUME_UP to continue to ODIN mode screen
 
=== Step 3: Flash the kernel via ODIN mode ===


At this point you can follow the [[Installation guide | general installation guide]].
Now, use Heimdall to flash the image with -boot at the end to your boot partition. Make sure that you extract it before flashing it (the downloaded file is a compressed .tar.xz archive).
Installation to the system is not yet supported for the device, so make sure to install postmarketOS to the sdcard. Also be sure to not enable FDE as osk-sdl is not yet supported for this device, and enabling it would require you to telnet into the device to unlock it.


Flash it with this command:


==Installing with downstream kernel==
heimdall flash --BOOT <Decompressed image filename> --verbose


<syntaxhighlight lang="shell" line='line'>
Note that it's important to write BOOT in all capitalised letters, as otherwise you will get an error about the partition not being found in the PIT.
#FIRST PMBOOTSTRAP INSTALL
mkdir ~/code
cd ~/code
git clone https://gitlab.com/postmarketOS/pmbootstrap.git


#CONFIG PMBOOTSTRAP
After that's done, your device should now automatically reboot into postmarketOS!
alias pmbootstrap=~/code/pmbootstrap/pmbootstrap.py
pmbootstrap init
#work path default
#samsung
#i9305
#n
#wathever
#weston
#n
#none
#y
#samsung-i9305
#y


#FOR DEBUGGING (NOT REQUIRED)
== WiFi ==
pmbootstrap initfs hook_add debug-shell
#Check log with 'tail -f ~/.local/var/pmbootstrap/log.txt'


#CREATE RECOVERY ZIP (for flashing with TWRP)
As of {{MR|2556|pmaports}}, WiFi should "just work" (on mainline).
pmbootstrap install --no-fde --android-recovery-zip


#COPY ON SDCARD
If WiFi networks show up but you can't connect to them, you can try using the nvram for samsung-m3/i9305. This is a hack and not necessarily endorsed, but at least one user has reported that their samsung-m0/i9300 needs this for WiFi to work. We would like to handle this better, but currently we don't have any way of doing this.
cp ~/.local/var/pmbootstrap/chroot_buildroot_armhf/var/lib/postmarketos-android-recovery-installer/pmos-samsung-i9305.zip /media/computer/sdcard/
#Insert sdcard in phone
#Reboot on recovery with up+home+power
#Install from zip
#Reboot


#IF BOOT STANDBY (DEBUG)
To switch to the nvram meant for samsung-m3, run this command:
#Connect with USB cable
 
telnet 172.16.42.1
<syntaxhighlight lang="shell-session>
pmos_continue_boot
$ cd /lib/firmware/brcm
$ sudo mv brcmfmac4334-sdio.samsung,i9300.txt brcmfmac4334-sdio.samsung,i9300.txt.bak
$ sudo ln -sf brcmfmac4334-sdio.samsung,i9305.txt brcmfmac4334-sdio.samsung,i9300.txt
</syntaxhighlight>
</syntaxhighlight>


== Wifi ==
If it still refuses to connect, you might want to try replacing the contents of <code>/lib/firmware/bcrm/brcmfmac4334-sdio.samsung,i9300.txt</code> with [https://raw.githubusercontent.com/TheMuppets/proprietary_vendor_samsung/cm-14.1/smdk4412-common/proprietary/etc/wifi/nvram_net.txt the nvram from LineageOS]. Apparently this is necessary on some British i9300 models.


To get the wifi working, you'll need to modify the wpa_supplicant configuration. If this is not done, wpa_supplicant starts with -ip2p0 which is not supported on our device.
Related issue: {{issue|1571|pmaports}}


  $ echo 'wpa_supplicant_args="-iwlan0 -Dwext"' | sudo tee /etc/conf.d/wpa_supplicant
== Video out ==
Write the following file to <source>/etc/network/interfaces</source>


  auto lo
[[File:Samsung-m0-video-out.jpg|400px|thumb|right|Samsung Galaxy S III providing video out to a TV through an original Samsung dock (model name: EDD-S20EWE).]]
  iface lo inet loopback 
  auto wlan0
  iface wlan0 inet dhcp


Start the networkmanger service and restart networking service
Video out should work as long as you use an 11pin MHL cable or dock (safest option would be an original Samsung dock/adapter from the time period, Samsung's EDD-S20EWE is known to work).


  $ sudo rc-service networkmanager start
In 2022-09, all hdmi related nodes were disabled ({{MR|3395|pmaports}}) as the kernel driver reports the wrong state, and this led to the Phosh stack not starting up.
  $ sudo rc-service networking restart
A WIP to fix issue can be found at [https://gitlab.com/exynos4-mainline/linux/-/tree/m0-mhl-fixes gitlab.com/exynos4-mainline/linux/-/tree/m0-mhl-fixes].


Search for available WiFi networks and connect to network
== Battery ==


  $ sudo nmcli device wifi list ifname wlan0
With mainline, battery reporting works as of {{MR|2423|pmaports}}, and charging works as of {{MR|2546|pmaports}}. Charging allegedly randomly stops, but should that happen you can just unplug and re-plug the cable. Charging is also very slow and the device will probably lose power if you use it while charging.
  $ sudo nmcli device wifi connect "$SSID" password "$PASSWORD" ifname wlan0


Set services to start
Battery reporting and charging via postmarketOS does not work on the downstream kernel - the device gets stuck on whatever percentage it was on boot (although it does charge in recovery mode)


  $ sudo rc-update add wpa_supplicant boot
== Modem ==
  $ sudo rc-update add networking default
  $ sudo rc-update add networkmanager default


Reboot and you should be connected on boot.
The modem does not work in postmarketOS. That said, there was some work done to enable the modem on the i9300 variant of this device. It can be found here: https://github.com/fourkbomb/linux/tree/modem. Note that even if you apply this, you would likely need userspace patches as well for calls and mobile data to be usable.


You may also connect directly using wpa_supplicant forgoing NetworkManager. Please note this method will not automatically reconnect to WiFi if you loose connection
== Audio ==


$ wpa_passphrase YOUR_SSID YOUR_PASSPHRASE | sudo tee /etc/wpa_supplicant/wpa_supplicant.conf
Audio mostly works. Notable omissions are input from the main microphone and headset audio out.
$ sudo rc-service wpa_supplicant restart


== GPS ==


== Mainline Kernel ==
The Galaxy S III uses [[Broadcom BCM4751 GPS]].
The mainline kernel now has some support for the Samsung Galaxy SIII LTE (i9305):


Upstream dts: [https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/exynos4412-i9305.dts exynos4412-i9305.dts]
== Miscellaneous mainline kernel information ==


Upstream status: [http://blog.forkwhiletrue.me/pages/midas-mainline/ Midas on Mainline].
The kernel package for this device in postmarketOS is {{Template:pmaport|linux-postmarketos-exynos4}}. The patches can be found in the [https://gitlab.com/exynos4-mainline/linux exynos4-mainline/linux repository on GitLab].


Note that [https://github.com/fourkbomb/linux/commit/2a6027178ae40c1d3baa965fe21b19cbf09493ce a patch is required] to make it work with the stock samsung bootloader.
A large part of the mainlining process was done by [https://github.com/fourkbomb forkbomb]; see [http://blog.forkwhiletrue.me/pages/midas-mainline/ Midas on Mainline].


forkbomb from LineageOS got mainline u-boot running on this device:
The Replicant project also provides good mainline support for the Galaxy S III; [https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/1219#note_85246108 they have expressed intent to collaborate with us]. Their support matrix can be found [https://redmine.replicant.us/projects/replicant/wiki/GalaxyS3I9300 on their wiki]. Relevant links:
[https://blog.forkwhiletrue.me/posts/an-almost-fully-libre-galaxy-s3/]


Replicant has this device booting with mainline Linux and almost mainline U-Boot with only the need for a few patches on top and would like to collaborate with us [https://github.com/postmarketOS/pmbootstrap/pull/1219#issuecomment-395876420]
* [https://redmine.replicant.us/projects/replicant/wiki/GalaxyS3I9300 General information]
* [https://redmine.replicant.us/projects/replicant/wiki/Exynos4Bootrom More bootloader research is here.]
* [https://git.replicant.us/replicant-next/kernel_replicant_linux Replicant's mainline kernel git repo]


The Qualcomm Gobi MDM9615 Modem seems to have mainline kernel support as well: [https://redmine.replicant.us/projects/replicant/wiki/GalaxyS3I9305#Hardware-table]
Upstream DTS: [https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/exynos4412-i9305.dts exynos4412-i9305.dts]


Replicant and LineageOS successfully got the Lima driver for Mesa working on Mali when using mainline linux: [http://www.belg.in/replicant_9.webm video] [https://github.com/CustomROMs/android_local_manifests_i9300/issues/1#issuecomment-532308101 success announcement]
=== Alternative bootloaders ===


Replicant currently supports this device [https://redmine.replicant.us/projects/replicant/wiki/GalaxyS3I9300 in 6.0] and is doing a lot of research in order to get it running with [https://redmine.replicant.us/projects/replicant/wiki/Upstream a mainline kernel with a mainline bootloader] for Replicant 9. [https://redmine.replicant.us/projects/replicant/wiki/Exynos4Bootrom More bootloader research is here.]
* forkbomb got mainline u-boot running on this device and wrote about it in this blog post: https://blog.forkwhiletrue.me/posts/an-almost-fully-libre-galaxy-s3/
* [https://github.com/xboot/xboot/tree/b71fe8174882277897649bfe2177bf3ca300af69/src/arch/arm32/mach-exynos4412 xboot] might be a completely free bootloader option. Looks to have zero proprietary blobs.


[https://github.com/xboot/xboot/tree/b71fe8174882277897649bfe2177bf3ca300af69/src/arch/arm32/mach-exynos4412 xboot] might be a completely free bootloader option. Looks to have zero proprietary blobs.
=== Modem support ===


Replicant supports the modem on mainline Linux, and they're working on getting the i9300 modem working with a mainline kernel in a way that pmOS can also utilize: https://redmine.replicant.us/issues/1954 https://git.replicant.us/contrib/GNUtoo/kernel_replicant_linux/log/?h=replicant-11-i9300-modem


===Install with mainline kernel (WIP, not functionnal yet) ===
The Qualcomm Gobi MDM9615 Modem seems to have mainline kernel support as well: https://redmine.replicant.us/projects/replicant/wiki/GalaxyS3I9305#Hardware-table


<syntaxhighlight lang="shell" line='line'>
LTE modem support with the mainline kernel on Replicant is being done here: https://redmine.replicant.us/issues/2206 The Note II discussed here has the same or very similar modem as the i9305.
#Export image files in ~/.local/var/pmbootstrap/chroot_rootfs_samsung-i9305/boot/
pmbootstrap export


#5,3M -rw-r--r--  1 root root 5,3M déc.  22 20:31 boot.img-samsung-i9305 (initramfs + vmlinuz)
== Warnings and considerations ==
#1,3M -rw-r--r--  1 root root 1,3M déc.  22 20:31 initramfs-samsung-i9305
#6,1M -rw-r--r--  1 root root 6,1M déc.  22 20:31 initramfs-samsung-i9305-extra
#4,1M -rw-r--r--  1 root root 4,1M nov.  5 17:30 vmlinuz-samsung-i9305


#Get linux-next
=== Power ===
cd ~/code
# Case 1 : first checkout
git clone https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git linux
cd linux/
git fetch origin
git reset --hard origin/master
# Case 2 : update
cd linux/
git checkout master
git pull


#Prepare compile with i9305 defconfig in ~/code/linux/arch/arm/configs
It used to be that the battery percentage wasn't properly monitored and would get stuck at a set percentage at boot. While this was the case, the phone would not shut down when battery levels went too low, which could make the phone behave strangely on significantly worn batteries (in the ballpark of 50% wear). There are theories that this may have caused hardware failure for one user, but this is not proven. Battery level reporting has since been fixed, but it has not been extensively tested for reliability, so we recommend that you try to not let your phone's battery percentage fall too low. It should shut down on its own before anything adverse can happen, however.
source ~/code/pmbootstrap/helpers/envkernel.sh
make exynos_defconfig
#DTS : Note that ~/code/linux/arch/arm/boot/dts/exynos4412-i9305.dts already exists and should work
#Makefile in ~/code/linux/arch/arm/boot/dts/ already contains this DTS


#Kernel compilation
See {{issue|1115|pmaports}} for more information.
make -j5


#Prepare shell
=== eMMC firmware bugs ===
<code>
pmbootstrap chroot -- apk add abootimg android-tools mkbootimg dtbtool findutils
export DEVICE="$(pmbootstrap config device)"
export WORK="$(pmbootstrap config work)"
export TEMP="$WORK/chroot_native/tmp/mainline/"
mkdir -p "$TEMP"


#Patch boot image
Replicant has a good article about this: https://redmine.replicant.us/projects/replicant/wiki/EMMCFirmwareBugs
cd ~/code/linux/.output/arch/arm/boot
cat zImage dts/exynos4412-i9305.dtb > "$TEMP"/zImage-dtb
cp "/tmp/postmarketOS-export/boot.img-$DEVICE" "$TEMP/boot.img"
pmbootstrap chroot
abootimg -u /tmp/mainline/boot.img  -k /tmp/mainline/zImage-dtb -c bootsize=8955904
exit


#Flash with Heimdall - WARNING - NOT FUNCTIONNAL YET
=== Heimdall does not consider partition sizes when flashing ===
# enter download mode with down+home+power
 
# Connect usb
See {{github|494|Heimdall|Benjamin-Dobell}}
# click 'up'
 
heimdall detect
== See also ==
heimdall flash --BOOT ~/.local/var/pmbootstrap/chroot_native/tmp/mainline/boot.img
* {{wikipedia|Samsung_Galaxy_S_III|Wikipedia}}
</syntaxhighlight>
* {{Device package|samsung-m0|community}}
* {{Kernel package|postmarketos-exynos4|community}}
* [https://media.ccc.de/v/34c3-8784-emmc_hacking_or_how_i_fixed_long-dead_galaxy_s3_phones Fix long dead Galaxy S3 phone eMMC bug]
* [https://toomoch.github.io/i9300-EMMC-GUIDE/ Guide to revive a bricked i9300 EMMC]
* {{MR|2556|pmaports}} Rename from i9300 to m0
* [https://github.com/ungeskriptet/miscellaneous/raw/main/twrp-3.6.0_9-i9300_emmc-boot-partitions-patch.img TWRP with eMMC boot partitions patch], useful for flashing bootloaders

Latest revision as of 11:33, 1 February 2025

Samsung Galaxy S III
Samsung Galaxy S III
Samsung Galaxy S III
Manufacturer Samsung
Name Galaxy S III
Codename samsung-m0
Released 2012
Type handset
Hardware
Chipset Samsung Exynos 4412 Quad
CPU Quad-core 1.4 GHz Cortex-A9
GPU Mali 400 MP4
Display 720x1280 Super AMOLED
Storage 16 GB/32 GB
Memory 1 GB (GT-i9300 & SHW-M440S)
Architecture armv7
Software
Original software Android
Original version 4.1.1
FOSS bootloader partial
postmarketOS
Category community
Pre-built images yes
Features
Flashing
Works
USB Networking
Partial
Internal storage
Works
SD card
Works
Battery
Works
Screen
Works
Touchscreen
Works
Multimedia
3D Acceleration
Works
Audio
Partial
Camera
Partial
Camera Flash
No data
Connectivity
WiFi
Works
Bluetooth
Partial
GPS
Broken
Modem
Calls
Broken
SMS
Broken
Mobile data
Broken
Miscellaneous
FDE
Works
USB OTG
Works
HDMI/DP
Partial
Sensors
Accelerometer
Works
Magnetometer
No data
Ambient Light
Works
Proximity
No data
Hall Effect
No data
U-Boot
Primary Bootloader
Works
Mainline
Broken
Internal Storage
No data
SD card
No data
USB Host
No data
USB Peripheral
No data
Display
No data
Buttons
No data

Contributors

Maintainer(s)

Basic Info

So far, what works for Samsung Galaxy S III LTE (samsung-m3) also works for the samsung-m0 (Galaxy S III international GSM version without LTE, Also known as Galaxy S III 3G SHW-M440S in South Korea) and samsung-shv-e210s (a Korean variant). (None of these S III models should be confused with the North American S III models, which require OS builds.)

Code name is MIDAS. Search for midas-mainline to find more info.

Users owning this device


How to enter flash mode

  • Hold power + Home + volume down
  • When prompted, release all buttons and press volume up

Installation

Step 1: Flash the system

Option 1: Flash the system to an SD card

Start by flashing a pre-built postmarketOS rootfs image onto an SD card, as described in the installation article.

Option 2: Flash the system to the phone's internal storage

Note Note: If this runs into errors, please use option 1.

Prepare img2simg

Start by downloading and building simg2img, make sure that it's runnable from somewhere, you can just copy the generated binaries, (only 'img2simg' is needed), in /usr/bin and make them executable with chmod.

Prepare needed images - Option 1: Use a pre-built image

Download a pre-built postmarketOS rootfs image (GNOME mobile recommended, others ran into errors for me, more testing required), and extract it with any xz-supporting archive software, make sure to NOT extract the .img itself, only the .xz.

Prepare needed images - Option 2: Use a image you built yourself with pmbootstrap

Follow the instructions at this Wiki page till "Flashing", since you won't flash the image yet, instead do

pmbootstrap export

and copy your rootfs image (usually named samsung-m0.img) from the output directory to a working directory.

Convert the image into Android sparse format

The next step is to convert the rootfs image into an Android sparse image.

This is needed so we can flash the image in download mode.

To do this, we will use img2simg. Run this in the directory where you downloaded/saved the rootfs image:

img2simg path-to-rootfs.img pmos-sparse.img

The command might take some time to be executed, but once done, you will have an Android sparse image of postmarketOS ("pmos-sparse.img").

Flash the image

The next step is to flash that image with Heimdall. Note: you might need to repeat these steps if Android overwrites the USERDATA partition. Anyways, to flash the image, we need to enter ODIN mode as described in Enter ODIN mode, and run this command:

heimdall flash --USERDATA pmos-sparse.img

Step 2: Enter ODIN mode

To enter ODIN mode, follow these steps:

 1. Turn off phone
 3. Hold Volume Down + Home + Power until you get Warning!! screen
 2. Connect USB cable
 4. Push Volume up to continue to ODIN mode screen

Step 3: Flash the kernel via ODIN mode

Now, use Heimdall to flash the image with -boot at the end to your boot partition. Make sure that you extract it before flashing it (the downloaded file is a compressed .tar.xz archive).

Flash it with this command:

heimdall flash --BOOT <Decompressed image filename> --verbose

Note that it's important to write BOOT in all capitalised letters, as otherwise you will get an error about the partition not being found in the PIT.

After that's done, your device should now automatically reboot into postmarketOS!

WiFi

As of pmaports!2556, WiFi should "just work" (on mainline).

If WiFi networks show up but you can't connect to them, you can try using the nvram for samsung-m3/i9305. This is a hack and not necessarily endorsed, but at least one user has reported that their samsung-m0/i9300 needs this for WiFi to work. We would like to handle this better, but currently we don't have any way of doing this.

To switch to the nvram meant for samsung-m3, run this command:

$ cd /lib/firmware/brcm
$ sudo mv brcmfmac4334-sdio.samsung,i9300.txt brcmfmac4334-sdio.samsung,i9300.txt.bak
$ sudo ln -sf brcmfmac4334-sdio.samsung,i9305.txt brcmfmac4334-sdio.samsung,i9300.txt

If it still refuses to connect, you might want to try replacing the contents of /lib/firmware/bcrm/brcmfmac4334-sdio.samsung,i9300.txt with the nvram from LineageOS. Apparently this is necessary on some British i9300 models.

Related issue: pmaports#1571

Video out

Samsung Galaxy S III providing video out to a TV through an original Samsung dock (model name: EDD-S20EWE).

Video out should work as long as you use an 11pin MHL cable or dock (safest option would be an original Samsung dock/adapter from the time period, Samsung's EDD-S20EWE is known to work).

In 2022-09, all hdmi related nodes were disabled (pmaports!3395) as the kernel driver reports the wrong state, and this led to the Phosh stack not starting up. A WIP to fix issue can be found at gitlab.com/exynos4-mainline/linux/-/tree/m0-mhl-fixes.

Battery

With mainline, battery reporting works as of pmaports!2423, and charging works as of pmaports!2546. Charging allegedly randomly stops, but should that happen you can just unplug and re-plug the cable. Charging is also very slow and the device will probably lose power if you use it while charging.

Battery reporting and charging via postmarketOS does not work on the downstream kernel - the device gets stuck on whatever percentage it was on boot (although it does charge in recovery mode)

Modem

The modem does not work in postmarketOS. That said, there was some work done to enable the modem on the i9300 variant of this device. It can be found here: https://github.com/fourkbomb/linux/tree/modem. Note that even if you apply this, you would likely need userspace patches as well for calls and mobile data to be usable.

Audio

Audio mostly works. Notable omissions are input from the main microphone and headset audio out.

GPS

The Galaxy S III uses Broadcom BCM4751 GPS.

Miscellaneous mainline kernel information

The kernel package for this device in postmarketOS is linux-postmarketos-exynos4PMOS. The patches can be found in the exynos4-mainline/linux repository on GitLab.

A large part of the mainlining process was done by forkbomb; see Midas on Mainline.

The Replicant project also provides good mainline support for the Galaxy S III; they have expressed intent to collaborate with us. Their support matrix can be found on their wiki. Relevant links:

Upstream DTS: exynos4412-i9305.dts

Alternative bootloaders

Modem support

Replicant supports the modem on mainline Linux, and they're working on getting the i9300 modem working with a mainline kernel in a way that pmOS can also utilize: https://redmine.replicant.us/issues/1954 https://git.replicant.us/contrib/GNUtoo/kernel_replicant_linux/log/?h=replicant-11-i9300-modem

The Qualcomm Gobi MDM9615 Modem seems to have mainline kernel support as well: https://redmine.replicant.us/projects/replicant/wiki/GalaxyS3I9305#Hardware-table

LTE modem support with the mainline kernel on Replicant is being done here: https://redmine.replicant.us/issues/2206 The Note II discussed here has the same or very similar modem as the i9305.

Warnings and considerations

Power

It used to be that the battery percentage wasn't properly monitored and would get stuck at a set percentage at boot. While this was the case, the phone would not shut down when battery levels went too low, which could make the phone behave strangely on significantly worn batteries (in the ballpark of 50% wear). There are theories that this may have caused hardware failure for one user, but this is not proven. Battery level reporting has since been fixed, but it has not been extensively tested for reliability, so we recommend that you try to not let your phone's battery percentage fall too low. It should shut down on its own before anything adverse can happen, however.

See pmaports#1115 for more information.

eMMC firmware bugs

Replicant has a good article about this: https://redmine.replicant.us/projects/replicant/wiki/EMMCFirmwareBugs

Heimdall does not consider partition sizes when flashing

See Heimdall#494

See also