PDA

View Full Version : You can install apps on the SD card.... with root



outsider
12-23-2008, 05:03 PM
http://forum.xda-developers.com/forumdisplay.php?f=448

Original post: http://www.androidin.net/thread-1099-1-1.html
AS usual, this is for those WITH ROOT ONLY

Preparation:
1. Installed JF RC30 V1.2 (only if you are using JF RC30 1.2 , for rc8 ..further work is need to recompile the kernel.img on step 7, maybe someone can workout for that)
2. Make a NANDROID backup
3. A MICRO-SD card with 2 partitions divided : (1) a fat-32 partition, (2) a ext2
* the fat 32 will be mounted as sdcard and the ext2 will replace the internal storage, make your own decision for the size~
4. A Linux terminal

P.S.. I am lazy to type all exact command but i have tried myself it is usable..the procedure is only for those familiar with linux ~~~

Procedure:
1. Check USB debugging on the phone setting
2. Connect with USB and get root via ADB SHELL
3. adb pull /system/etc/mountd.conf ( to a temporary directory for editing)
4. open the pulled mountd.conf (edit: change "mmcblk0" to "mmcblk0p1")
5. rm -f /system/etc/mountd.conf and adb push the edited one for replacement (adb push *the temporary directory* /system/etc/mountd.conf
6. Get mkbootimg directory from git://android.git.kernel.org/platform/system/core.git , then compiling mkbootimg to executable, Write a extractor to extract the bootimg from bootimg.h (original developer has written the extractor, so this step can be ignored, just download the extract_bootimg.c
7. extract bootimg by extract_bootimg.c, get kernel.img and ramdisk.img (keep kernel.img as original)
8. extract ramdisk.img by gunzip < ../ramdisk.img | cpio -id to a specific folder
9. Edit the init.rc from the extracted file 1. add 1 line "mkdir /sd 0771 system system" before rootfs remount -ro ; 2. after mtd mount, add 3 lines "insmod /system/modules/2.6.25-01843-gfea26b0/kernel/fs/ext2/ext2.ko", "mknod /dev/mmcblk0p2 b 179 2 1000" , "mount ext2 /dev/mmcblk0p2 /sd noatime nodiratime" (4 lines in total, *2.6.25-01843-gfea26b0* is referred to JF's RC30 V1.2..i don't know if other version got the same build, please check carefully by yourself)
10 CD into the folder storing the extracted data on step 8 (inculding the edited init.rc)
11. find | cpio -co | gzip > ../ramdisk_new.img
12. please check whether the ramdisk_new.img and kernel.img store in the same folder
13 CD into the folder storing ramdisk_new.img and kernel.img
14. RUN mkbootimg --kernel kernel.img --ramdisk ramdisk_new.img -o boot_new.img
15. adb push the *boot_new.img* /sdcard
16. cat /dev/zero >> /dev/mtd/mtd2
17. flash_image boot /sdcard/boot_new.img
18. busybox cp -a /data/app /sd/
19.rm -r /data/app
20.ln -s /sd/app /data/app
21 reboot (from adb shell) and pray for it

P.S. I tried and both software installed from SD and market is installed to ext2 sd partition autmoatically. but the phone will freeze if I remove sdcard and need to softreset.
The orginial developer mention for those don't need the partition mounted as a directory of rootfs,
can replace step 6-17 by editing /system/init.rc directly (after mtd mount, add 3 lines "insmod /system/modules/2.6.25-01843-gfea26b0/kernel/fs/ext2/ext2.ko", "mknod /dev/mmcblk0p2 b 179 2 1000" , "mount ext2 /dev/mmcblk0p2 /sd noatime nodiratime)

DesignDawg
12-23-2008, 05:13 PM
very cool. Don't have root, but it's cool nonetheless.

shlongwoodian
12-23-2008, 06:27 PM
i have a feeling/i'm hoping all of this will be here soon. there's just no way the internal storage can/will suffice and google just ain't like that.

patiently awaiting...

- auto-rotate
- VK
- video camera capabilities
- ability to install apps to SD
- screen shot

shim0169
12-23-2008, 09:07 PM
Nevermind root access. We need to be able to store apps on the SD card, period!

Another thing too: We should be able to store the install file for the apps we download in case we need to hard reset our phones or get replacements. Once the market goes pay in january, we're screwed. they're not gonna give us back the free apps...

NetCom
12-23-2008, 09:23 PM
I hope that these options will not require from us to be freakin programmers to complete all of the options settings lol - this on the top seems to me like a crash-course of the Linux programing lol :)

rynosaur
12-23-2008, 10:01 PM
I look at the "make a NANDROID" backup at the beginning and "pray for it" at the end and I ask myself--is this a wise thing to do for someone without another phone?

Probably not, but thanks for relating these innovations, Outsider. Like was said on XDA, I'm going to be lazy and let someone else try to package this all into an update.zip.

I can't afford a brick, and I'm not that good at linux. Yet :)

