[Dev-request][HACK] Increase Internal Memory Size

Search This thread

arunmcops

Inactive Recognized Developer
Apr 20, 2010
1,378
862
Bareilly
OnePlus 6
Xiaomi Poco F3
Galaxy 3 Devs , please take a look on this.
http://xdaforums.com/showthread.php?t=1398797

gestione_english.png


Kernel needs to be patched for this. I am not having access to my PC so if any kernel dev can pull this off then it would be great.

Instructions:-

1-Add Ext4 kernel Modules

Compile the jbd2.ko and ext4.ko modules for the 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 ext4.ko
-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 jbd2.ko
-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- Patch init.rc file
Patch 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
    insmod /lib/modules/jbd2.ko
    insmod /lib/modules/ext4.ko

3- Add busybox

Add a copy of busybox into /sbin.
We 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
-rwsr-xr-x 1 root root 2016700 11 dic 08.21 busybox
lrwxrwxrwx 1 root root       7 11 dic 08.18 ueventd -> ../init
(i686) gandalf ~ (i686) $

4- Patch init.rc again
Change 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"]mount rfs /dev/stl6 /data nosuid nodev check=no[/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"]exec /sbin/busybox sh /init.data.sh[/COLOR]
    chown system system /data
    chmod 0771 /data

5- Add init.data.sh file
Add 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/stl7 /data
gandalf $
 

M_247

Senior Member
Jan 25, 2012
333
128
Great concept, particularly but with data to sd, you can put almost all files of app to sd...
Lots of space without increasing memory...

Yet a good concept...
 

spikywits

Senior Member
Nov 20, 2010
348
83
Initial app2sd scripts by apollo used to show ext4 space in task manager but currently no script does so. No idea what Hybrid Data2SD actually is.

Sent from my GT-I5800 using Tapatalk

even my wait is long to see a kernel/rom to actually show ext4 space in task manager.
G3MOD kernel 2.0(and lower version) supports this feature in the form of data2sd(not apps2sd or hybrid data2sd). But the developers of this kernel messed up the code and later versions of their kernel doesn't seems to support this.
 

ajay.d96

Senior Member
Sep 22, 2011
411
372
Galaxy 3 Devs , please take a look on this.
Kernel needs to be patched for this. I am not having access to my PC so if any kernel dev can pull this off then it would be great.

umm.... did i hear the word "HACK' okay ill take and merge this script on my sense port.... maybe in build 1
 

arun356y

Senior Member
Jul 9, 2011
343
65
This is interesting... Devs pls try this on our G3.

Sent from my GT-I5800 using Tapatalk
 

Kaleptik

Inactive Recognized Developer
Jun 3, 2009
3,801
1,229
30
www.acidhazardrom.com
Nice job making it to the front page!

Just an idea.
If ClockworkMod is merged with the kernel, people that like to remove their SDCARD can first flash the stock kernel, or any kernel with ClockworkMod and then remove the SDCARD.

Unless I totally read that wrong.

Sent from my Samsung Galaxy S II w/ CM9
 

TRusselo

Inactive Recognized Developer
Jan 20, 2011
4,736
2,931
Edmonton
Nice job making it to the front page!

Just an idea.
If ClockworkMod is merged with the kernel, people that like to remove their SDCARD can first flash the stock kernel, or any kernel with ClockworkMod and then remove the SDCARD.

Unless I totally read that wrong.

Sent from my Samsung Galaxy S II w/ CM9
Yes, exactly.

And also this is where a class 10 SD card would shine. Standard internal memory is usually around a class 6.
 

bedwa

Inactive Recognized Developer
Oct 5, 2008
1,152
718
Springfield IL
Clean and efficient, I like. Mounts ext part, if not there it mounts traditional data partition. IE: If you want 2 partitions or you don't want it to take up your SD, don't insert it till after the device is on.
 

Jason-EX

Senior Member
Sep 13, 2011
1,063
977
How to compile a script?
You'll need to edit from the kernel source and then compile the whole kernel to zImage.

---------- Post added at 12:14 AM ---------- Previous post was at 12:11 AM ----------

Galaxy 3 Devs , please take a look on this.
http://xdaforums.com/showthread.php?t=1398797

gestione_english.png


Kernel needs to be patched for this. I am not having access to my PC so if any kernel dev can pull this off then it would be great.

Instructions:-

1-Add Ext4 kernel Modules

Compile the jbd2.ko and ext4.ko modules for the 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 ext4.ko
-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 jbd2.ko
-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- Patch init.rc file
Patch 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
    insmod /lib/modules/jbd2.ko
    insmod /lib/modules/ext4.ko

3- Add busybox

Add a copy of busybox into /sbin.
We 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
-rwsr-xr-x 1 root root 2016700 11 dic 08.21 busybox
lrwxrwxrwx 1 root root       7 11 dic 08.18 ueventd -> ../init
(i686) gandalf ~ (i686) $

4- Patch init.rc again
Change 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"]mount rfs /dev/stl6 /data nosuid nodev check=no[/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"]exec /sbin/busybox sh /init.data.sh[/COLOR]
    chown system system /data
    chmod 0771 /data

5- Add init.data.sh file
Add 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/stl7 /data
gandalf $
Nice guide, I will try to build this kernel mod tomorrow. :D:D and btw, do we need any partition to make this work?
 

bedwa

Inactive Recognized Developer
Oct 5, 2008
1,152
718
Springfield IL
Since it's a ramdisk tweak, you could even unpack, tweak and repackage.

My Tab makes phone calls yo! (GT-P6800)
 

Top Liked Posts

  • There are no posts matching your filters.
  • 7
    Galaxy 3 Devs , please take a look on this.
    http://xdaforums.com/showthread.php?t=1398797

    gestione_english.png


    Kernel needs to be patched for this. I am not having access to my PC so if any kernel dev can pull this off then it would be great.

    Instructions:-

    1-Add Ext4 kernel Modules

    Compile the jbd2.ko and ext4.ko modules for the 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 ext4.ko
    -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 jbd2.ko
    -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- Patch init.rc file
    Patch 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
        insmod /lib/modules/jbd2.ko
        insmod /lib/modules/ext4.ko

    3- Add busybox

    Add a copy of busybox into /sbin.
    We 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
    -rwsr-xr-x 1 root root 2016700 11 dic 08.21 busybox
    lrwxrwxrwx 1 root root       7 11 dic 08.18 ueventd -> ../init
    (i686) gandalf ~ (i686) $

    4- Patch init.rc again
    Change 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"]mount rfs /dev/stl6 /data nosuid nodev check=no[/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"]exec /sbin/busybox sh /init.data.sh[/COLOR]
        chown system system /data
        chmod 0771 /data

    5- Add init.data.sh file
    Add 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/stl7 /data
    gandalf $
    1
    Uhm since i am not very familiar with classes of SD cards, i would like to ask you which one CLASS would make the best effort for the lowest price while using this MOD? I mean do i need class 10 card or would it be enough to get class 6 SD card or even lower? Thanks for reply :)

    Internel memory of phones is class 6 so i think a class 6 sd card would be enough.