[Galaxy Ace S5830i General] axyllum:
Hi folks,

On my way trying to get 10 usefull posts to access the developers forums, I have writen this easy tutorial. xD

THIS IS FOR S5830i DEVICES. init.rc used belongs to S5830i ramdisk

Whats all about? Well, in this tutorial I will so you how to get root access directly from Kernel only modifing init.rc and adding su to tmp folder.

THIS IS NOT UNSECURING THE BOOT.IMG TUTORIAL

Question: Axyllum why are you posting this, if there are so many tutorials on how to do this for other devices?

Answer: Simple, as you all ready imagine, partition for boot.img is just 5MB Oh my god.

Then, if my boot image is all ready 4.28MB, how can I use a busybox thats 836KB (I compiled a busybox with mount, cp, mkdir, chmod and chown that is the minimum to get root: image = 836MB). Cant use this beacuse I exceed total mounting point size.

Kernel + ramdisk = 4.28MB if you pull stock boot.img from your device.

Minimum busybox explained before = 836KB

SU image 25KB to 86KB depending on the su image you use.

This makes a total of: 5.2MB. Try to flash it. It fails? Yes, you exceeded the mounting point size.

And the solution? Follow my tutorial.

Abilites you will need to follow the turotrial:

Know how to: Un pack & repack boot.img

Know how to: Decompress Ramdisk and compress it back. (to get the famous newramdisk in many many tutorials) newramdisk is just a name, you can compress back to any name, for example axyllumramdisk or yourramdisk or how ever you want to call it.

Asuming you know how to do the explained above and after my wierd chat, lets gooooo:

1. Open init.rc in your favourite text editor.

2. Go to this line in init.rc:

mount rfs /dev/stl9 /system check=no

You should see this:

mount rfs /dev/stl9 /system check=no

mount rfs /dev/stl9 /system ro remount

Got it? lets go to step 3.

3. Overwrite both lines with this:

mount rfs /dev/stl9 /system check=no

mkdir /system/xbin

copy /tmp/su /system/xbin/su

chown root root /system/xbin/su

chmod 06755 /system/xbin/su

mount rfs /dev/stl9 /system ro remount

Make sure you are not overwriting other lines or your ramdisk could not work.

4. Paste SU image file to tmp folder. Make sure SU image has execute permissions.

5. Compress back ramdisk (the famous newramdisk).

6. Repack boot.img

7. Flash it.

8. Restart device.

9. Download superuser.apk and busybox form market and.... there you go you made your kernel with root access and no need of a busybox.

Ok, this was simple, but i imagine more than one will like to know what we did.

I'll explain:

As we cant add a busybox, how the hell am i going to mount system rw, mkdir xbin, cp su from tmp to xbin, chmod / chown permissions?

I started reading the init.rc file (i was bored and my wife wanted to go shopping --> no way i have an init.rc file to mess up with), and I saw many mkdir, copy, chmod etc... commands. (Opened a beer)

So i thought, great, there is all ready a busybox with the least i need to make this. Then why dont i use this preinstalled commands?

And i did this:

mount rfs /dev/stl9 /system check=no --> first I checked this, this instruction is where init.rc mounts system. At this point system is mounted RW.

mkdir /system/xbin --> Then as system is rw, I will create xbin folder. how? with mkdir comand.

copy /tmp/su /system/xbin/su --> Great I did not find a cp command, but found a "copy" command someware in init.rc. Search for it, you will see its used. Then why dont I use it to copy SU in tmp folder to the just created xbin folder? It worked.

chown root root /system/xbin/su --> Owner of su in xbin is: yes, root.

chmod 06755 /system/xbin/su --> Set the right permission to su. You need to chmod with 06755. --> 09364, 66666, 83823 will not work looooolll just a joke i imagine you all ready know what setting permissions is all about.

mount rfs /dev/stl9 /system ro remount --> Remount system with ro (this is the read only remount command).

I dont know if there are any other tutorials doing this, this way, i just did it my self. I Found tutorials on doing the same, but busybox, and .sh script and su were needed. To much for our small boot.img partition.

Enjoy.

Tip, dont mess your init.rc if you do not understand it.