• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[How-To] Safely test custom kernels / custom ROMs and get back to stock SE 2.3 ROM

Search This thread

DooMLoRD

Inactive Recognized Developer
Jul 27, 2010
13,191
39,701
Pune
hey guys since jerpelea has already got the custom kernels working, it will just be a matter of time before we see custom ROMs...

i am making this thread so as to answer the many questions that users are having on how to get back to stock when testing custom kernels / custom roms...



[--> WARNING <--]

PLEASE READ THE COMPLETE POST (1ST & 2ND) BEFORE U DO ANYTHING

I AM NOT RESPONSIBLE IF UR DEVICE GETS BRICKED BECAUSE U DID NOT READ THE WHOLE THING PROPERLY / U HAD SOME TYPO WHILE EXECUTING THE COMMANDS

MAKE SURE THAT UR PHONE BATTERY IS FAIRLY CHARGED (> 50%) BEFORE DOING ANY FLASHING AND THAT UR PC HAS A UPS BACKUP (BECAUSE IF FLASHING IS INTERRUPTED THEN IT CAN HAVE SERIOUS CONSEQUENCES)




[ BEFORE U BEGIN ]


Requirements:
  1. Flashtool (it is advisable to use latest version)
  2. Fastboot files
  3. Stock Firmware FTF package
  4. [OPTIONAL] PreRooted system.img files
  5. 7zip



How to use FlashTool:

FLASHTOOL GUIDE - HOW TO for n00bies
this was posted in X10 section but is even relevant for Arc/Play/Neo users



How to use FastBoot:

[Newbie Guide] adb/fastboot/bootloader/android 101




[ FLASHING CUSTOM KERNEL/ROM ]


Flashing Custom Kernel (boot.img):

  1. this WILL NOT WIPE ur data
  2. the custom kernel will be provided as boot.img file
  3. just copy this file to fastboot folder
  4. just power down device and get into FASTBOOT MODE (LED notification turns BLUE) with usb-cable connected to PC
  5. once u are in fastboot mode open command prompt and navigate to the folder containing fastboot files then just use the following command to flash custom kernel:
    Code:
    fastboot flash boot boot.img
  6. once flashing is complete you will get a prompt on pc saying that everything is ok
  7. now just unplug ur device and u are on the custom kernel



Flashing Custom ROM/SYSTEM (system.img):

  1. this WILL NOT WIPE ur data, it will only wipe ur /system partition
  2. the custom ROM/system will be provided as system.img file
  3. just copy this file to fastboot folder
  4. just power down device and get into FASTBOOT MODE (LED notification turns BLUE) with usb-cable connected to PC
  5. once u are in fastboot mode open command prompt and navigate to the folder containing fastboot files then just use the following command to flash custom ROM/system:
    Code:
    fastboot flash system system.img
  6. once flashing is complete you will get a prompt on pc saying that everything is ok
  7. now just unplug ur device and u on custom rom/system




[ GET BACK TO STOCK ]


jerpelea has posted an unbrick (softbrick) package in the FreeXperia project thread... details on how to use it can be found in Post #2 of this thread...


Following is much more generic information which can be applicable to any FW/ROM/Kernel


How to get back to Stock Firmware (FW):

  1. this will get u back to COMPLETE STOCK SETTINGS
    • ALL ur data WILL BE WIPED
    • u will get back to stock kernel
    • u will get back to stock ROM/system
    • ur SDCARD data WILL NOT BE affected
  2. you will need stock FTF package
  3. get ur device into FLASH MODE (LED notification turns Green)
  4. use flashtool to flash stock FTF package
  5. for details refer to the above FlashTool guide



