How to root Nexus S with Ice Cream Sandwich (ICS): Difference between revisions

From Yggenyk
Jump to navigation Jump to search
No edit summary
Line 5: Line 5:


===How to root Nexus S with Ice Cream Sandwich (ICS) manually===
===How to root Nexus S with Ice Cream Sandwich (ICS) manually===
* [http://android-dls.com/wiki/index.php?title=Fastboot Fastboot]
* [http://wiki.cyanogenmod.com/wiki/Fastboot Fastboot and partition layout]


=====First get a backup of your existing boot image=====
=====First get a backup of your existing boot image=====
Line 106: Line 104:
#:* [http://android.modaco.com/topic/344834-guide-how-to-create-your-own-superbootimg/ Guide - How to create your own superboot.img Or how to root your phone :)]
#:* [http://android.modaco.com/topic/344834-guide-how-to-create-your-own-superbootimg/ Guide - How to create your own superboot.img Or how to root your phone :)]


=====Additional links=====
====Additional links====
=====Faseboot=====
* [http://android-dls.com/wiki/index.php?title=Fastboot Fastboot]
* [http://wiki.cyanogenmod.com/wiki/Fastboot Fastboot and partition layout]
 
 
* [http://androidsu.com/ AndroidSU.com - The Superuser app for Android's homepage]
* [http://androidsu.com/ AndroidSU.com - The Superuser app for Android's homepage]
* [http://www.androidenea.com/2009/06/android-boot-process-from-power-on.html The Android boot process from power on]
* [http://www.androidenea.com/2009/06/android-boot-process-from-power-on.html The Android boot process from power on]

Revision as of 07:06, 29 May 2012

<google>ENGELSK</google>

How to root Nexus S with Ice Cream Sandwich (ICS) manually

First get a backup of your existing boot image
  1. You can download ClockWorkMod from here:
  2. Power the Nexus S down, and hold Volume Up & the Power button until booted into the bootloader
  3. Verify your phone is connected with yout PC:
    >fastboot.exe devices
  4. Boot your phone with fastboot and the ClockworkMod image on a PC.
    >fastboot.exe boot recovery-clockwork-5.0.2.0-crespo.img
  5. Make a backup to the of the phone with ClockworkMod
    - backup and restore
    - Backup
  6. Boot your phone to Android again, and copy the ClockworkMod backup to your PC.
    It is loccated in \clockworkmod\backup...
  7. Locate boot.img in the backup and put it in an empty folder on an Ubunto system
On Ubunto
  1. Download split_bootimg.pl
  2. Download The superuser app from here: androisu.com
  3. copy split_bootimg.pl and mkbootimg to the same folder
  4. $ chmod +x split_bootimg.pl
  5. $ chmod +x mkbootimg
  6. $ ./split_bootimg.pl boot.img
    Page size: 4096 (0x00001000)
    Kernel size: 2858444 (0x002b9dcc)
    Ramdisk size: 143086 (0x00022eee)
    Second size: 0 (0x00000000)
    Board name:
    Command line: console=ttyFIQ0 no_console_suspend
    Writing boot.img-kernel ... complete.
    Writing boot.img-ramdisk.gz ... complete
  7. Now you have
    boot.img-kernel
    boot.img-ramdisk.gz
  8. $ gzip -d boot.img-ramdisk.gz (extract the ramdisk)
  9. $ mkdir tmp
  10. $ cd tmp
  11. $ cpio -i -F ../boot.img-ramdisk (extract the ramdisk in the tmp folder to have a clean environment)
  12. Edit the file init.rc and find the line ## Daemon processes to be run by init.
    After the second ##
    Insert the folowing four lines:
    service superboot /system/bin/sh /superboot/superboot.sh
    class main
    user root
    group root
    oneshot
  13. Save the file and quit
  14. $ mkdir superboot
  15. Create the files:
    superboot/superboot/su
    superboot/su
    superboot/superboot.sh
    superboot/Superuser.apk
    $ find . | cpio -o -H newc | gzip > ../newramdisk.gz
  16. $ cd ..
  17. $ ./mkbootimg --kernel boot.img-kernel --ramdisk newramdisk.gz --cmdline 'console=ttyFIQ0 no_console_suspend' --base 0x30000000 --pagesize 4096 --output newboot.img

Content of superboot.sh should be:

mount -o rw,remount -t ext4 /dev/block/platform/s3c-sdhci.0/by-name/system /system
rm /system/bin/su
rm /system/xbin/su
mkdir /system/xbin
cat /superboot/su>/system/xbin/su
chmod 6755 /system/xbin/su
cat /superboot/Superuser.apk>/system/app/Superuser.apk
mount -o ro,remount -t ext4 /dev/block/platform/s3c-sdhci.0/by-name/system /system
Flash the new image to your phone

On Windows:

  1. Verify it works before flashing
    >fastboot.exe boot newboot.img
  1. Flash image
    >fastboot.exe flash boot newboot.img
    >fastboot.exe reboot

Additional information

How to compile mkbootimg
  1. Get Android source code: http://source.android.com/source/downloading.html
  2. $ cd /path/to/android-src
  3. $ cd system/core/libmincrypt/
  4. $ gcc -c *.c -I../include
  5. $ ar rcs libmincrypt.a *.o
  6. $ cd ../mkbootimg
  7. $ gcc mkbootimg.c -o mkbootimg -I../include ../libmincrypt/libmincrypt.a
  8. $ cd ../cpio
  9. $ gcc mkbootfs.c -o mkbootfs -I../include
Commandline parameters

cpio command line parameters

copy system/core/mkbootimg/mkbootimg, system/core/cpio/mkbootfs to a directory in your path. location: tools/mkbootimg/mkbootimg.c


Additional links

Faseboot


<google>ENGELSK</google>

id=siteTree