Resetear Samsung Galaxy s2 I9100 con la imagen original de fábrica desde Linux

Síntoma

El móvil no arranca. Se queda indefinidamente mostrando el logotipo de Samsung.

 

Entorno

Samsung Galaxy SII I9100 con sistema operativo Android

 

Causa

Accidentalmente :) borré la tarjeta SD e hice wipe (dalvik cache, /system, etc…) por lo que el móvil se quedó inusable. La única solución pasa por volver a dejarlo como estaba cuando salió de fábrica. Y eso es lo que veremos aquí.

 

Resolución

  1. Este procedimiento debe ser realizado desde un ordenador con cualquier distribución de linux instalada. También es necesario tener instalado el programa Heimdall. Heimdall[1] es una herramienta multiplataforma con licencia Open Source usada para escribir firmware (aka ROMs) en dispositivos móviles de Samsung.
     
  2. Crear una cuenta en sammobile[2] y buscar el firmware adecuado. En mi caso descargué el fichero I9100XWLS8_I9100FOPLS3_FOP.zip (542 MB):
    Samsung-Galaxy-S2-I9100XWLS8 
  3. Extraer el contenido
    $ unzip I9100XWLS8_I9100FOPLS3_FOP.zip
    $ mv I9100XWLS8_I9100XXLS8_I9100FOPLS3.tar.md5 I9100XWLS8_I9100XXLS8_I9100FOPLS3.tar
    $ tar xvf I9100XWLS8_I9100XXLS8_I9100FOPLS3_HOME.tar
    

     

  4. Reiniciar móvil en modo Download
    • Presiona Volumen abajo + Power + Botón Central
    • Cuando aparezca el Warning, conectar el cable usb
    • Presionar Volumen arriba

    Realizar este paso siempre y cuando el móvil se reinicie (generalmente después de ejecutar algún comando con Heimdall)

  5. Convertirse en root y comprobar que se puede ver el dispositivo
    # heimdall detect
    Device detected
    

    Es una buena práctica realizar esta comprobación siempre que se reinicie el móvil.

  6. Descargar el PIT (Partition Information Table) del móvil.

    ”#


    Heimdall v1.4.1Copyright (c) 2010-2014 Benjamin Dobell, Glass Echidna
    http://www.glassechidna.com.au/This software is provided free of charge. Copying and redistribution is
    encouraged.If you appreciate this software and you would like to support future
    development please consider donating:
    http://www.glassechidna.com.au/donate/Initialising connection…
    Detecting device…
    Claiming interface…
    Attempt failed. Detaching driver…
    Claiming interface again…
    Setting up interface…Initialising protocol…
    Protocol initialisation successful.

    Beginning session…

    Some devices may take up to 2 minutes to respond.
    Please be patient!

    Session begun.

    Downloading device’s PIT file…
    PIT file download successful.

    Entry Count: 15
    Unknown 1: 0
    Unknown 2: 0
    Unknown 3: 0
    Unknown 4: 0
    Unknown 5: 0
    Unknown 6: 0
    Unknown 7: 0
    Unknown 8: 0

    — Entry #0 —
    Binary Type: 0 (AP)
    Device Type: 2 (MMC)
    Identifier: 0
    Attributes: 0 (Read-Only)
    Update Attributes: 0
    Partition Block Size/Offset: 0
    Partition Block Count: 0
    File Offset (Obsolete): 0
    File Size (Obsolete): 0
    Partition Name: GANG
    Flash Filename: emmc.img
    FOTA Filename:

    — Entry #1 —
    Binary Type: 0 (AP)
    Device Type: 2 (MMC)
    Identifier: 1
    Attributes: 0 (Read-Only)
    Update Attributes: 0
    Partition Block Size/Offset: 0
    Partition Block Count: 0
    File Offset (Obsolete): 0
    File Size (Obsolete): 0
    Partition Name: BOOT
    Flash Filename: boot.bin
    FOTA Filename:

    — Entry #2 —
    Binary Type: 0 (AP)
    Device Type: 2 (MMC)
    Identifier: 4
    Attributes: 1 (Read/Write)
    Update Attributes: 0
    Partition Block Size/Offset: 8192
    Partition Block Count: 40960
    File Offset (Obsolete): 0
    File Size (Obsolete): 0
    Partition Name: EFS
    Flash Filename: efs.img
    FOTA Filename:

    — Entry #3 —
    Binary Type: 0 (AP)
    Device Type: 2 (MMC)
    Identifier: 2
    Attributes: 0 (Read-Only)
    Update Attributes: 0
    Partition Block Size/Offset: 49152
    Partition Block Count: 2560
    File Offset (Obsolete): 0
    File Size (Obsolete): 0
    Partition Name: SBL1
    Flash Filename: Sbl.bin
    FOTA Filename:

    — Entry #4 —
    Binary Type: 0 (AP)
    Device Type: 2 (MMC)
    Identifier: 3
    Attributes: 0 (Read-Only)
    Update Attributes: 0
    Partition Block Size/Offset: 53248
    Partition Block Count: 2560
    File Offset (Obsolete): 0
    File Size (Obsolete): 0
    Partition Name: SBL2
    Flash Filename:
    FOTA Filename:

    — Entry #5 —
    Binary Type: 0 (AP)
    Device Type: 2 (MMC)
    Identifier: 5
    Attributes: 0 (Read-Only)
    Update Attributes: 0
    Partition Block Size/Offset: 57344
    Partition Block Count: 16384
    File Offset (Obsolete): 0
    File Size (Obsolete): 0
    Partition Name: PARAM
    Flash Filename: param.lfs
    FOTA Filename:

    — Entry #6 —
    Binary Type: 0 (AP)
    Device Type: 2 (MMC)
    Identifier: 6
    Attributes: 0 (Read-Only)
    Update Attributes: 0
    Partition Block Size/Offset: 73728
    Partition Block Count: 16384
    File Offset (Obsolete): 0
    File Size (Obsolete): 0
    Partition Name: KERNEL
    Flash Filename: zImage
    FOTA Filename:

    — Entry #7 —
    Binary Type: 0 (AP)
    Device Type: 2 (MMC)
    Identifier: 7
    Attributes: 0 (Read-Only)
    Update Attributes: 0
    Partition Block Size/Offset: 90112
    Partition Block Count: 16384
    File Offset (Obsolete): 0
    File Size (Obsolete): 0
    Partition Name: RECOVERY
    Flash Filename:
    FOTA Filename:

    — Entry #8 —
    Binary Type: 0 (AP)
    Device Type: 2 (MMC)
    Identifier: 8
    Attributes: 1 (Read/Write)
    Update Attributes: 0
    Partition Block Size/Offset: 106496
    Partition Block Count: 204800
    File Offset (Obsolete): 0
    File Size (Obsolete): 0
    Partition Name: CACHE
    Flash Filename: cache.img
    FOTA Filename:

    — Entry #9 —
    Binary Type: 0 (AP)
    Device Type: 2 (MMC)
    Identifier: 9
    Attributes: 0 (Read-Only)
    Update Attributes: 0
    Partition Block Size/Offset: 311296
    Partition Block Count: 32768
    File Offset (Obsolete): 0
    File Size (Obsolete): 0
    Partition Name: MODEM
    Flash Filename: modem.bin
    FOTA Filename:

    — Entry #10 —
    Binary Type: 0 (AP)
    Device Type: 2 (MMC)
    Identifier: 10
    Attributes: 1 (Read/Write)
    Update Attributes: 0
    Partition Block Size/Offset: 344064
    Partition Block Count: 1048576
    File Offset (Obsolete): 0
    File Size (Obsolete): 0
    Partition Name: FACTORYFS
    Flash Filename: factoryfs.img
    FOTA Filename:

    — Entry #11 —
    Binary Type: 0 (AP)
    Device Type: 2 (MMC)
    Identifier: 11
    Attributes: 1 (Read/Write)
    Update Attributes: 0
    Partition Block Size/Offset: 1392640
    Partition Block Count: 4194304
    File Offset (Obsolete): 0
    File Size (Obsolete): 0
    Partition Name: DATAFS
    Flash Filename: data.img
    FOTA Filename:

    — Entry #12 —
    Binary Type: 0 (AP)
    Device Type: 2 (MMC)
    Identifier: 12
    Attributes: 2 (STL Read-Only)
    Update Attributes: 0
    Partition Block Size/Offset: 5586944
    Partition Block Count: 24133632
    File Offset (Obsolete): 0
    File Size (Obsolete): 0
    Partition Name: UMS
    Flash Filename:
    FOTA Filename:

    — Entry #13 —
    Binary Type: 0 (AP)
    Device Type: 2 (MMC)
    Identifier: 13
    Attributes: 1 (Read/Write)
    Update Attributes: 0
    Partition Block Size/Offset: 29720576
    Partition Block Count: 1048576
    File Offset (Obsolete): 0
    File Size (Obsolete): 0
    Partition Name: HIDDEN
    Flash Filename: hidden.img
    FOTA Filename:

    — Entry #14 —
    Binary Type: 1 (CP)
    Device Type: 1 (File/FAT)
    Identifier: 9
    Attributes: 0 (Read-Only)
    Update Attributes: 0
    Partition Block Size/Offset: 0
    Partition Block Count: 0
    File Offset (Obsolete): 0
    File Size (Obsolete): 0
    Partition Name:
    Flash Filename:
    FOTA Filename:

    Ending session…
    Rebooting device…
    Releasing device interface…
    Re-attaching kernel driver…



    Posiblemente se reinicie el móvil. Apágalo y vuelve a poner el móvil en modo Download.
  7. Extraer el nombre de todas las particiones. Dichos nombres corresponderán con los parámetros que pasemos a Heimdall:

    # cat pit.txt | grep -i 'PARTITION NAME'


    Partition Name: GANG
    Partition Name: BOOT
    Partition Name: EFS
    Partition Name: SBL1
    Partition Name: SBL2
    Partition Name: PARAM
    Partition Name: KERNEL
    Partition Name: RECOVERY
    Partition Name: CACHE
    Partition Name: MODEM
    Partition Name: FACTORYFS
    Partition Name: DATAFS
    Partition Name: UMS
    Partition Name: HIDDEN


     
  8. Último paso. Instalar el firmware en el móvil:

    # heimdall flash --BOOT boot.bin --CACHE cache.img --FACTORYFS factoryfs.img --HIDDEN hidden.img --MODEM modem.bin --PARAM param.lfs --SBL1 Sbl.bin --KERNEL zImage


    Heimdall v1.4.1Copyright (c) 2010-2014 Benjamin Dobell, Glass Echidna
    http://www.glassechidna.com.au/This software is provided free of charge. Copying and redistribution is
    encouraged.If you appreciate this software and you would like to support future
    development please consider donating:
    http://www.glassechidna.com.au/donate/

    Initialising connection…
    Detecting device…
    Claiming interface…
    Attempt failed. Detaching driver…
    Claiming interface again…
    Setting up interface…

    Initialising protocol…
    Protocol initialisation successful.

    Beginning session…

    Some devices may take up to 2 minutes to respond.
    Please be patient!

    Session begun.

    Downloading device’s PIT file…
    PIT file download successful.

    Uploading BOOT
    100%
    BOOT upload successful

    Uploading CACHE
    100%
    CACHE upload successful

    Uploading FACTORYFS
    100%
    FACTORYFS upload successful

    Uploading HIDDEN
    100%
    HIDDEN upload successful

    Uploading MODEM
    100%
    MODEM upload successful

    Uploading PARAM
    100%
    PARAM upload successful

    Uploading SBL1
    100%
    SBL1 upload successful

    Uploading KERNEL
    100%
    KERNEL upload successful

    Ending session…
    Rebooting device…
    Releasing device interface…
    Re-attaching kernel driver…



     

Referencias

  1. Heimdall
  2. Sammobile Firmwares

Leave a Reply

Your email address will not be published. Required fields are marked *