How to get back to Stock Kernel (boot.img / kernel.sin):

  1. this WILL NOT WIPE ur data
  2. using 7zip extract the FTF package to some directory
  3. you will get many files with extension .sin
  4. we are interested in the kernel.sin file, which is the stock kernel
  5. just copy this file to fastboot folder
  6. now for getting back to stock kernel just power down device and get into FASTBOOT MODE (LED notification turns BLUE) with usb-cable connected to PC
  7. once u are in fastboot mode open command prompt and navigate to the folder containing fastboot files then just use the following command to flash stock kernel:
    Code:
    fastboot flash boot kernel.sin
  8. once flashing is complete you will get a prompt on pc saying that everything is ok
  9. now just unplug ur device and u are back to stock kernel



How to get back to Stock ROM (system.img / system.sin):

OPTION - 1 : stock unrooted system

  1. this WILL NOT WIPE ur data, it will only wipe ur /system partition
  2. using 7zip extract the FTF package to some directory
  3. you will get many files with extension .sin
  4. we are interested in the system.sin file, which is the stock rom/system
  5. just copy this file to fastboot folder
  6. now for getting back to stock system/ROM just power down device and get into FASTBOOT MODE (LED notification turns BLUE) with usb-cable connected to PC
  7. once u are in fastboot mode open command prompt and navigate to the folder containing fastboot files then just use the following command to flash stock ROM/system:
    Code:
    fastboot flash system system.sin
  8. once flashing is complete you will get a prompt on pc saying that everything is ok
  9. now just unplug ur device and u are back to stock rom/system

OPTION - 2 : stock PreRooted system

  1. this WILL NOT WIPE ur data, it will only wipe ur /system partition
  2. use the prerooted system.img u downloaded from above links
  3. just copy this file to fastboot folder
  4. now for getting back to stock prerooted system/ROM just power down device and get into FASTBOOT MODE (LED notification turns BLUE) with usb-cable connected to PC
  5. once u are in fastboot mode open command prompt and navigate to the folder containing fastboot files then just use the following command to flash stock ROM/system:
    Code:
    fastboot flash system system.img
  6. once flashing is complete you will get a prompt on pc saying that everything is ok
  7. now just unplug ur device and u are back to stock rom/system




[ TROUBLESHOOTING ]


  • sometimes u may run into problems after flashing back from custom system.img to stock system.img, like apps & core system crashes/force closes
  • if u face such problems then it is advisable to WIPE ur /data parition
  • this WILL WIPE ur data (apps, settings), ur SDCARD DATA WONT BE AFFECTED
  • just power down device and get into FASTBOOT MODE (LED notification turns BLUE) with usb-cable connected to PC
  • once u are in fastboot mode open command prompt and navigate to the folder containing fastboot files then just use the following command to wipe /data partition:
    Code:
    fastboot erase userdata
  • once flashing is complete you will get a prompt on pc saying that everything is ok
  • now just unplug ur device and the problems should be sorted out
  • if u still are facing problems just flash back to Stock Firmware using FLASHTOOL




[ FINAL THOUGHTS ]


I hope this answers most of ur questions...

in case of specific queries about flashtool/fastboot or prerooted images ask in THOSE SPECIFIC threads... if u have any queries other than that [RELATED TO THIS THREAD ;) ] u can post ur questions here...



PLEASE DONT FILL UP DEV THREADS WILL REDUNDANT QUESTIONS
 
Last edited:

DooMLoRD

Inactive Recognized Developer
Jul 27, 2010
13,191
39,701
Pune
jerpelea has posted an unbrick (softbrick) package in the FreeXperia project thread...

here is how to use it to get back to stock!


Requirements:
  1. Fastboot drivers already installed
  2. unbrick (softbrick) package
  3. 7zip


How to get back to Stock Kernel & system:

  1. this WILL WIPE ur data
  2. using 7zip extract the unbrick (softbrick) package to some directory
  3. now for getting back to stock kernel & ROM just power down device and get into FASTBOOT MODE (LED notification turns BLUE) with usb-cable connected to PC
  4. once u are in fastboot mode just browse to the folder where u extracted the unbrick package double click on restoreme.cmd
  5. once flashing is complete you will get a prompt on pc saying that everything is ok (or the command prompt window might just close in some time dont worry its expected)
  6. ur device will now restart automatically
  7. now just unplug ur device and u are back to stock kernel & ROM
 
