apps2SD 步骤

转自:http://androidcommunity.com/forums/f41/you-can-install-apps-on-the-sd-card-with-root-9777/

 

准备工作:
2. Make a NANDROID backup
3. 把SD卡格式为两个分区: (1) fat-32 , (2) ext2
fat 32分区用于作为SD卡,ext2分区用于作为内部存储。根据自己需要选择分区大小。


步骤:
1. USB连接到手机

2. 准备好adb 连接。 通过adb devices确认连接。 

3. adb pull /system/etc/mountd.conf  local/mountd.conf  获取手机上的mount配置文件到电脑上,后面需要编辑

4. 在电脑上打开pull的mountd.conf文件,把其中的"mmcblk0"替换为 "mmcblk0p1"
5. 用修改后的mountd.conf替换手机上的该文件

adb shell rm -f /system/etc/mountd.conf

adb push local/mountd.conf /system/etc/mountd.conf
6. 准备好mkbootimg 和 unpkbootimg

mkbootimg 可以从git://android.git.kernel.org/platform/system/core.git 上获取
7. 用unpkbootimg把bootimg.img分割为kernel.img 和 ramdisk.img

8. 解压 ramdisk.img 

gunzip < ../ramdisk.img | cpio -id  ./rdfs      (rfds为ramdisk解压后的的目的文件目录)
9.编辑 ./rdfs/init.rc

   a) 在rootfs remount -ro前面添加一行 "mkdir /sd 0771 system system"

   b)在 mtd mount 后添加3行

  "insmod /system/modules/2.6.25-01843-gfea26b0/kernel/fs/ext2/ext2.ko"  给出ext2文件系统模块的位置

   "mknod /dev/mmcblk0p2 b 179 2 1000"

   "mount ext2 /dev/mmcblk0p2 /sd noatime nodiratime"  

10 cd进入步骤8中创建的目录

11. find | cpio -co | gzip > ../ramdisk_new.img
12.把ramdisk_new.img 和 kernel.img放在一个目录中

13 cd 进入到ramdisk_new.img 和 kernel.img的目录
14.运行 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)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值