Difference between revisions of "Samsung Galaxy SIII LTE (samsung-i9305)"

From postmarketOS
Jump to: navigation, search
(Installing with downstream kernel)
(Install with mainline kernel (WIP, not functionnal yet))
Line 173: Line 173:
 
===Install with mainline kernel (WIP, not functionnal yet) ===
 
===Install with mainline kernel (WIP, not functionnal yet) ===
  
*Export image files in ~/.local/var/pmbootstrap/chroot_rootfs_samsung-i9305/boot/
+
<syntaxhighlight lang="shell" line='line'>
<code>
+
#Export image files in ~/.local/var/pmbootstrap/chroot_rootfs_samsung-i9305/boot/
 
pmbootstrap export
 
pmbootstrap export
  
Line 181: Line 181:
 
#6,1M -rw-r--r--  1 root root 6,1M déc.  22 20:31 initramfs-samsung-i9305-extra
 
#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
 
#4,1M -rw-r--r--  1 root root 4,1M nov.  5 17:30 vmlinuz-samsung-i9305
</code>
+
 
*Get linux-next
+
#Get linux-next
<code>
 
 
cd ~/code
 
cd ~/code
</code>
+
# Case 1 : first checkout
** Case 1 : first checkout
+
git clone https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git linux
<code>
+
cd linux/
git clone https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git linux<br>
+
git fetch origin
cd linux/<br>
+
git reset --hard origin/master
git fetch origin<br>
+
# Case 2 : update
git reset --hard origin/master<br>
+
cd linux/
</code>
+
git checkout master
** Case 2 : update
 
<code>
 
cd linux/<br>
 
git checkout master<br>
 
 
git pull
 
git pull
</code>
+
 
*Prepare compile with i9305 defconfig in ~/code/linux/arch/arm/configs
+
#Prepare compile with i9305 defconfig in ~/code/linux/arch/arm/configs
<code>
+
source ~/code/pmbootstrap/helpers/envkernel.sh
source ~/code/pmbootstrap/helpers/envkernel.sh<br>
 
 
make exynos_defconfig
 
make exynos_defconfig
</code>
+
#DTS : Note that ~/code/linux/arch/arm/boot/dts/exynos4412-i9305.dts already exists and should work
**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
**Makefile in ~/code/linux/arch/arm/boot/dts/ already contains this DTS
+
 
*Kernel compilation
+
#Kernel compilation
<code>
 
 
make -j5
 
make -j5
</code>
+
 
*Prepare shell
+
#Prepare shell
 
<code>
 
<code>
pmbootstrap chroot -- apk add abootimg android-tools mkbootimg dtbtool findutils<br>
+
pmbootstrap chroot -- apk add abootimg android-tools mkbootimg dtbtool findutils
export DEVICE="$(pmbootstrap config device)"<br>
+
export DEVICE="$(pmbootstrap config device)"
export WORK="$(pmbootstrap config work)"<br>
+
export WORK="$(pmbootstrap config work)"
export TEMP="$WORK/chroot_native/tmp/mainline/"<br>
+
export TEMP="$WORK/chroot_native/tmp/mainline/"
 
mkdir -p "$TEMP"
 
mkdir -p "$TEMP"
</code>
+
 
*Patch boot image
+
#Patch boot image
<code>
+
cd ~/code/linux/.output/arch/arm/boot
cd ~/code/linux/.output/arch/arm/boot<br>
+
cat zImage dts/exynos4412-i9305.dtb > "$TEMP"/zImage-dtb
cat zImage dts/exynos4412-i9305.dtb > "$TEMP"/zImage-dtb<br>
+
cp "/tmp/postmarketOS-export/boot.img-$DEVICE" "$TEMP/boot.img"
cp "/tmp/postmarketOS-export/boot.img-$DEVICE" "$TEMP/boot.img"<br>
+
pmbootstrap chroot
pmbootstrap chroot<br>
+
abootimg -u /tmp/mainline/boot.img  -k /tmp/mainline/zImage-dtb -c bootsize=8955904
abootimg -u /tmp/mainline/boot.img  -k /tmp/mainline/zImage-dtb -c bootsize=8955904<br>
 
 
exit
 