Last edited:

DooMLoRD

Inactive Recognized Developer
Jul 27, 2010
13,191
39,701
Pune
i just saw that jerpelea has posted an unbrick (softbrick) package...

i am downloading it now and will updated the info as per the files present in that package...


EDIT:

how to updated...
info on how to use the package updated in 2nd post
 
Last edited:
  • Like
Reactions: electrash

PollPixx

Senior Member
Apr 27, 2009
2,103
618
Man, what an amount of text, thanks for your efforts to get everything organized this well. Will try as soon as we have any reliable material to work with.

Sent from my arc or optimus 2x
 

Lef.teris

Senior Member
Apr 14, 2009
130
117
Nice thread man, thank you!!!

I have two questions.

1. How can I modify or create a custom boot.img (from kernel.sin)?
2. How can I create/compress a new system.img back from extracted system.sin (with sin2img tool)

If anyone want to share his knowledge please pm me!
 
Last edited:

hush66

Senior Member
Apr 6, 2010
921
437
Thanks for the guide!

I'm just wondering. In X10's XRecovery, there is a Backup and a Restore function. The Backup function practically saves the entire ROM including data. One can then proceed to flash custom ROMs/kernels. In the event that we want to revert back to the original ROM including data, we just have to use the Restore function.

Does any of the above methods achieve the same result?
 

DooMLoRD

Inactive Recognized Developer
Jul 27, 2010
13,191
39,701
Pune
Thanks for the guide!

I'm just wondering. In X10's XRecovery, there is a Backup and a Restore function. The Backup function practically saves the entire ROM including data. One can then proceed to flash custom ROMs/kernels. In the event that we want to revert back to the original ROM including data, we just have to use the Restore function.

Does any of the above methods achieve the same result?

those are called NANDROID backups can be created using working RECOVERY...

no the above methods can ONLY WRITE to device... they cant take backups...
 
  • Like
Reactions: hush66

depulle87

Senior Member
Nov 25, 2010
674
117
found this thread and it helped me a lot thanks for it works like a charm, flashed custom kernel and back to stock without losing my data
 

Rycon33

Senior Member
Apr 28, 2011
3,217
2,130
Xiaomi Poco F3
guys quick question here
i'm currently using rooted genericsg ROM
and i wanted to try J's CM7 beta005. i downloaded his files, saw boot.img and system.img, so i need to just fastboot those two files?
 

Rycon33

Senior Member
Apr 28, 2011
3,217
2,130
Xiaomi Poco F3
Thanks
Tried the beta 006 and it's looping on bootanimation only. Flashing of boot and system image went fine, I wonder what else could be wrong.
So i had flashedback to stock rom again for now.

- Sent from my Sony Arc
 

DooMLoRD

Inactive Recognized Developer
Jul 27, 2010
13,191
39,701
Pune
Thanks
Tried the beta 006 and it's looping on bootanimation only. Flashing of boot and system image went fine, I wonder what else could be wrong.
So i had flashedback to stock rom again for now.

- Sent from my Sony Arc

please post the results of ROM tests in relevant threads so that the DEV of the the rom can track the issues/problem...
 
  • Like
Reactions: Rycon33

