[Samsung Galaxy Mini] Doc_cheilvenerdi.org:
[DEV] Increase Internal Memory Size to Whatever You Want!

RAMDISK - SECOND ROUND

I restart from the boot_mod folder:

doc@gandalf ~/boot_mod $

I need to put into the ramdisk the script that mounts the SD /data filesystem init.data.sh and the binary busybox.

First I download them into the working directory and then I copy them in the right place with the right permissions:

doc@gandalf ~/boot_mod $ cp init.data.sh ramdisk/
doc@gandalf ~/boot_mod $ chmod 0750 ramdisk/init.data.sh
doc@gandalf ~/boot_mod $ cp busybox ramdisk/sbin/
doc@gandalf ~/boot_mod $

Now I patch the real init.rc script using this diff file init.rc.patch with this command:

doc@gandalf ~/boot_mod $ patch ramdisk/init.rc -i init.rc.patch
patching file ramdisk/init.rc
doc@gandalf ~/boot_mod $

Notice: take care of any warning here; if they occurr the modded boot image could not work properly

KERNEL MODULES - SECOND RUN

Now I'm going to discover the Local Version for the XXKPF kernel:

Option 1: Command for Linux distribution without "sudo" binary (Gentoo, Debian, ...):

doc@gandalf ~/boot_mod $ su -c 'modinfo ramdisk/lib/modules/fsr.ko' | grep vermagic
Password: [i](linux root password asked)[/i]

vermagic: 2.6.35.7[b]-perf-CL189639[/b] preempt mod_unload ARMv6
doc@gandalf ~/boot_mod $

Option 2: Command for Linux distribution with "sudo" binary (Ubuntu, ...):

doc@gandalf ~/boot_mod $ sudo modinfo ramdisk/lib/modules/fsr.ko | grep vermagic
[sudo] Password for doc: [i](linux user password asked)[/i]

vermagic: 2.6.35.7[b]-perf-CL189639[/b] preempt mod_unload ARMv6
doc@gandalf ~/boot_mod $

Now I'll compile the kernel modules (see previous post for details) setting these options in the kernel menu:

General Setup
[+] Prompt for development and/or incomplete code/drivers
() Cross-compiler tool prefix
([b]-perf-CL189639[/b]) Local version - append to kernel release
[ ] ...
...

File systems
[b]<M>[/b] The Extended 4 (ext4) filesystem
[b][ ][/b] Use ext4 for ext2/ext3 file systems [color=red]<- This must be UNSELECTED![/color]
[+] Ext4 extended attributes (NEW)
[ ] Ext4 POSIX Access Control Lists (NEW)
[ ] Ext4 Security Labels (NEW)
[ ] EXT4 debugging support (NEW)
[ ] JBD2 (ext4) debugging support (NEW)
...

Beware that you need to unselect some options!

I build the modules and put them in the right place inside the ramdisk:

doc@gandalf ~/boot_mod/kernel $ make modules

...

...

LD [M] fs/ext4/ext4.ko

...

LD [M] fs/jbd2/jbd2.ko

...

doc@gandalf ~/boot_mod/kernel $

doc@gandalf ~/boot_mod/kernel $ cd ..
doc@gandalf ~/boot_mod $ cp kernel/fs/jbd2/jbd2.ko ramdisk/lib/modules/
doc@gandalf ~/boot_mod $ cp kernel/fs/ext4/ext4.ko ramdisk/lib/modules/
doc@gandalf ~/boot_mod $

After that i reduce the size of all the modules in the ramdisk (also the proprietary ones):

doc@gandalf ~/boot_mod $ /home/doc/builds/WORKING_DIRECTORY/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-strip --strip-unneeded ramdisk/lib/modules/*.ko
doc@gandalf ~/boot_mod $

RAMDISK - THE ROOT SIDE

Now I need to issue several commands as "linux root superuser" (mandatory):

(Notice: I'll show only the "su -c" option, while "sudo" one is quite similar...)

doc@gandalf ~/boot_mod $ su -c 'chown -R root:root ramdisk'
doc@gandalf ~/boot_mod $ su -c 'chmod 04755 ramdisk/sbin/busybox'
doc@gandalf ~/boot_mod $ cd ramdisk/
doc@gandalf ~/boot_mod/ramdisk $ su -c 'find . | cpio -o -H newc | gzip > ../boot.img-ramdisk.gz'
7978 blocks
doc@gandalf ~/boot_mod $ cd ..
doc@gandalf ~/boot_mod $ su -c 'chown -R doc:doc ramdisk'
doc@gandalf ~/boot_mod $ su -c 'chown doc:doc boot.img-ramdisk.gz'

BOOT.IMG - THE END

Last, I repack the modded boot image:

doc@gandalf ~/boot_mod $ ./mkbootimg --kernel boot.img-kernel --ramdisk boot.img-ramdisk.gz --base 0x13600000 --pagesize 4096 -o boot.img
doc@gandalf ~/boot_mod $ ls -l
...
-rw-r--r-- 1 doc doc [b]5431296[/b] Jan 31 22:27 boot.img
...
doc@gandalf ~/boot_mod $

I must check that the size of the new image is smaller then 8,0 Megabytes otherwise I could get in trouble while flashing with Odin...

...and finally, after deleting the previous CODE_S5570XXKPF_boot.tar.md5 archive, i make the "Odin Ready" Wanted Archive:

doc@gandalf ~/boot_mod $ tar -H ustar -c boot.img > CODE_S5570XXKPF_boot.tar
doc@gandalf ~/boot_mod $ md5sum CODE_S5570XXKPF_boot.tar >> CODE_S5570XXKPF_boot.tar
doc@gandalf ~/boot_mod $ mv CODE_S5570XXKPF_boot.tar CODE_S5570XXKPF_boot.tar.md5
doc@gandalf ~/boot_mod $

THAT'S ALL! :cool:

Now I only need to test the XXKPF modded boot image on my phone and then I'll share it on the first post of this thread!