exit
</code>
 
  
*Flash with Heimdall - WARNING - NOT FUNCTIONNAL YET
+
#Flash with Heimdall - WARNING - NOT FUNCTIONNAL YET
** enter download mode with down+home+power
+
# enter download mode with down+home+power
** Connect usb
+
# Connect usb
** click 'up'
+
# click 'up'
<code>
+
heimdall detect
heimdall detect<br>
 
 
heimdall flash --BOOT ~/.local/var/pmbootstrap/chroot_native/tmp/mainline/boot.img
 
heimdall flash --BOOT ~/.local/var/pmbootstrap/chroot_native/tmp/mainline/boot.img
</code>
+
</syntaxhighlight>

Revision as of 19:41, 4 January 2020

Samsung Galaxy S III LTE
Samsung Galaxy SIII LTE
Samsung Galaxy SIII LTE
Manufacturer Samsung
Name Galaxy S III LTE
Codename samsung-i9305
Released 2012
Category testing
Original software Android 4.1.1
Hardware
Chipset Exynos 4412 Quad
CPU Quad-core 1.4 GHz Cortex-A9
GPU Mali-400MP4
Display 720x1280 Super AMOLED
Storage 16 GB
Memory 2 GB
Architecture armhf
Features
USB Networking
Works
Flashing
Touchscreen
Works
Display
Works
WiFi
Works
Xwayland
Works
FDE
Works
Mainline
Battery
3D Acceleration
Accelerometer
Audio
Bluetooth
Camera
GPS
Mobile data
SMS
Calls
USB OTG



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

  • tyxieblub
  • colaur

Maintainer(s)

How to enter flash mode

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

Installation

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

At this point you can follow the general installation guide. 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.


Installing with downstream kernel

 1 #FIRST PMBOOTSTRAP INSTALL
 2 mkdir ~/code
 3 cd ~/code
 4 git clone https://gitlab.com/postmarketOS/pmbootstrap.git
 5 
 6 #CONFIG PMBOOTSTRAP
 7 alias pmbootstrap=~/code/pmbootstrap/pmbootstrap.py
 8 pmbootstrap init
 9 #work path default
10 #samsung
11 #i9305
12 #n
13 #wathever
14 #weston
15 #n
16 #none
17 #y
18 #samsung-i9305
19 #y
20 
21 #FOR DEBUGGING (NOT REQUIRED)
22 pmbootstrap initfs hook_add debug-shell
23 #Check log with 'tail -f ~/.local/var/pmbootstrap/log.txt'
24 
25 #CREATE RECOVERY ZIP (for flashing with TWRP)
26 pmbootstrap install --no-fde --android-recovery-zip
27 
28 #COPY ON SDCARD
29 cp ~/.local/var/pmbootstrap/chroot_buildroot_armhf/var/lib/postmarketos-android-recovery-installer/pmos-samsung-i9305.zip /media/computer/sdcard/
30 #Insert sdcard in phone
31 #Reboot on recovery with up+home+power
32 #Install from zip
33 #Reboot
34 
35 #IF BOOT STANDBY (DEBUG)
36 #Connect with USB cable
37 telnet 172.16.42.1
38 pmos_continue_boot

Wifi

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.

 $ echo 'wpa_supplicant_args="-iwlan0 -Dwext"' | sudo tee /etc/conf.d/wpa_supplicant

Write the following file to
/etc/network/interfaces
 auto lo 
 iface lo inet loopback   
 auto wlan0 
 iface wlan0 inet dhcp
To connect using NetworkManger you will need to change the default DHCP client from the NetworkManager internal DHCP client to dhclient (you will need to specify the additional package at install with pmbootstrap or apk add dhclient if you have a connection) by creating
/etc/NetworkManager/conf.d/dhcp-client.conf
and adding
 [main]
 dhcp=dhclient