Top Liked Posts

  • There are no posts matching your filters.
  • 60
    hey guys since jerpelea has already got the custom kernels working, it will just be a matter of time before we see custom ROMs...

    i am making this thread so as to answer the many questions that users are having on how to get back to stock when testing custom kernels / custom roms...



    [--> WARNING <--]

    PLEASE READ THE COMPLETE POST (1ST & 2ND) BEFORE U DO ANYTHING

    I AM NOT RESPONSIBLE IF UR DEVICE GETS BRICKED BECAUSE U DID NOT READ THE WHOLE THING PROPERLY / U HAD SOME TYPO WHILE EXECUTING THE COMMANDS

    MAKE SURE THAT UR PHONE BATTERY IS FAIRLY CHARGED (> 50%) BEFORE DOING ANY FLASHING AND THAT UR PC HAS A UPS BACKUP (BECAUSE IF FLASHING IS INTERRUPTED THEN IT CAN HAVE SERIOUS CONSEQUENCES)




    [ BEFORE U BEGIN ]


    Requirements:
    1. Flashtool (it is advisable to use latest version)
    2. Fastboot files
    3. Stock Firmware FTF package
    4. [OPTIONAL] PreRooted system.img files
    5. 7zip



    How to use FlashTool:

    FLASHTOOL GUIDE - HOW TO for n00bies
    this was posted in X10 section but is even relevant for Arc/Play/Neo users



    How to use FastBoot:

    [Newbie Guide] adb/fastboot/bootloader/android 101




    [ FLASHING CUSTOM KERNEL/ROM ]


    Flashing Custom Kernel (boot.img):

    1. this WILL NOT WIPE ur data
    2. the custom kernel will be provided as boot.img file
    3. just copy this file to fastboot folder
    4. just power down device and get into FASTBOOT MODE (LED notification turns BLUE) with usb-cable connected to PC
    5. once u are in fastboot mode open command prompt and navigate to the folder containing fastboot files then just use the following command to flash custom kernel:
      Code:
      fastboot flash boot boot.img
    6. once flashing is complete you will get a prompt on pc saying that everything is ok
    7. now just unplug ur device and u are on the custom kernel



    Flashing Custom ROM/SYSTEM (system.img):

    1. this WILL NOT WIPE ur data, it will only wipe ur /system partition
    2. the custom ROM/system will be provided as system.img file
    3. just copy this file to fastboot folder
    4. just power down device and get into FASTBOOT MODE (LED notification turns BLUE) with usb-cable connected to PC
    5. once u are in fastboot mode open command prompt and navigate to the folder containing fastboot files then just use the following command to flash custom ROM/system:
      Code:
      fastboot flash system system.img
    6. once flashing is complete you will get a prompt on pc saying that everything is ok
    7. now just unplug ur device and u on custom rom/system




    [ GET BACK TO STOCK ]


    jerpelea has posted an unbrick (softbrick) package in the FreeXperia project thread... details on how to use it can be found in Post #2 of this thread...


    Following is much more generic information which can be applicable to any FW/ROM/Kernel


    How to get back to Stock Firmware (FW):

    1. this will get u back to COMPLETE STOCK SETTINGS
      • ALL ur data WILL BE WIPED
      • u will get back to stock kernel
      • u will get back to stock ROM/system
      • ur SDCARD data WILL NOT BE affected
    2. you will need stock FTF package
    3. get ur device into FLASH MODE (LED notification turns Green)
    4. use flashtool to flash stock FTF package
    5. for details refer to the above FlashTool guide



    How to get back to Stock Kernel (boot.img / kernel.sin):

    1. this WILL NOT WIPE ur data
    2. using 7zip extract the FTF package to some directory
    3. you will get many files with extension .sin
    4. we are interested in the kernel.sin file, which is the stock kernel
    5. just copy this file to fastboot folder
    6. now for getting back to stock kernel just power down device and get into FASTBOOT MODE (LED notification turns BLUE) with usb-cable connected to PC
    7. once u are in fastboot mode open command prompt and navigate to the folder containing fastboot files then just use the following command to flash stock kernel:
      Code:
      fastboot flash boot kernel.sin
    8. once flashing is complete you will get a prompt on pc saying that everything is ok
    9. now just unplug ur device and u are back to stock kernel



    How to get back to Stock ROM (system.img / system.sin):

    OPTION - 1 : stock unrooted system

    1. this WILL NOT WIPE ur data, it will only wipe ur /system partition
    2. using 7zip extract the FTF package to some directory
    3. you will get many files with extension .sin
    4. we are interested in the system.sin file, which is the stock rom/system
    5. just copy this file to fastboot folder
    6. now for getting back to stock system/ROM just power down device and get into FASTBOOT MODE (LED notification turns BLUE) with usb-cable connected to PC
    7. once u are in fastboot mode open command prompt and navigate to the folder containing fastboot files then just use the following command to flash stock ROM/system:
      Code:
      fastboot flash system system.sin
    8. once flashing is complete you will get a prompt on pc saying that everything is ok
    9. now just unplug ur device and u are back to stock rom/system

    OPTION - 2 : stock PreRooted system

    1. this WILL NOT WIPE ur data, it will only wipe ur /system partition
    2. use the prerooted system.img u downloaded from above links
    3. just copy this file to fastboot folder
    4. now for getting back to stock prerooted system/ROM just power down device and get into FASTBOOT MODE (LED notification turns BLUE) with usb-cable connected to PC
    5. once u are in fastboot mode open command prompt and navigate to the folder containing fastboot files then just use the following command to flash stock ROM/system:
      Code:
      fastboot flash system system.img
    6. once flashing is complete you will get a prompt on pc saying that everything is ok
    7. now just unplug ur device and u are back to stock rom/system




    [ TROUBLESHOOTING ]


    • sometimes u may run into problems after flashing back from custom system.img to stock system.img, like apps & core system crashes/force closes
    • if u face such problems then it is advisable to WIPE ur /data parition
    • this WILL WIPE ur data (apps, settings), ur SDCARD DATA WONT BE AFFECTED
    • just power down device and get into FASTBOOT MODE (LED notification turns BLUE) with usb-cable connected to PC
    • once u are in fastboot mode open command prompt and navigate to the folder containing fastboot files then just use the following command to wipe /data partition:
      Code:
      fastboot erase userdata
    • once flashing is complete you will get a prompt on pc saying that everything is ok
    • now just unplug ur device and the problems should be sorted out
    • if u still are facing problems just flash back to Stock Firmware using FLASHTOOL




    [ FINAL THOUGHTS ]


    I hope this answers most of ur questions...

    in case of specific queries about flashtool/fastboot or prerooted images ask in THOSE SPECIFIC threads... if u have any queries other than that [RELATED TO THIS THREAD ;) ] u can post ur questions here...



    PLEASE DONT FILL UP DEV THREADS WILL REDUNDANT QUESTIONS
    14
    jerpelea has posted an unbrick (softbrick) package in the FreeXperia project thread...

    here is how to use it to get back to stock!


    Requirements:
    1. Fastboot drivers already installed
    2. unbrick (softbrick) package
    3. 7zip


    How to get back to Stock Kernel & system:

    1. this WILL WIPE ur data
    2. using 7zip extract the unbrick (softbrick) package to some directory
    3. now for getting back to stock kernel & ROM just power down device and get into FASTBOOT MODE (LED notification turns BLUE) with usb-cable connected to PC
    4. once u are in fastboot mode just browse to the folder where u extracted the unbrick package double click on restoreme.cmd
    5. once flashing is complete you will get a prompt on pc saying that everything is ok (or the command prompt window might just close in some time dont worry its expected)
    6. ur device will now restart automatically
    7. now just unplug ur device and u are back to stock kernel & ROM
    1
    Nice thread Mate ... I'm sure this be most useful :)
    1
    i just saw that jerpelea has posted an unbrick (softbrick) package...

    i am downloading it now and will updated the info as per the files present in that package...


    EDIT:

    how to updated...
    info on how to use the package updated in 2nd post
    1
    Thanks for the guide!

    I'm just wondering. In X10's XRecovery, there is a Backup and a Restore function. The Backup function practically saves the entire ROM including data. One can then proceed to flash custom ROMs/kernels. In the event that we want to revert back to the original ROM including data, we just have to use the Restore function.

    Does any of the above methods achieve the same result?

    those are called NANDROID backups can be created using working RECOVERY...

    no the above methods can ONLY WRITE to device... they cant take backups...