How to root Nexus S with Ice Cream Sandwich (ICS)
Jump to navigation
Jump to search
<google>ENGELSK</google>
How to root Nexus S with Ice Cream Sandwich (ICS) manually
First get a backup of your existing boot image
- You can download ClockWorkMod from here:
- 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:
- >fastboot.exe devices
- Boot your phone with fastboot and the ClockworkMod image on a PC.
- >fastboot.exe boot recovery-clockwork-5.0.2.0-crespo.img
- Make a backup to the of the phone with ClockworkMod
- - backup and restore
- - backup
- Boot your phone to Android again, and copy the ClockworkMod backup to your PC.
- It is loccated in \clockworkmod\backup...
- Locate boot.img in the backup and put it in an empty folder on an Ubunto system
On Ubunto
- Download split_bootimg.pl
- Download The superuser app from here: androisu.com
- copy split_bootimg.pl and mkbootimg to the same folder
- $ chmod +x split_bootimg.pl
- $ chmod +x mkbootimg
- $ ./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
- Now you have
- boot.img-kernel
- boot.img-ramdisk.gz
- $ gzip -d boot.img-ramdisk.gz (extract the ramdisk)
- $ mkdir tmp
- $ cd tmp
- $ cpio -i -F ../boot.img-ramdisk (extract the ramdisk in the tmp folder to have a clean environment)
- 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
- Save the file and quit
- $ mkdir superboot
- Create the files:
- superboot/superboot/su
- superboot/su
- superboot/superboot.sh
- superboot/Superuser.apk
- $ find . | cpio -o -H newc | gzip > ../newramdisk.gz
- $ cd ..
- $ ./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:
- > adb shell
- 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
- Get Android source code: http://source.android.com/source/downloading.html
- $ cd /path/to/android-src
- $ cd system/core/libmincrypt/
- $ gcc -c *.c -I../include
- $ ar rcs libmincrypt.a *.o
- $ cd ../mkbootimg
- $ gcc mkbootimg.c -o mkbootimg -I../include ../libmincrypt/libmincrypt.a
- $ cd ../cpio
- $ 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
- AndroidSU.com - The Superuser app for Android's homepage
- The Android boot process from power on
- ClockworkMod Homepage
- ClockworkMod Android Market
- HOWTO: Unpack, Edit, and Re-Pack Boot Images
- How-To: compile the Nexus S kernel from source
- Romdump (So you've decided to
steal cabledump your ROM)
<google>ENGELSK</google>