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

From Yggenyk
Jump to navigation Jump to search
No edit summary
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[Category:English pages]]
{{Android}}
[[Category:Mobiltelefoni]]
[[Category:Software development]]
<google>ENGELSK</google>
<google>ENGELSK</google>


Line 8: Line 6:
=====First get a backup of your existing boot image=====
=====First get a backup of your existing boot image=====
#: You can download ClockWorkMod from here:
#: You can download ClockWorkMod from here:
#:* [http://www.koushikdutta.com/2010/02/clockwork-recovery-image.html ROM Manager and Clockwork Recovery Image]
#:* [http://www.clockworkmod.com/rommanager/ ROM Manager and Clockwork Recovery Image]
#Power the Nexus S down, and hold Volume Up & the Power button until booted into the bootloader
#Power the Nexus S down, and hold Volume Up & the Power button until booted into the bootloader
# Verify your phone is connected with yout PC:
# Verify your phone is connected with yout PC:
Line 16: Line 14:
# Make a backup to the of the phone with ClockworkMod
# Make a backup to the of the phone with ClockworkMod
#: '''- backup and restore'''
#: '''- backup and restore'''
#: '''- Backup'''
#: '''- backup'''
# Boot your phone to Android again, and copy the ClockworkMod backup to your PC.
# Boot your phone to Android again, and copy the ClockworkMod backup to your PC.
#: It is loccated in '''\clockworkmod\backup...'''
#: It is loccated in '''\clockworkmod\backup...'''
Line 58: Line 56:
#: superboot/superboot.sh
#: superboot/superboot.sh
#: superboot/Superuser.apk
#: superboot/Superuser.apk
#: $ '''find . | cpio -o -H newc | gzip > ../newramdisk.gz'''
# $ '''find . | cpio -o -H newc | gzip > ../newramdisk.gz'''
# $ '''cd ..'''
# $ '''cd ..'''
# $ '''./mkbootimg --kernel boot.img-kernel --ramdisk newramdisk.gz --cmdline 'console=ttyFIQ0 no_console_suspend' --base 0x30000000 --pagesize 4096 --output newboot.img'''
# $ '''./mkbootimg --kernel boot.img-kernel --ramdisk newramdisk.gz --cmdline 'console=ttyFIQ0 no_console_suspend' --base 0x30000000 --pagesize 4096 --output newboot.img'''
Line 80: Line 78:
On Windows:
On Windows:


# Verify it works before flashing
Verify it works before flashing
#: >'''fastboot.exe boot newboot.img'''
: >'''fastboot.exe boot newboot.img'''


# Flash image
Flash image
#: >'''fastboot.exe flash boot newboot.img'''
: >'''fastboot.exe flash boot newboot.img'''
#: >'''fastboot.exe reboot'''
: >'''fastboot.exe reboot'''


====Additional information====
====Additional information====
Line 99: Line 97:
# $ '''cd ../cpio'''
# $ '''cd ../cpio'''
# $ '''gcc mkbootfs.c  -o mkbootfs -I../include'''
# $ '''gcc mkbootfs.c  -o mkbootfs -I../include'''
=====Commandline parameters=====
[http://www.gnu.org/software/cpio/manual/cpio.html '''cpio''' command line parameters]


copy system/core/mkbootimg/mkbootimg, system/core/cpio/mkbootfs to a directory in your path.
copy system/core/mkbootimg/mkbootimg, system/core/cpio/mkbootfs to a directory in your path.
Line 107: Line 102:




#:* [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=====
=====Fastboot=====
* [http://android-dls.com/wiki/index.php?title=Fastboot Fastboot]
* [http://android-dls.com/wiki/index.php?title=Fastboot Fastboot]
* [http://wiki.cyanogenmod.com/wiki/Fastboot Fastboot and partition layout]
* [http://wiki.cyanogenmod.com/wiki/Fastboot Fastboot and partition layout]
=====Commandline parameters=====
[http://www.gnu.org/software/cpio/manual/cpio.html '''cpio''' command line parameters]





Latest revision as of 12:58, 7 December 2016

<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
  16. $ find . | cpio -o -H newc | gzip > ../newramdisk.gz
  17. $ cd ..
  18. $ ./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

To verify that ext4 /dev/block/platform/s3c-sdhci.0/by-name/system is the right filesystem on future versions of Android you can type:

  1. > adb shell
  2. shell@android:/ $ mount

This will show a list of al all filesystems on your phone.

Flash the new image to your phone

On Windows:

Verify it works before flashing

>fastboot.exe boot newboot.img

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

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


Additional links

Fastboot
Commandline parameters

cpio command line parameters


<google>ENGELSK</google>

id=siteTree