[HACK] Increase Internal Memory Size to Whatever You Want!

Search This thread

Krishna parmar

Senior Member
Oct 31, 2011
96
3
mumbai
one question bro how you edit the boot image

Free Memory to > 1Gb!

How to Increase your Internal Memory Size with very low effort!

NOTICE: This method works both on Rooted and NOT Rooted Phones!

You simply need to meet three easy requirements:

  • Stock Firmware installed on the Phone (custom ROMS not supported ...They don't need to!)
  • A microSD with two primary formatted partitions inside (the former 'to FAT32' and the latter 'to EXT4' filesystems)
  • Ready to Flash to your Galaxy Next via Odin


NOTICE: The following Black Box Howto is explained deep inside in the next post of this Thread (short explanation) and in This Thread from outside: Internal Memory to +1Gb! and related ones (long explanation / Italian Language)




HOW TO

1) Download Tass.ops file for Odin!


2) Type this number on your phone keyboard:

*#1234#

and keep note of the PDA code of the Firmware installed.



3) Download boot image ready for Odin and suitable for your firmware:

Your firmware is not listed? ...let me know, I'll give it a try!


4) Flash the downloaded archive with Odin

Example image follows:

Odin1.png



5) THAT'S ALL FOLKS!


- - -​


How does it Work:


Scenario 1:
I switch on the Phone, without a MicroSD slotted in or with a microSD with a single FAT32 partition (broken or damaged microSD also suite this scenario...); GingerBread boots as usual!
No Difference!


Scenario 2:
I switch on The Phone with a microSD slotted in (with the second partition formatted as EXT4 filesystem but still EMPTY); Ginger boots acting as if

/data

is completely moved outside to microSD but just WIPED (not true obviously, and the original /data is safe inside the phone), so it resettle it from beginning...

NOTICE:
...If your second partition is 1Gb wide...
...your new Internal Memory will be 1Gb wide...


Scenario 3:
I switch on the Phone with the second partition of the microsd (EXT4) up and running (already resettled up for use and with my userdata on it); Ginger simply boots with

/data

moved outside to microSD with your userdata there and tons of apps just installed from the market...

Example Image of my New Internal Memory Size follows

gestione_english.png



- - -​


NOTICES & ADVICES:

  • If I want to remove the microSD from the slot, FIRST I NEED TO SWITCH OFF THE PHONE!
  • When I install apps from the Market, Ginger Misunderstands the actual new Internal Memory SIZE and puts the apk files to External Storage anyway! I simply need to move them "to the phone" via "Settings menu" immediately after!
  • When I switch on the Phone without the microSD, I boot using the original /data inside the phone, actually loosing all the apps installed onto the external one untill next boot with SDcard; and, of course, loosing my sms stored there and others personal userdata too.
  • Unfortunately this boot image heavy conflicts with Link2SD (great app anyway!), so you must choose one: This Boot image or Link2SD... not both... sorry!


Don't You Like the boot image just installed and You want to revert without flashing the full firmware to the Phone?
Here are the original images ready for Odin:

i want to know so i can do for other phones
please tell me the editor software..and other needed info
and pm me plz
 

Doc_cheilvenerdi.org

Senior Member
Oct 11, 2011
127
349
Ferrara - Ravenna
Ext4 Checkup tool (version 1.0 RC3)!

OFF TOPIC!

Hei, wow... here is my first Android Application!

SC1.png


...just a wrapper to the e2fsck shell tool used to check - once a month - the second partition ext4 filesystem for errors...

SC2.png




>>>ONLY ROOTED PHONES <<<


HOW DOES IT WORK:

  • I power off the phone, pull out the SD card and power on the phone to start using the true internal memory;
  • I insert the SD card in the slot;
  • (first time) I install the application (using adb or from the SDcard, for example);
  • I run the application, which will check for a "Doc modded" boot image and several other requirements (rooted phone, busybox, and so on...);
  • I push the check button to check the ext4 filesystem for errors;
  • Optional: I read the Log file of the operation;
  • I reboot the phone to use again the clean pumped-up internal memory!
  • I'll repeat this operation once a month...


This is the signed application: EXT4 Checkup.apk

(I'm not a developer so I don't have a market developer account)

and here is the source code packaged for eclipse IDE (indigo version): EXT4_Checkup-1.0-RC3.tar.gz


WARNINGS: I'm not a true developer nor a java skilled one, so you could find "poor programming practice" inside the source code and even occurr in bugs not yet discovered... so you should use it AT YOUR OWN RISK...


Actually the application works fine...I'm only dealing with a timing bug (not solved but workarounded for now) on first time run: while asking for root permissions it fails the check for a "Doc modded" boot image... so I simply need to run it again soon after...


Why did I write this application?
In post n. 33 I explained how to check the 2nd partition filesystem from adb, but I feel that it's not a "user friendly" way to do it... so here there is an easier one... :)

Finally, on first run you should read the HowTo on the phone:

>> ONLY ROOTED PHONES <<

These application is strictly related to the boot images modded from Doc for the galaxy NEXT/MINI/POP and the galaxy FIT...

While running the smartphone with the internal memory "expanded" and completely moved to the second partition of the SD Card there isn't the possibility to check the ext4 filesystem for safety in "an easy way"...

This application just does the filesystem checkup "dirty job" with minimal user interaction...

HOW TO:

This application MUST BE INSTALLED in the "TRUE" internal memory! So you need to power on the phone, without the SD Card slotted in, to do it!

Once installed, every time you want to check the ext4 2nd partition filesystem, simply:

- Power off the phone
- Pull out the microSD
- Power on the phone
- push in the microSD
- wait for media scan
- launch this app
- push the "check" button

