User Tools

Site Tools


doc:appunti:hardware:samsung_galaxy_s4

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
doc:appunti:hardware:samsung_galaxy_s4 [2019/09/16 15:38] – [Bootloader, baseband firmware, ROM, etc.] niccolodoc:appunti:hardware:samsung_galaxy_s4 [2019/09/17 09:56] (current) – [Backup other data] niccolo
Line 137: Line 137:
  
 After removing the above apps I still see from the Play Store what apps I installed should be upgraded. Indeed - almost certainly - the **Samsung Firmware Update Over The Air** (FOTA) are disabled, which is not so bad. After removing the above apps I still see from the Play Store what apps I installed should be upgraded. Indeed - almost certainly - the **Samsung Firmware Update Over The Air** (FOTA) are disabled, which is not so bad.
 +
 ===== Special codes ===== ===== Special codes =====
  
Line 147: Line 148:
  
 ===== CyanogenMod ===== ===== CyanogenMod =====
 +
 +:!: **This paragraph is obsolete**. It is preferable to install LineageOS instead of CyanogenMod, see this page: **[[samsung_s4_lineageos]]**.
  
 After more than one year of random freeze we decided to give-up with Samsung software: too much bloated, too much instable. There are some unofficial ports of **[[http://www.cyanogenmod.org/|CyanogenMod]]** v.12.1 (based on Android 5.1 Lollipop) and 13.0 (based on 6.0 Marshmallow). See [[#web_links|web links]] below for download links. After more than one year of random freeze we decided to give-up with Samsung software: too much bloated, too much instable. There are some unofficial ports of **[[http://www.cyanogenmod.org/|CyanogenMod]]** v.12.1 (based on Android 5.1 Lollipop) and 13.0 (based on 6.0 Marshmallow). See [[#web_links|web links]] below for download links.
Line 167: Line 170:
 ==== Backup other data ==== ==== Backup other data ====
  
-The modem firmware can reasonably be called your //baseband//, Generally speaking: firmare updates should follow operating system updates, it is safe **to not use newer firmware with old operating system**.+The modem firmware can reasonably be called your //baseband//, Generally speaking: firmare updates should follow operating system updates, it is advisable **to not use newer firmware with old operating system**.
  
-^ Partition     ^ Content                       ^ How to get  ^ +^ Partition     ^ Content                            ^ How to get  ^ 
-^ modem.bin     | Firmware for the 3G modem.    | Original firmware (e.g. download from [[http://www.sammobile.com]]) +^ modem.bin     | Firmware for the 3G/LTE modem.     | Original firmware (e.g. download from [[http://www.sammobile.com]]) 
-^ NON-HLOS.bin  | Firmware for the LTE modem  | Original firmware (e.g. download from [[http://www.sammobile.com]]) +^ NON-HLOS.bin  | Firmware for the WiFi radio, etc | Original firmware (e.g. download from [[http://www.sammobile.com]]) 
-^ EFS           | Radio signal info, IMEI, ...  | Saved by TWRP Recovery backup.  |+^ EFS           | Radio signal info, IMEI, ...       | Saved by TWRP Recovery backup.  |
 ==== Flashing CyanogenMod ==== ==== Flashing CyanogenMod ====
  
Line 199: Line 202:
  
 It seems the same problem reported in this post: [[https://forum.cyanogenmod.org/topic/103513-microphone-record-volume-very-low-jflte-on-s4-t-mobile-sgh-m919/|Microphone Record Volume Very Low Jflte On S4]]. One solution suggested in that thread, requires to flash a new kernel with special tweak features: the [[http://forum.xda-developers.com/showthread.php?t=2590246|kernel from Alucard developer]]. It seems the same problem reported in this post: [[https://forum.cyanogenmod.org/topic/103513-microphone-record-volume-very-low-jflte-on-s4-t-mobile-sgh-m919/|Microphone Record Volume Very Low Jflte On S4]]. One solution suggested in that thread, requires to flash a new kernel with special tweak features: the [[http://forum.xda-developers.com/showthread.php?t=2590246|kernel from Alucard developer]].
-===== LineageOS ===== 
- 
-Dopo la chiusura del progetto [[wp>CyanogenMod|CyanogenMod]], lo sviluppo di questa ROM alternativa si è concentrato sul fork **[[wp>LineageOS|LineageOS]]**. 
- 
-Abbiamo provato la versione **lineage-14.1-20170121-UNOFFICIAL-jfvelte** che si basa sul **Android 7.1 Nougat**. 
- 
-**Il primo tentativo è fallito** perché quella ROM **richiede il bootloader della version 5.0.1**, mentre noi avevamo quello originale della versione 4.4.2. Durante l'installazione (fatta dopo aver avviato in recovery TWRP) si è avuto il seguente messaggio di errore: 
- 
-<code> 
-E3004: This package is for device with 5.0.1 bootloader 
-and baseband; this device is I9515XXU1ANI3 
-</code> 
- 
-L'errore è ovviamente comparso **dopo che avevamo fatto il wipe** delle partizioni di sistema, quindi **il telefono era totalmente inutilizzabile**. Per fortuna si riusciva ad avviare sia in **modalità download** che in **modalità recovery** con la combinazione dei tasti opportuna. In modalità download abbiamo aggiornato il bootloader (le partizioni **SBLx** e **ABOOT**) e visto che c'eravamo abbiamo aggiornato anche il firmware del modem e tutto il resto. 
- 
-==== Bootloader, baseband firmware, ROM, etc. ==== 
- 
-Il sistema operativo (che nel mondo Android spesso viene chiamato col termine improprio e fuorviante di ROM) risiede in una propria partizione, generalmente formattata con un filesystem di tipo ext4 o analogo. Gli aggiornamenti oppure gli archivi per effettuare il restore alle condizioni di fabbrica contengono l'immagine di tale partizione (ad esempio **system.img.ext4**), ma contengono anche le immagini di altre partizioni necessarie al funzionamento. Spesso si sente parlare di **aggiornare il bootloader** e il **baseband** di uno smartphone. si tratta del contenuto di queste altre partizioni che spiegheremo qui sotto.  
- 
-Per approfondire il processo di boot di Android vedere **[[http://newandroidbook.com/Articles/aboot.html|Reverse Engineering Android's Aboot]]**. 
- 
-Per **baseband** si intende in genere il **firmware** che regola il **funzionamento dei dispositivi radio**, come il modem 3G, le comunicazioni cellulari voce e dati, il WiFi, Bluetooth, NFC, ecc. 
- 
-Ecco ad esempio il **contenuto della ROM stock** Android 5.0.1 con codici PDA I9515XXS1BPL2 e CSC I9515YXY1BOI1. I vari file sono elencati nell'ordine in cui vengono utilizzati al bootstrap. 
- 
-^ sbl1.mbn, sbl2.mbn, sbl3.mbn  | Images of the **Secondary Boot Loader**. They are loaded during bootstrap from the boot loader contained into the ROM (the real ROM, that is the read-only memory integrated into the chips). They provide add-ons that are not present in the very limited ROM. This is **the updatable part (flashable) of the bootloader**.  | 
-^ aboot.mbn     | **Android Boot** image. It is an ARM executable started by the Secondary Boot Loader, generally it must be //digitally signed// by the vendor, otherwise it is rejected by the SBL. The operating system may have special requirements with respect to these components, for example LineageOS 14.1 requires the SBL and Android Boot shipped with Android 5.0.1.  | 
-^ boot.img      | Contains the image of the **kernel** and the **initial ramdisk**. This image should be the one provided by the installed operating system (ROM). Stock ROM 5.0.1 provides its own //boot.img//, LineageOS 14.1 has another. If the phone has an **unlocked boot loader**, it will be possible to load a **boot.img not digitally signed** by the vendor.  | 
-^ modem.bin     | Firmware, probably fpr the **3G/LTE** modem (SMS, CSD, ETWS, 4GV, EVRC etc.).  | 
-^ NON-HLOS.bin  | Firmware, probably for the **WiFI** radio device, WPA, etc. May be also for //SRS TruMedia// audio, etc. Those are functions not provided by the //High Level Operating Systems// (HLOS).  | 
-^ rpm.mbn       | Support for **Resource Power Manager** by Qualcomm Technologies.  | 
-^ tz.mbn        | Contains the **TrustZone** Board Support Package, to use the hardware-based security feature built into every modern ARM processor.  | 
-^ recovery.img  | This image is used when starting the phone in **recovery mode**. In general it is preferable to flash an **alternative recovery such as TWRP** and not to use the //stock recovery// | 
-^ system.img.ext4  | Main image of the Android 5.0.1 **operating system**. This is the biggest file, about 2 Gb.  | 
-^ cache.img.ext4    | 
-^ hidden.img.ext4  |  | 
- 
-==== Procedura di aggiornamento ==== 
- 
-La procedura completa e corretta dovrebbe quindi essere la seguente. 
- 
-=== Download del software === 
- 
-  - Seguendo le indicazioni della pagina **[[https://forum.xda-developers.com/galaxy-s4/general/rom-cm14-1-galaxy-s4-jfvelte-gt-i9515-t3534552|LineageOS 14.1 for Galaxy S4(GT-I9515)]]** abbiamo scaricato una versione aggiornata della recovery TWRP, in particolare abbiamo scaricato il file **twrp-3.3.1-0-jfvelte.img.tar** dalla pagina **[[https://eu.dl.twrp.me/jfvelte/twrp-3.3.1-0-jfvelte.img.tar.html|eu.dl.twrp.me]]**. Sul nostro telefono era già installata la recovery TWRP, ma l'abbiamo aggiornata. 
-  - Seguendo le istruzioni nella pagina **[[http://www.lineageosdownloads.com/download-galaxy-s4-ve-i9515-lineage-os/|Download Galaxy S4 VE I9515 Lineage OS 14.1 [jfvelte] [Android 7.1.1 Nougat]]]** abbiamo scaricato il file **[[https://androidfilehost.com/?fid=385035244224414352|lineage-14.1-20170121-UNOFFICIAL-jfvelte.zip]]**. 
-  - Sempre secondo le istruzioni di cui sopra abbiamo scaricato **le Google Apps** dalla pagina **[[http://www.lineageosdownloads.com/download-gapps-lineage-os-versions/|www.lineageosdownloads.com]]**. In particolare abbiamo indicato l'architettura **ARM** (non ARM64 né x86, poiché questo Samsung ha una CPU ARMv7), e la collezione **Gapps Micro** (eventuali altre componenti potranno essere aggiunte dal Play Store. Il file che abbiamo scaricato ha nome **open_gapps-arm-7.1-mini-20190913.zip** 
-  - Abbiamo cercato la ROM ufficiale Samsung identificata da PDA (Product code and Android build) **I9515XXS1BPL2** e CSC (Country Sales Code?) **I9515YXY1BOI1**. Si tratta della ROM originale Android 5.0.1 Lollipop del **2016-12-13** per l'Italia (**ITV**), di cui a noi interessa **solo il bootloader** e il **firmware aggiornato** del modem. Pare che non sia possibile scaricare questa rom dal sito ufficiale Samsung, quindi ci siamo dovuti rivolgere a terzi, come **[[https://samsung-firmware.org/]]**. Il file scaricato si chiama **ITV-I9515XXS1BPL2_I9515YXY1BOI1-20161213.zip**. 
- 
-=== Copia dei file sul telefono === 
- 
-Alcuni file vanno copiati sul telefono, si suggerisce di usare la memoria interna, non la SD Card. Nel nostro caso la memoria interna ha il percorso **/storage/sdcard1/**. I file copiati sono: 
- 
-  * **recovery.img** - Estratto dall'archivio twrp-3.3.1-0-jfvelte.img.tar. Contiene la recovery TWRP. 
-  * **lineage-14.1-20170121-UNOFFICIAL-jfvelte.zip** - Così come scaricato, contiene la ROM LineageOS 14.1 con la procedura di installazione da lanciare dentro TWRP. 
-  * **open_gapps-arm-7.1-mini-20190913.zip** - Sono le Google Apps, così come scaricate. Anche queste vanno installate da TWRP dopo aver installato la ROM. 
- 
-=== Aggiornamento di TWRP === 
- 
-Non è strettamente necessaio per l'installazione di LineageOS, ma abbiamo approfittato per passare da TWRP 3.0.3 a 3.3.1. L'aggiornamento di TWRP si è effettuato da TWRP stessa: 
- 
-  * Riavviato in **modalità recovery** con **adb reboot recovery** (comando da PC GNU/Linux). 
-  * TWRP 3.0.2 => Install => Install image => Browse to **recovery.img** and tap it. 
-  * Select Partition to Flash Image: Recovery => **Swipe to confirm Flash** => Reboot System 
- 
-=== Aggiornamento del bootloader === 
- 
-Installare il pacchetto **heimdall** su un PC GNU/Linux. 
- 
-  - Avviare in **modalità download** da telefono spento premendo VolDown + Home + Power. Collegare il cavetto USB. 
-  - Dal PC GNU/Linux eseguire **heimdall detect** per verificare che il telefono sia riconosciuto. 
-  - Effettuare il **flash** del boot loader e dei firmare (richiede permessi di root sul PC):<code> 
-heimdall flash --SBL1 sbl1.mbn --SBL2 sbl2.mbn --SBL3 sbl3.mbn --ABOOT aboot.mbn \ 
-        --APNHLOS NON-HLOS.bin --MDM modem.bin \ 
-        --RPM rpm.mbn --TZ tz.mbn</code> 
- 
-Ciò che è davvero necessario per LineageOS è aggiornare il boot loader (partizioni **SBLx** e **ABOOT**), ma aggiornare gli altri firmware non fa male. Il progamma mostra l'avanzamento percentuale durante il flash di ogni partizione. Alla conclusione tenta un reboot (che forse fallisce perché il boot loader è per Android 5.0.1, ma il nostro S.O. è ancora quello vecchio). 
- 
-=== Installazione della ROM e delle Gapps === 
- 
-  * Riavviare in **modalità recovery**: da telefono spento premere VolUP + Home + Power. 
-  * Wipe => **Advanced Wipe**: 
-    * Select only: **Dalvik/ART Cache**, **System**, **Data**, **Cache** 
-  * Swipe to Wipe, Back 
-  * Install => Browse and tap **lineage-14.1-20170121-UNOFFICIAL-jfvelte.zip** (no "Zip signature verification", no "Reboot after installation"), Swipe to confirm Flash 
-  * Installare nello stesso modo le **open_gapps-arm-7.1-mini-20190913.zip**. 
- 
-==== APN Iliad ==== 
- 
-Con LineageOS 14.1 la connessione dati con l'operatore Iliad non funziona automaticamente. È stato necessario impostare manualmente la configurazione dell'APN (seguendo le indicazioni fornite dall'operatore): 
- 
-Impostazioni => Altro => Reti cellulari => **Nomi punti di accesso** => Aggiungi 
- 
-^ Nome  | iliad  | 
-^ APN   | iliad  | 
-^ MMSC  | %%http://mms.iliad.it%%  | 
-^ MCC   | 222  | 
-^ MNC   | 50  | 
  
 ===== Reinstallare il software originale ===== ===== Reinstallare il software originale =====
doc/appunti/hardware/samsung_galaxy_s4.txt · Last modified: 2019/09/17 09:56 by niccolo