Start the networkmanger service and restart networking service

 $ sudo rc-service networkmanger start
 $ sudo rc-service networking restart

Search for available WiFi networks and connect to network

 $ sudo nmcli device wifi list ifname wlan0
 $ sudo nmcli device wifi connect "$SSID" password "$PASSWORD" ifname wlan0

Set services to start

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

Reboot and you should be connected on boot.

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

$ wpa_passphrase YOUR_SSID YOUR_PASSPHRASE | sudo tee /etc/wpa_supplicant/wpa_supplicant.conf
$ sudo rc-service wpa_supplicant restart


Mainline Kernel

The mainline kernel now has some support for the Samsung Galaxy SIII LTE (i9305):

Upstream dts: exynos4412-i9305.dts

Upstream status: Midas on Mainline.

Note that a patch is required to make it work with the stock samsung bootloader.

forkbomb from LineageOS got mainline u-boot running on this device: [1]

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 [2]

The Qualcomm Gobi MDM9615 Modem seems to have mainline kernel support as well: [3]

Replicant and LineageOS successfully got the Lima driver for Mesa working on Mali when using mainline linux: video success announcement

Replicant currently supports this device in 6.0 and is doing a lot of research in order to get it running with a mainline kernel with a mainline bootloader for Replicant 9. More bootloader research is here.

xboot might be a completely free bootloader option. Looks to have zero proprietary blobs.


Install with mainline kernel (WIP, not functionnal yet)

 1 #Export image files in ~/.local/var/pmbootstrap/chroot_rootfs_samsung-i9305/boot/
 2 pmbootstrap export
 3 
 4 #5,3M -rw-r--r--  1 root root 5,3M déc.  22 20:31 boot.img-samsung-i9305 (initramfs + vmlinuz)
 5 #1,3M -rw-r--r--  1 root root 1,3M déc.  22 20:31 initramfs-samsung-i9305
 6 #6,1M -rw-r--r--  1 root root 6,1M déc.  22 20:31 initramfs-samsung-i9305-extra
 7 #4,1M -rw-r--r--  1 root root 4,1M nov.   5 17:30 vmlinuz-samsung-i9305
 8 
 9 #Get linux-next
10 cd ~/code
11 # Case 1 : first checkout
12 git clone https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git linux
13 cd linux/
14 git fetch origin
15 git reset --hard origin/master
16 # Case 2 : update
17 cd linux/
18 git checkout master
19 git pull
20 
21 #Prepare compile with i9305 defconfig in ~/code/linux/arch/arm/configs
22 source ~/code/pmbootstrap/helpers/envkernel.sh
23 make exynos_defconfig
24 #DTS : Note that ~/code/linux/arch/arm/boot/dts/exynos4412-i9305.dts already exists and should work
25 #Makefile in ~/code/linux/arch/arm/boot/dts/ already contains this DTS
26 
27 #Kernel compilation
28 make -j5
29 
30 #Prepare shell
31 <code>
32 pmbootstrap chroot -- apk add abootimg android-tools mkbootimg dtbtool findutils
33 export DEVICE="$(pmbootstrap config device)"
34 export WORK="$(pmbootstrap config work)"
35 export TEMP="$WORK/chroot_native/tmp/mainline/"
36 mkdir -p "$TEMP"
37 
38 #Patch boot image
39 cd ~/code/linux/.output/arch/arm/boot
40 cat zImage dts/exynos4412-i9305.dtb > "$TEMP"/zImage-dtb
41 cp "/tmp/postmarketOS-export/boot.img-$DEVICE" "$TEMP/boot.img"
42 pmbootstrap chroot
43 abootimg -u /tmp/mainline/boot.img  -k /tmp/mainline/zImage-dtb -c bootsize=8955904
44 exit
45 
46 #Flash with Heimdall - WARNING - NOT FUNCTIONNAL YET
47 # enter download mode with down+home+power
48 # Connect usb
49 # click 'up'
50 heimdall detect
51 heimdall flash --BOOT ~/.local/var/pmbootstrap/chroot_native/tmp/mainline/boot.img