That's all!

Now you can check what's happened reading the Log from menu or simply reboot, with SD slotted in, to revert to the "pumped-up" internal memory!

NOTICE: I'm not a true developer nor a "java" skilled one... I simply assembled snippets of code from the web and followed android tutorials and guides, figuring out how to set this application up and running (of course I know what we are talking about... lucky but not so much, eh eh!)...

It's shared "AS IS" with the source package attached, suitable for eclipse IDE (indigo version)... use it at

YOUR OWN RISK

and feel free to change its code to suite your needs as you wish.

How does it Works:

On start it checks if the phone is rooted and busyboxed, then it looks for the Doc modded boot image, checking that you just booted using the "true" internal memory.
After that, it copies the "e2fsck" tool command cross-compiled from "Linux" to "Arm" to the filesystem and waits for the user to push the start button.
Finally it checks silently the 2nd partition filesystem for errors, eventually repairing them and logging everything for later human readings...


CREDITS:
Everybody who will use this application!
Everybody who will improve this java code!


CHANGELOG:
Version 1.0 RC3
- upgraded "e2fsck" binary from 1.42 to 1.42.1

Version 1.0 RC2
- fully rewritten "SuperUser Engine"
- fixed mayor bugs
 
Last edited:
  • Like
Reactions: BOStaurus

lonestrider

Senior Member
Mar 6, 2011
515
86
If I flash the hacked boot image then I install a Custom ROM, will it still works?
Is the Tass.ops different with the original?

If I use your hacked boot image, will my application be erased?
 
Last edited:

kitrax59

Senior Member
Dec 11, 2011
1,500
735
If I flash the hacked boot image then I install a Custom ROM, will it still works?
Is the Tass.ops different with the original?

If I use your hacked boot image, will my application be erased?
You should read the first page. It does not support custom ROMs:

