This is a mod to move your phone's Dalvik cache to the /cache partition, freeing up the space it would normally take up in /data. Depending on how many apps you've got installed, you'll free up 40+ M of space on /data.
This is an old mod that has been around a while and in all of the Optimus S ROMs. Recently I flashed my phone back to stock to build my own ROM, and was shocked to learn I had to delete half my apps until I'd reimplemented this feature! Finally, I understood why all the V people were messing around with old-school link2sd/app2sd instead of just using the froyo-native "Move to SD card"! Personally, I have tons of apps installed and around 60 M free on /data.
I recently contributed this mod to LeslieAnn for Harmonia, so here I'm just putting it out separately. I don't know if he's the original author, but I owe props to KSmith since I originally cribbed mvdalvik.sh from ThundeROM. Thanks!
Can I use this mod?
This mod will only help you if you don't already have it. So, it's great if you're running mostly stock, like me.
I don't know about every ROM, but these ROMs already have this feature (so you don't need to add it):
These ROMs don't (yet) have this feature (so you can add it):
Other ROMs ... I haven't checked, but I'll update this list as people provide info.
Count'em ... TWO ways to install
1. There is an easy way, an update .zip. However, it may not be compatible with your ROM.
2. There is the hard way, for which I will give full instructions. It is compatible with everything! However, it requires a Linux machine, the Android SDK installed, and familiarity with the command line. (You *could* also do it on an OS X or Win machine, if you've got mkbootimg and mkbootfs binaries ... but in that case you probably don't need this tutorial).
So, first see if meet the requirements for the easy way. If you don't, or you're just a nerd, look at the hard way.
1. The Easy Way
The update .zip will replace the root filesystem (all the .rc files and other stuff in /) of your phone with a modded one from a stock Optimus V.
Why could this possibly be bad? Well, your ROM may have done customizations in there that you want to keep. Or, it may have done customizations that don't matter to you, at least not as much as 40 M free on /data!
I will try to make recs based on what I know about various ROMs, but you've got to make the decision for yourself.
DO flash the .zip for:
If you're still here, just download the attached mvdalvik-update.zip, copy it to your /sdcard, and flash like any update .zip. Last, be sure to wipe Dalvik and cache before you reboot.
2. The Hard Way
1. Download the attached mvdalvik-howto.zip and unzip it. From here on I'll assume it's unzipped into your home directory (and will refer to ~/mvdalvik-howto/filename) but you can put it anywhere. It contains:
2. OK, first let's put mvdalvik.sh into /system/etc.
3. Now you will dump /boot to boot.img, unpack it, patch init.rc, and repack. (Read this for background.)
4. (possibly optional) If your ROM doesn't already have a flash_image command, you can add the included binary:
5. Now push boot-new.img to /sdcard, flash, clean up and reboot to recovery:
6. Wipe Dalvik and cache, and reboot. You're done!
This is an old mod that has been around a while and in all of the Optimus S ROMs. Recently I flashed my phone back to stock to build my own ROM, and was shocked to learn I had to delete half my apps until I'd reimplemented this feature! Finally, I understood why all the V people were messing around with old-school link2sd/app2sd instead of just using the froyo-native "Move to SD card"! Personally, I have tons of apps installed and around 60 M free on /data.
I recently contributed this mod to LeslieAnn for Harmonia, so here I'm just putting it out separately. I don't know if he's the original author, but I owe props to KSmith since I originally cribbed mvdalvik.sh from ThundeROM. Thanks!
Can I use this mod?
This mod will only help you if you don't already have it. So, it's great if you're running mostly stock, like me.
I don't know about every ROM, but these ROMs already have this feature (so you don't need to add it):
- Harmonia (upgrade to latest)
- Nameless/Reborn
- CM7
These ROMs don't (yet) have this feature (so you can add it):
- stock (obviously)
- Aphrodite
- Bumblebee
- Rodimus
Other ROMs ... I haven't checked, but I'll update this list as people provide info.
Count'em ... TWO ways to install
1. There is an easy way, an update .zip. However, it may not be compatible with your ROM.
2. There is the hard way, for which I will give full instructions. It is compatible with everything! However, it requires a Linux machine, the Android SDK installed, and familiarity with the command line. (You *could* also do it on an OS X or Win machine, if you've got mkbootimg and mkbootfs binaries ... but in that case you probably don't need this tutorial).
So, first see if meet the requirements for the easy way. If you don't, or you're just a nerd, look at the hard way.
1. The Easy Way
The update .zip will replace the root filesystem (all the .rc files and other stuff in /) of your phone with a modded one from a stock Optimus V.
Why could this possibly be bad? Well, your ROM may have done customizations in there that you want to keep. Or, it may have done customizations that don't matter to you, at least not as much as 40 M free on /data!
I will try to make recs based on what I know about various ROMs, but you've got to make the decision for yourself.
DO flash the .zip for:
- stock ROM, including flashed with alternate kernel
- Aphrodite
- Bumblebee (NOTE you will lose init.d support ... so if you care about this move on to the hard way)
- Rodimus (NOTE you will lose init.d support ... so if you care about this move on to the hard way)
If you're still here, just download the attached mvdalvik-update.zip, copy it to your /sdcard, and flash like any update .zip. Last, be sure to wipe Dalvik and cache before you reboot.
2. The Hard Way
1. Download the attached mvdalvik-howto.zip and unzip it. From here on I'll assume it's unzipped into your home directory (and will refer to ~/mvdalvik-howto/filename) but you can put it anywhere. It contains:
- flash_image: this is an ARM binary for your phone in case you don't already have
- init.rc.diff: this is a patch you will be applying to your init.rc
- mkbootfs: this is a Linux x86 binary I compiled from the froyo branch of Android
- mkbootimg: "
- mvdalvik.sh: this is a shell script you will be putting in /system/etc/ on your phone
- split_bootimg.pl: script to unpack the boot partition image
2. OK, first let's put mvdalvik.sh into /system/etc.
Code:
adb shell "mount -o remount,rw /dev/block/mtdblock5 /system"
adb push ~/mvdalvik-howto/mvdalvik.sh /system/etc/
adb shell "chmod 700 /system/etc/mvdalvik.sh"
adb shell "mount -o remount,ro /dev/block/mtdblock5 /system"
3. Now you will dump /boot to boot.img, unpack it, patch init.rc, and repack. (Read this for background.)
Code:
adb shell "cat /dev/mtd/mtd0 > /sdcard/boot-old.img"
adb pull /sdcard/boot-old.img
mkdir ramdisk && cd ramdisk
gzip -dc ../boot-old.img-ramdisk.gz | cpio -i
patch init.rc < ~/mvdalvik-howto/init.rc.diff
cd ..
~/mvdalvik-howto/mkbootfs ramdisk | gzip -9 > ramdisk.gz
~/mvdalvik-howto/mkbootimg --kernel boot-old.img-kernel --ramdisk ramdisk.gz --cmdline 'mem=477M console=ttyMSM2,115200n8 androidboot.hardware=thunderc' --base 0x12200000 -o boot-new.img
4. (possibly optional) If your ROM doesn't already have a flash_image command, you can add the included binary:
Code:
adb shell "mount -o remount,rw /dev/block/mtdblock5 /system"
adb push ~/mvdalvik-howto/flash_image /system/bin/
adb shell "chmod 755 /system/bin/flash_image"
adb shell "mount -o remount,ro /dev/block/mtdblock5 /system"
5. Now push boot-new.img to /sdcard, flash, clean up and reboot to recovery:
Code:
adb push boot-new.img /sdcard/
adb shell "cat /dev/zero > /dev/mtd/mtd0" # don't worry, "No space left on device" is normal
adb shell "flash_image boot /sdcard/boot-new.img"
adb shell "rm /sdcard/boot-new.img /sdcard/boot-old.img"
adb reboot recovery
6. Wipe Dalvik and cache, and reboot. You're done!