But thanks!

DesignDawg
12-23-2008, 10:40 PM
Nevermind root access. We need to be able to store apps on the SD card, period!

Another thing too: We should be able to store the install file for the apps we download in case we need to hard reset our phones or get replacements. Once the market goes pay in january, we're screwed. they're not gonna give us back the free apps...
A couple of things...first, you can backup all your install files now. Download Astro and knock yourself out. Second, the market isn't going to force you to pay for apps. It's simply going to ALLOW developers to charge for them ON THE MARKET. I stress both aspects because no one is going to force devs to start charging, and most won't bother starting to charge for the apps 10s of thousands of people have already downloaded. Second, there are PLENTY of pay apps for Android right now. They just aren't in the markey yet. The fact that you can charge for apps in several other android app stores hasn't slowed the development or release of free apps.

inportb
12-24-2008, 12:12 AM
Hmm... the fact that the SD partition replaces the onboard partition makes the setup sound kinda shaky. It's cool nonetheless.

What we need is an implementation of UnionFS/AuFS that could merge the two partitions.

drnkonrum
12-24-2008, 01:09 AM
Unfortunately I don't have a rooted phone. I do want to know, however, how is the performance of the apps installed to the SD card? Are they slow to launch? Are there any performance hits due to the apps being on the SD card? And has anyone been brave enough to actually try this out?

Stericson
12-24-2008, 01:30 AM
It should be stated that this is an extremely sloppy hack and, in my opinion, it is not advisable for anyone to try this hack unless they understand and accept the inherit risks associated with it. THIS HACK COULD EASILY BRICK YOUR PHONE, ESPECIALLY IF YOU MESS JUST ONE PART UP.

Be warned.
Stericson

averad
12-24-2008, 02:02 AM
It should be stated that this is an extremely sloppy hack and, in my opinion, it is not advisable for anyone to try this hack unless they understand and accept the inherit risks associated with it. THIS HACK COULD EASILY BRICK YOUR PHONE, ESPECIALLY IF YOU MESS JUST ONE PART UP.

Be warned.
Stericson

Lol, thanks mom I changed my undies and brushed my teeth.

The pre-requisites for this work around don't let the everyday user even get close to trying this, so who you warning?

shim0169
12-30-2008, 11:17 PM
A couple of things...first, you can backup all your install files now. Download Astro and knock yourself out.

I used to use bender. I had to do a hard restart on my phone, and never re-installed it, so I didn't know the dev changed its name to Astro, nor did I know it saves the install files. Thanks for that info.



Second, the market isn't going to force you to pay for apps. It's simply going to ALLOW developers to charge for them ON THE MARKET. I stress both aspects because no one is going to force devs to start charging, and most won't bother starting to charge for the apps 10s of thousands of people have already downloaded. Second, there are PLENTY of pay apps for Android right now. They just aren't in the markey yet. The fact that you can charge for apps in several other android app stores hasn't slowed the development or release of free apps.


I don't think I explained my point properly. I wasn't insinuating that the market will force you to pay for apps. I simply meant that the market will allow for paid apps.

Also, I think all that's slowing down the production of free apps (quite possibly paid too), are the countless idiots who post one-star ratings citing "first", as well as the horrific amount of racial slurs, and "i don't know what this app is" posted to the rating system.

zhouweifantacy
04-23-2009, 04:40 AM
can you tell me where can I find extract_bootimg.c? thanks ^_^

chienbinhso13
02-06-2012, 07:41 AM
i don't want brick. lol