You simply need to meet three easy requirements:
Stock Firmware installed on the Phone (custom ROMS not supported ...They don't need to!)

:D
 

lonestrider

Senior Member
Mar 6, 2011
515
86
You should read the first page. It does not support custom ROMs:

You simply need to meet three easy requirements:
Stock Firmware installed on the Phone (custom ROMS not supported ...They don't need to!)

:D

Sorry, I just realized about it.

What about the applications? will my apps be gone after I try this boot image?
 

Krishna parmar

Senior Member
Oct 31, 2011
96
3
mumbai
Arre guys plz tell what software do I use to make this possible on other cells
Plz doc tell me the software our the methods you duds this .... I want to do for fit ...
Software name please to edit boot.img

Sent from my GT-S5570 using xda premium
 

Doc_cheilvenerdi.org

Senior Member
Oct 11, 2011
127
349
Ferrara - Ravenna
[DEV] Increase Internal Memory to Whatever You Want!

HOW I DID IT... The Source...


mission_accomplished.png



In this post, and few others, I'm going to explain "step by step", "tool by tool" and "code by code" exactly what I do to tweak a boot image for my Galaxy Mini!


Let's follow together an example: I'm going to tweak the boot image of the 2.3.3 XXKPF Stock ROM.
While downloading it from samfirmware, I set up a minimal working environment.

From here on I'll use a PC with a Linux Gentoo Amd64 No Multilib Chroot32 unstable OS, but everything works with any other distribution (ubuntu, debian, opensuse, etc...). Actually Linux is mandatory for me (on Windows you could try to set up a cygwin environment).

I'll do all the job in a system folder called boot_mod, typing all the commands from the console (...or terminal):
Code:
doc@gandalf ~/boot_mod $

Once downloaded the XXKPF firmware (which is multipackage) I unrar the CODE archive to this folder and extract from it the boot image:
Code:
doc@gandalf ~/boot_mod $ tar xf CODE_S5570XXKPF_CL189639_REV02_user_mid_true.tar.md5 boot.img
doc@gandalf ~/boot_mod $ ls -l
total 212864
-rw-r--r-- 1 doc doc 211589203 Jan 31 09:39 CODE_S5570XXKPF_CL189639_REV02_user_mid_true.tar.md5
-rw-r--r-- 1 doc doc   6377472 May  7  2011 [b]boot.img[/b]
doc@gandalf ~/boot_mod $


BACKUP
First af all I prepare the Odin Archive of the original boot image, just to share it later: CODE_S5570XXKPF_boot.tar.md5.
Code:
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 $ ls -l
...
-rw-r--r-- 1 doc doc   6379579 Jan 31 09:51 CODE_S5570XXKPF_boot.tar.md5
...
doc@gandalf ~/boot_mod $
I prepare it just to restore back from the modded image, without flashing the full firmware from scratch.


SPLIT
Now, using this perl script split_bootimg.pl (downloaded into this folder too... Thanks to William Enck for it) I split the boot image into its components, the kernel and the initial ramdisk.
Code:
doc@gandalf ~/boot_mod $ ./split_bootimg.pl boot.img 
Page size: [b]4096[/b] (0x00001000)
Kernel size: 3221952 (0x003129c0)
Ramdisk size: 3146572 (0x0030034c)
Second size: 0 (0x00000000)
Board name: 
Command line: 
Writing boot.img-kernel ... complete.
Writing boot.img-ramdisk.gz ... complete.
doc@gandalf ~/boot_mod $ ls -l
...
-rw-r--r-- 1 doc doc 6377472 May  7  2011 boot.img
-rw-r--r-- 1 doc doc 3221952 Jan 31 09:56 boot.img-kernel
-rw-r--r-- 1 doc doc 3146572 Jan 31 09:56 boot.img-ramdisk.gz
-rw[b]x[/b]r-[b]x[/b]r-[b]x[/b] 1 doc doc    6121 Jan 31 09:44 split_bootimg.pl
...
doc@gandalf ~/boot_mod $
Notice: The perl script must be set executable with the chmod command...


I look at the output for Page size (bold 4096) because I'll need it later to complete the task.

I actually miss a number that I must read from the boot.img binary.
I'll read it with an hexadecimal editor:
Code:
doc@gandalf ~/boot_mod $ hexedit boot.img
...
00000000   41 4E 44 52  4F 49 44 21  C0 29 31 00  00 80 60 13  ANDROID!.)1...`.
00000010   4C 03 30 00  00 00 60 14  00 00 00 00  00 00 50 14  L.0...`.......P.
00000020   00 01 [color=blue][b]60[/b][/color] [color=red][b]13[/b][/color]  00 10 00 00  00 00 00 00  00 00 00 00  ..`.............
00000030   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ................
...
doc@gandalf ~/boot_mod $

I show the first 64 bytes of the file while I need only the bolded and coloured ones...
I read them this way:
Code:
base address = 0x[color=red][b]13[/b][/color][color=blue][b]60[/b][/color]0000

Anyway I need to check for this only once for any Phone model (I feel that this number will be the same for all these samsung phone models too...).

Before Starting the Real Task I must be sure that I'm able to put back toghether the splitted parts of the boot image...

To do it I need to compile a relevant tool from the AOSP Source Code: mkbootimg. Here is my one for 32bit Linux distributions: mkbootimg.
I download it into the working folder too and set it executable with chmod command...
Code:
doc@gandalf ~/boot_mod $ ./mkbootimg --kernel boot.img-kernel --ramdisk boot.img-ramdisk.gz --base 0x13600000 --pagesize 4096 -o boot_COPY.img
doc@gandalf ~/boot_mod $
I used the numbers just discovered... eh eh...

Now I'll check the original image and the selfmade one looking for differences... If they differ DON'T GO AHEAD!!! The modded boot image will never work!
Code:
doc@gandalf ~/boot_mod $ diff boot.img boot_COPY.img 
doc@gandalf ~/boot_mod $
If I don't read something like Binary files ... differ everything works... I CAN CREATE boot images on my own!


RAMDISK - FIRST ROUND
Now I create a subfolder where I'll store the initial ramdisk contents:
Code:
doc@gandalf ~/boot_mod $ mkdir ramdisk
doc@gandalf ~/boot_mod $ [b]cd[/b] ramdisk
doc@gandalf ~/boot_mod/ramdisk $ gunzip -c ../boot.img-ramdisk.gz | cpio -i
14299 blocks
doc@gandalf ~/boot_mod/ramdisk $

Notice: Mostly I'll work within tha ramdisk subfolder... the following commands must run from there to work!

And here it is! The ramdisk Folder opened:
Code:
doc@gandalf ~/boot_mod/ramdisk $ ls -l
total 744
-rw-r--r-- 1 doc doc  13444 Jan 31 10:17 TASS.rle
drwxrwx--x 2 doc doc   4096 Jan 31 10:17 data
-rw-r--r-- 1 doc doc    118 Jan 31 10:17 default.prop
drwxr-xr-x 2 doc doc   4096 Jan 31 10:17 dev
-rw-r--r-- 1 doc doc 222472 Jan 31 10:17 fsua
-rwxr-x--- 1 doc doc  94380 Jan 31 10:17 init
-rwxr-x--- 1 doc doc   1677 Jan 31 10:17 init.goldfish.rc
-rwxr-x--- 1 doc doc   3048 Jan 31 10:17 init.qcom.post_boot.sh
-rwxr-x--- 1 doc doc   7976 Jan 31 10:17 init.qcom.rc
-rwxr-x--- 1 doc doc   6563 Jan 31 10:17 init.qcom.sh
-rwxr-x--- 1 doc doc  24201 Jan 31 10:17 init.rc
drwxr-xr-x 3 doc doc   4096 Jan 31 10:17 lib
drwxr-xr-x 2 doc doc   4096 Jan 31 10:17 proc
-rw-r--r-- 1 doc doc 331588 Jan 31 10:17 recovery
drwxr-x--- 2 doc doc   4096 Jan 31 10:17 sbin
drwxr-xr-x 2 doc doc   4096 Jan 31 10:17 sys
drwxr-xr-x 2 doc doc   4096 Jan 31 10:17 system
-rw-r--r-- 1 doc doc      0 Jan 31 10:17 ueventd.goldfish.rc
-rw-r--r-- 1 doc doc   5759 Jan 31 10:17 ueventd.rc
doc@gandalf ~/boot_mod/ramdisk $


KERNEL MODULES
Stop working on ramdisk for a while...

Now I must deal with the hardest task of the tweak...

I need to compile two kernel modules for my new modded image...

It seems a simple period, but I need to compile inside Linux for an outside Arm architecture...


I'll explain on a next post how I did it!


...continued in post n. 53...



...make this possible on other cells...
...to do for fit ...
Surely it could be possible... I actually did it for Galaxy ACE too, but I don't have the possibility to test the modded images... finally, the kernel for Galaxy Fit, Ace and Mini is pretty the same, so I bet on it!
 
Last edited:
  • Like
Reactions: manan001

Doc_cheilvenerdi.org

Senior Member
Oct 11, 2011
127
349
Ferrara - Ravenna
[DEV] Increase Internal Memory Size to Whatever You Want!

KERNEL MODULES - FIRST RUN


First of all I setup a cross compiling environment: that is a toolchain used on Linux to create arm executables.
I usually build with the Sourcery CodeBench Lite toolchain, but it's well suited also the one prebuilt inside the AOSP source code...

This time I'll use this one; I find it on my PC starting from this path:
Code:
/home/doc/builds/WORKING_DIRECTORY/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/
Notice: I have to download it from the AOSP home page... could take a while...

Others known toolchains are Linaro (actually not working for me) or Gentoo Crossdev arm-vfp-linux-gnueabi (selfmade and my favourite one).

NOTICE: Anyway, from now on, I consider the building environment already up and running!


After downloading the Linux-to-Android toolchain I need the Kernel Source Code.
Starting from Samsung Open Source Release Center I Find my one and several others...

I download and unzip it into
Code:
/home/doc/boot_mod/kernel

So, this is now my working directory:
Code:
doc@gandalf ~/boot_mod $ ls -l
...
-rw-r--r--  1 doc doc 6377472 May  7  2011 boot.img
-rw-r--r--  1 doc doc 3221952 Jan 31 09:56 boot.img-kernel
-rw-r--r--  1 doc doc 3146572 Jan 31 09:56 boot.img-ramdisk.gz
[b]d[/b]rwxr-xr-x 24 doc doc    4096 Jan 26  2011 kernel
-rwxr-xr-x  1 doc doc   28614 Jan 31 10:08 mkbootimg
[b]d[/b]rwxr-xr-x  9 doc doc    4096 Jan 31 10:17 ramdisk
-rwxr-xr-x  1 doc doc    6121 Jan 31 09:44 split_bootimg.pl
...
doc@gandalf ~/boot_mod $

First of all I check for the kernel version, looking the first five lines of its Makefile:
Code:
VERSION = [b]2[/b]
PATCHLEVEL = [b]6[/b]
SUBLEVEL = [b]35[/b]
EXTRAVERSION = [b].7[/b]
NAME = Yokohama

The Bold Numbers must match the ones read from Settings -> About Phone -> Kernel Version otherwise the modded image will never work!


Now I can edit the Makefile inside the kernel directory (need to do only once!) searching for a line starting with
Code:
CROSS_COMPILE = ...

...changing it to the full path of my toolchain binaries:
Code:
/home/doc/builds/WORKING_DIRECTORY/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/[b]bin/arm-eabi-[/b]


Last (but THE MOST IMPORTANT) I setup the kernel configuration for my phone (need to do only once!):
Code:
doc@gandalf ~/boot_mod/kernel $ make [b]tass_rev02_defconfig[/b]

...

#
# configuration written to .config
#
doc@gandalf ~/boot_mod/kernel $

How do I know that?

...with the following command
Code:
doc@gandalf ~/boot_mod/kernel $ make help
I find out all the phone supported by this kernel...
...and there are also beni and cooper ones (that means S5670 and S5830!) and really many many others...


WILL IT WORK?
Now I simply try to compile the default kernel modules:
Code:
doc@gandalf ~/boot_mod/kernel $ make modules

...

  Building modules, stage 2.
  MODPOST 7 modules

...
doc@gandalf ~/boot_mod/kernel $

Wow! I built something!


WHAT NEXT?
In the next post I'll finally tweak the ramdisk and then I'll compile the needed kernel modules suited for the XXKPF firmware!


...continued on post n. 54



IN THE MEANWHILE
Optional... but really usefull!
In the meanwhile I'll compile a single module suited for my own kernel, just to try it for free...
...or just to verifiy that everything works fine!

The master command is this:
Code:
doc@gandalf ~/boot_mod/kernel $ [b]make menuconfig[/b]

From the kernel menu I can change any config option for the kernel and related modules... but How do I suit it to my phone kernel?

From Settings -> About Phone -> Kernel version I read
Code:
2.6.35.7-perf-CL561937
root@DELL88 #1

I simply put last string of the first line (-perf-CL561937) inside the kernel menu option

General setup -> Local version - append to kernel release

where i write exactly
Code:
[b]-perf-CL561937[/b]


...eh eh... this is the trick that opened to me the kernel doors to my modded image tweaks... (10+)

After that I simply choose, for example, the following option:

File systems -> Network File Systems -> CIFS support

where I should see something like this:
Code:
  < >   ...
  <[b]M[/b]>   CIFS support (advanced network filesystem, SMBFS successor)
  [ ]   ...
Notice: <M> means "Module"

Now I exit from the menu saving "my new kernel configuration" and repeat the build command:
Code:
doc@gandalf ~/boot_mod/kernel $ make modules

...

  LD [M]  fs/cifs/cifs.ko
doc@gandalf ~/boot_mod/kernel $

I reduce the size of the module removing unused stuffs (...to save space - I'm not going to debug any module for bugs... I'll simply use them...):
Code:
doc@gandalf ~/boot_mod/kernel $ /home/alberto/builds/WORKING_DIRECTORY/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-[b]strip --strip-unneeded[/b] fs/cifs/cifs.ko 
doc@gandalf ~/boot_mod/kernel $
(more details about stripping later...)

Now I connect the Phone to the PC and push the compiled module to /data/local using adb:
Code:
doc@gandalf ~/boot_mod/kernel $ adb push fs/cifs/cifs.ko /data/local
3687 KB/s (252908 bytes in 0.066s)
doc@gandalf ~/boot_mod/kernel $


...and finally, using "adb shell" (my phone needs to be rooted) I try to insert the module into my running kernel:
Code:
doc@gandalf ~/boot_mod/kernel $ adb shell
$ su
# lsmod
...
# [b]insmod /data/local/cifs.ko[/b]
# lsmod
[color=blue][b]cifs 210416 0 - Live 0xbf1b9000[/b][/color]
...
# exit
$ exit
doc@gandalf ~/boot_mod/kernel $


NO ERRORS! GREAT!


The error I don't want to see looks like:
Code:
# insmod /data/local/cifs.ko
[color=red][b]insmod: init_module '/data/local/cifs.ko' failed (Exec format error)[/b][/color]
where I, probably, mismatched the Kernel Local Version...



...easy play... and waiting for next post...
 
Last edited:
  • Like
Reactions: roofrider

Doc_cheilvenerdi.org

Senior Member
Oct 11, 2011
127
349
Ferrara - Ravenna
[DEV] Increase Internal Memory Size to Whatever You Want!

RAMDISK - SECOND ROUND
I restart from the boot_mod folder:
Code:
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:
Code:
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:
Code:
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, ...):
Code:
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, ...):
Code:
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:
Code:
General Setup
 [+] Prompt for development and/or incomplete code/drivers
 ()  Cross-compiler tool prefix
 ([b]-perf-CL189639[/b]) Local version - append to kernel release
 [ ] ...
 ...

Code:
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:
Code:
doc@gandalf ~/boot_mod/kernel $ make modules

...

...

  LD [M]  fs/ext4/ext4.ko

...

  LD [M]  fs/jbd2/jbd2.ko

...

doc@gandalf ~/boot_mod/kernel $

Code:
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):
Code:
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...)

Code:
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:
Code:
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:
Code:
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!
 
  • Like
Reactions: roofrider

orieoke

Senior Member
Sep 16, 2011
152
49
YK - ID
orie1212.wordpress.com
Request for S5570DXKPD Asia

Hi DOC..!
Thanks for your posting about this thread.
Now I use STOCK ROM (JVKT1) and increase memory internal to 566MB.
sc20120108-055614.png

Then I rooted with DooMLoRD_v3_ROOT-zergRush-busybox-su. It's very good and no bug. Different with I used DDKQ7, which must choose increase memory internal or root. We can't root and increase memory internal together.

Last month I share this method to my friends, and they're very happy because not affraid again with Low Memory Space and not have to Rooting the device.
But, in JVKT1 not have Indonesian Language. So, most of my friends want to this method can applied in Asia firmware - S5570DXKPD.
So, if u don't mind... U can make for S5570DXKPD Asia.
Thanks...
 

Doc_cheilvenerdi.org

Senior Member
Oct 11, 2011
127
349
Ferrara - Ravenna
[NEXT/MINI/POP/FIT/ACE and GIO] Alltogether...

OTHER PHONE MODELS? ... YOU'RE WELCOME!

I just modded few boot images for Galaxy FIT (S5670) Galaxy ACE (S5830) and Galaxy GIO (S5660)...

Here they are:
Galaxy FIT images:

...list moved to Galaxy FIT development Forum...
Galaxy ACE Modded boot.img:

Galaxy ACE Original boot.img:
Galaxy GIO Modded boot.img:

Galaxy GIO Original boot.img:

WARNING: Backup your data before using them...


P.S. Remember to use Odin and Ops file versions suitable for your phone model!

CREDITS: Many Thanks to kotucisko who Tested (First :cool:!) the modded boot image for PDA S5830XWKPY!

CREDITS: Many Thanks to GeorgeParaschiv who Tested (First :cool:!) the modded boot image for PDA S5660XXKTF!
 
Last edited:

Doc_cheilvenerdi.org

Senior Member
Oct 11, 2011
127
349
Ferrara - Ravenna
DXKPD 2.3.4

NEW BOOT IMAGE ADDED!

Just added this boot.img (First Post for downloads):

  • S5570DXKPD (2.3.4) <--- Edit: changed from 2.3.6 to 2.3.4 after Wanxbotak notice. Thanks!
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 84
    Free Memory to > 1Gb!

    How to Increase your Internal Memory Size with very low effort!

    NOTICE: This method works both on Rooted and NOT Rooted Phones!

    You simply need to meet three easy requirements:

    • Stock Firmware installed on the Phone (custom ROMS not supported ...They don't need to!)
    • A microSD with two primary formatted partitions inside (the former 'to FAT32' and the latter 'to EXT4' filesystems)
    • Ready to Flash to your Galaxy Next via Odin


    NOTICE: The following Black Box Howto is explained deep inside in the next post of this Thread (short explanation) and in This Thread from outside: Internal Memory to +1Gb! and related ones (long explanation / Italian Language)




    HOW TO

    1) Download Tass.ops file for Odin!


    2) Type this number on your phone keyboard:

    *#1234#

    and keep note of the PDA code of the Firmware installed.



    3) Download boot image ready for Odin and suitable for your firmware:

    All modded images are inside my Google Drive; actually we find:
    Code:
    [b][url=https://docs.google.com/folder/d/0B3qe_9NlA1D_QVlKXy01bjZPbVE/edit]Memory Hack Google Drive Archive[/url][/b]
    
    [b][size=3]Galaxy MINI/NEXT/POP[/size][/b]
    S5570AIKQ3        S5570BGKS3        S5570BGKT2
    S5570BVKQ4        S5570BVKT1        S5570DDKA7
    S5570DDKQ7        S5570DXKPD        S5570DXKT6
    S5570JPKQ8        S5570JPKS1        S5570JPKT2
    S5570JVKQ3        S5570JVKT1        S5570MJKS2
    S5570XIKQC        S5570XWKE3        S5570XWKQG
    S5570XWKS2        S5570XWKS7        S5570XWKT7
    S5570XWKTH        S5570XWKTN        S5570XWKTS
    S5570XWKTU        S5570XXKPF        S5570XXKPI
    S5570XXKPK        S5570XXKS1        S5570XXKS4
    S5570ZSKPC
    -----------
    S5570bVJKPB
    -----------
    S5570LWMKP9       S5570LWMKPJ       S5570LWMKPO
    
    [b][size=3]Galaxy MINI/NEXT/POP[/size][/b]
    [b]Froyo[/b]
    S5570DXKB1        S5570XIKFI        S5570XWKC1
    
    [b][size=3]Galaxy GIO[/size][/b]
    S5660AIKT4        S5660DXKT8        S5660JPKT7
    S5660XXKPA        S5660XXKTF        S5660XXKTI
    S5660XXKTK        S5660XXKTO
    -----------
    S5660MUGKG3
    
    [b][size=3]Galaxy FIT[/size][/b]
    S5670DDKB1        S5670DDKT3        S5670DXKPB
    S5670DXKT4        S5670JPKQ7        S5670XWKQA
    S5670XWKTI        S5670XXKPQ        S5670XXKPU
    -----------
    S5670LUBKP6       S5670LUBKPI
    
    [b][size=3]Galaxy ACE[/size][/b]
    S5830BOKS3        S5830DDKQ5        S5830DDKQ8
    S5830DXKPB        S5830DXKPD        S5830DXKT5
    S5830XWKPY        S5830XWKS2        S5830XWKS9
    S5830XWKT7        S5830XWKTM        S5830XWKTQ
    S5830XXKPH        S5830XXKPP

    your firmware not listed? ...take a look into Google Drive first, then let me know if you don't find anything!


    4) Flash the downloaded archive with Odin

    Example image follows:

    Odin1.png



    5) THAT'S ALL FOLKS!


    - - -​


    How does it Work:


    Scenario 1:
    I switch on the Phone, without a MicroSD slotted in or with a microSD with a single FAT32 partition (broken or damaged microSD also suite this scenario...); GingerBread boots as usual!
    No Difference!


    Scenario 2:
    I switch on The Phone with a microSD slotted in (with the second partition formatted as EXT4 filesystem but still EMPTY); Ginger boots acting as if

    /data

    is completely moved outside to microSD but just WIPED (not true obviously, and the original /data is safe inside the phone), so it resettle it from beginning...

    NOTICE:
    ...If your second partition is 1Gb wide...
    ...your new Internal Memory will be 1Gb wide...


    Scenario 3:
    I switch on the Phone with the second partition of the microsd (EXT4) up and running (already resettled up for use and with my userdata on it); Ginger simply boots with

    /data

    moved outside to microSD with your userdata there and tons of apps just installed from the market...

    Example Image of my New Internal Memory Size follows

    gestione_english.png



    - - -​


    NOTICES & ADVICES:

    • If I want to remove the microSD from the slot, FIRST I NEED TO SWITCH OFF THE PHONE!
    • When I install apps from the Market, Ginger Misunderstands the actual new Internal Memory SIZE and puts the apk files to External Storage anyway! I simply need to move them "to the phone" via "Settings menu" immediately after!
    • When I switch on the Phone without the microSD, I boot using the original /data inside the phone, actually loosing all the apps installed onto the external one untill next boot with SDcard; and, of course, loosing my sms stored there and others personal userdata too.
    • Unfortunately this boot image heavy conflicts with Link2SD (great app anyway!), so you must choose one: This Boot image or Link2SD... not both... sorry!


    Don't You Like the boot image just installed and You want to revert without flashing the full firmware to the Phone?
    The original images, ready for Odin, are stored into my Google Drive too, inside BASE subfolders!



    - - - - - - - - - - - - - - - - -


    THREAD ADDONS

    CHECK FILESYSTEM FOR ERRORS
    On post n. 43 you can find an Android Application useful to check the 2nd partition filesystem for errors once a month...

    EXT4 Checkup Tool 1.0 RC3

    P.S. Only for rooted phones!
    HOW TO
    From post n. 52 I explain exactly What I do deep Inside and Step by Step...
    ADDED PHONE MODELS
    In post n. 56 I added boot images modded for Galaxy FIT (S5670), Galaxy ACE (S5830) and Galaxy GIO (S5660)!
    ALL IN ONE WONDER AUTOSCRIPT
    In post n. 78 I added a Linux Script "All in one" to mod your boot Image on your own simply with a double-click!
    MEMORY AND OVERCLOCK KERNEL
    In post n. 148 you find modded images with OC Kernel inside

    P.S. Only for rooted phones with CWM or Custom Recovery!
    27
    Patched Boot Image "Deep Inside"

    As I stated in the previous Post, I skip the Long Explanation of this How to (Italian Threads online anyway) and briefly describe What I did!


    1) Split Boot.img

    I splitted boot.img into it's two main parts: The Kernel and the Ramdisk.


    2) Edit ramdisk


    2.1) Strip Samsung Kernel Modules
    I figured out that Samsung modules used for rfs filesystem are compiled with all the debug symbols inside, so I stripped them saving more than 3Mb into the ramdisk!

    NOTICE: The boot.img must not exceed 8Mb Size or I cannot flash it! BEWARE!


    2.2) Add Ext4 kernel Modules
    I compiled the jbd2.ko and ext4.ko modules for the attached Kernel and put them into /lib/modules inside the ramdisk:
    Code:
    gandalf $ ls -l ./ramdisk/lib/modules/
    totale 1304
    -rw-r--r-- 1 root root 236116 11 dic 08.24 [b]ext4.ko[/b]
    -rw-r--r-- 1 root root 363932 11 dic 08.24 fsr.ko
    -rw-r--r-- 1 root root 211200 11 dic 08.24 fsr_stl.ko
    -rw-r--r-- 1 root root  58176 11 dic 08.24 [b]jbd2.ko[/b]
    -rw-r--r-- 1 root root 260568 11 dic 08.24 rfs_fat.ko
    -rw-r--r-- 1 root root  90968 11 dic 08.24 rfs_glue.ko
    -rw-r--r-- 1 root root  99532 11 dic 08.24 sec_param.ko
    gandalf $


    2.3) Patch init.rc file
    I patched the init.rc file into the ramdisk to load these modules into the kernel immediately after the first boot stage of the firmware:
    Code:
    # insmod fsr/rfs modules
        insmod /lib/modules/fsr.ko
        insmod /lib/modules/fsr_stl.ko
        insmod /lib/modules/rfs_glue.ko
        insmod /lib/modules/rfs_fat.ko
        insmod /lib/modules/sec_param.ko
        [color=red]insmod /lib/modules/jbd2.ko[/color]
        [color=red]insmod /lib/modules/ext4.ko[/color]


    2.4) Add busybox
    I added a copy of busybox into /sbin.
    I'll need it to mount ext4 filesystems on microSD later on.
    Code:
    gandalf $ ls -l ./ramdisk/sbin/
    totale 2088
    -rwxr-x--- 1 root root  117948 11 dic 08.18 adbd
    -rw[color=red][b]s[/b][/color]r-xr-x 1 root root 2016700 11 dic 08.21 [b]busybox[/b]
    lrwxrwxrwx 1 root root       7 11 dic 08.18 ueventd -> ../init
    (i686) gandalf ~ (i686) $


    2.5) Patch init.rc again
    I changed the mount command for /data!

    Original code:
    Code:
        # Mounting of system/userdata is moved to 'on emmc' and 'on nand' sections
        # We chown/chmod /data again so because mount is run as root + defaults
            [color=red][b]mount rfs /dev/stl13 /data nosuid nodev check=no[/b][/color]
        chown system system /data
        chmod 0771 /data

    Patched code:
    Code:
        # Mounting of system/userdata is moved to 'on emmc' and 'on nand' sections
        # We chown/chmod /data again so because mount is run as root + defaults
            [color=red][b]exec /sbin/busybox sh /init.data.sh[/b][/color]
        chown system system /data
        chmod 0771 /data


    2.6) add init.data.sh file
    I added an external shell file, used to mount microsd /data avoiding the Android Init Language used by init.rc.
    Code:
    gandalf $ cat ./ramdisk/init.data.sh 
    #!/sbin/busybox sh
    /sbin/busybox mount -o nosuid,nodev -t ext4 /dev/block/mmcblk0p2 /data || /sbin/busybox mount -o nosuid,nodev -t rfs /dev/stl13 /data
    gandalf $


    3) Repack ramdisk and kernel into boot.img
    I used the AOSP mkbootimg tool to repack alltoghether.


    4) Prepare Odin Archive ready for flash
    I created a PDA Archive with only boot.img inside.
    A command sequence could be, for example:
    Code:
    tar -H ustar -c boot.img > CODE_S5570XWKS7_boot.tar
    md5sum CODE_S5570XWKS7_boot.tar >> CODE_S5570XWKS7_boot.tar 
    mv CODE_S5570XWKS7_boot.tar CODE_S5570XWKS7_boot.tar.md5


    That's All!

    Enjoy!
    7
    Increase Performance? Oh Yes!


    Great Script! Really Interesting!

    Good Idea to mix /data outside with some programs still onboard, looking to performance...

    At a first glance I like a lot this command:
    Code:
    busybox mount -t ext4 -o noauto_da_alloc,data=ordered,commit=15,barrier=1,nouser_xattr,errors=continue,noatime,nodiratime,nosuid,nodev /dev/block/mmcblk0p2 /data;

    I achieve the same safe result while data=ordered and barrier=1 are defaults for ext4 mount command and because I compiled ext4 kernel modules with the extended attributes disabled (nouser_xattr).

    I surely agree with noatime and nodiratime due to microsd lifecycle troubleshootings, but never set noauto_da_alloc...
    ...after some readings I figured out that it should be a MUST Option for SSD...

    While working of this bunch of code
    Code:
    #-- SDCard Speed Fix
    if [ -e /sys/devices/virtual/bdi/179:0/read_ahead_kb ]
    then
      /system/xbin/echo "8192" > /sys/devices/virtual/bdi/179:0/read_ahead_kb;
    fi;

    I surely upgrade AS SOON AS POSSIBLE the attached boot images to gain performance without loosing stability..

    Thanks a Lot!


    P.S. Great Idea Again; thanks to Amarullz too.
    Actually, anyway, I moved the whole GingerBread outside... I have /data, /system and /cache alltoghether into my microSD...
    ...that is: "free to experiment! No need to halt and reflash on errors"...




    i have s5570jpks1 in pda...

    I'll take a look. Please Hold on...
    6
    Read Ahead...

    Wow, 8 MB ? Is that really useful? I read somewhere that 3 MB is optimum, 4 MB is slightly waste. 8MB? Then again I might be wrong, never tried 8MB myself...


    Antutu Benchmark Total Result on my Stock ROM with a 4Gb SD Class 4 said about 1650...


    After moving (without tuning filesystems...) Antutu Said about 1450...


    After Amarullz reading I remounted my filesystem from the shell this way:
    Code:
    # busybox mount -o remount,nosuid,nodev,noatime,nodiratime,errors=continue,nouser_xattr /cache (ext2 filesystem)
    # busybox mount -o remount,ro,noatime,nodiratime,nouser_xattr,barrier=1,data=ordered,noauto_da_alloc /system (ext4)
    # busybox mount -o remount,noatime,nodiratime,nouser_xattr,barrier=1,data=ordered,noauto_da_alloc /data (ext4)
    #
    Left commit=15 backwards, but I'll put it in the new init.rc of patched boot images... I also set barrier, data order and extended attributes, even if defaults...

    and Antutu said about 1550...


    Actually I'm trying on the fly this tweak
    Code:
    # busybox echo "[b]8192[/b]" > /sys/devices/virtual/bdi/179:0/read_ahead_kb
    #
    While googling for optimum value...

    And Antutu said about 1600

    Now I'm trying to stress the system with heavy loads from/to SDCard...
    ...Anyway I cannot say anything yet about Battery charge..



    Please do it ASAP, thanks
    ...Boot images are ready to be shared with these patches on, but I need to test them one by one... I think to be Ready within tomorrow night...



    i have s5570jpks1 in pda...
    Found and patched 2.3.5 fimware S5570JPKS1 with these tweaks too... scheduled to be tested within tomorrow night too...



    distan7 said:
    ...I read at stepph's thread how you MOVED /system to MicroSD but somehow I forgot to ask. Now you mentioned it here. Is it safe ? No i/o bottleneck / noticeable lag ? I know we'll need a really fast and reliable MicroSD card. What's yours doc?

    It is safe... Up and running very heavy since last month...
    Bottlenecks and lags occurr when I stress /data writing and /system reading while /cache is working... sometimes happens...


    As I said somewhere else, if You like to play with your phone dont do it! but...
    ...if you like (for example) to test firmwares or play around deep inside the system without flashing anything and resuming from errors whenever you want... I call it "a Must Option"


    I don't have a fast SD card (now on 4Gb class 4 and very old sailor...) so I cannot compare lags and performance for now with faster memories...



    ...With /system and /data in MicroSD, does this mean we can MULTIBOOT ?

    Let's say I partitioned my sdcard into 5 : 1st one is FAT32 and the other 5 is ext4. I modified boot.img from (let's say) CM7 and stock GB. On CM7's init.rc i put /system and /data into partition 2&3. On stock GB's init.rc i put them into partition 4&5. Partition 6 is used for /cache. I flashed stock with modded boot.img, play around first. Then I flashed CM7 with modded boot.img and played around. Now each time I want to switch ROM, all I have to do is flash the appropriate boot.img using CWM. This boot.img will determine which partition will be used for /system and /data...

    I'm working on this in my spare time... Actually - without flashing anything - I cannot change kernel from one boot to another one, but via init.rc I could start following something written somewhere on /cache or /sdcard...I could - for example - shutdown CM7 saying that I want to boot (next time) to Stock GB and viceversa...

    I'm not a True Developer (Long time ago I said "Hello World" to somebody but I don't know if I will be able to do it) but I'm trying to start the system asking to th euser what to do during the boot stage...(Hard Task for me, but why not...)
    6
    Challenging and...

    STOCK OVERCLOCK ! ! !

    i think its possible, but it depend to the dev want to make it or not

    ...let say "Challenging"...

    ...and after a short debrief of the Squadzone GitHub Kernel Source repository, I found these differences between Stock and Overclocok kernels:
    Code:
    .
    |-- [color=blue]arch[/color]
    |   `-- [color=blue]arm[/color]
    |       `-- [color=blue]mach-msm[/color]
    |           |-- acpuclock.c
    |           `-- cpufreq.c
    |-- [color=blue]drivers[/color]
    |   |-- [color=blue]cpufreq[/color]
    |   |   |-- Kconfig
    |   |   |-- Makefile
    |   |   |-- cpufreq.c
    |   |   |-- cpufreq_brazilianwax.c
    |   |   |-- cpufreq_interactive.c
    |   |   |-- cpufreq_interactivex.c
    |   |   |-- cpufreq_lagfree.c
    |   |   |-- cpufreq_minmax.c
    |   |   |-- cpufreq_savagedzen.c
    |   |   |-- cpufreq_scary.c
    |   |   |-- cpufreq_smartass.c
    |   |   |-- cpufreq_smartass2.c
    |   |   |-- cpufreq_smoothass.c
    |   |   `-- cpufreq_stats.c
    |   `-- [color=blue]cpuidle[/color]
    |       `-- [color=blue]governors[/color]
    |           `-- menu.c
    `-- [color=blue]include[/color]
        `-- [color=blue]linux[/color]
            `-- cpufreq.h
    Differences related to Cpu Clock and Cpufreq Governors...

    Now, discarding many others Squadzone patches (really interesting anyway - - - investigating on them later on), I simply replaced these files in Stock Kernel and recompiled it...

    NOTICE: I sticked the max boot cpu frequency to 600Mhz
    antutu-before.png

    ...so you have to install an application like "No Frills CPU" to upraise it after boot...

    Here my Galaxy Mini benchmarking at 729Mhz:
    antutu-after.png

    What's now?

    Modded Images (with Memory Hack and OverClock Stock Kernel) List:
    These are "update zip files" to be flashed using CWM or a custom recovery of your choice!
    Why don't I cook Odin Archives for these Images? My answer in post n. 152!


    Modded OC Images for Galaxy ACE and Galaxy FIT too:
    ...but I'm waiting feedback on them! I cannot test on my Mini...



    P.S. Like usually, here you find the patched files (from Squadzone GitHub repository) that I put into stock kernel tree: kernel_diffs.tar.gz