2010年5月30日 星期日

Modify ramdisk.img on android

open device board and find ramdisk.img location
1. #ls /dev/block
2. #cd /data/tmp
3. #mount -t ext3 /dev/block/mmcblk0p1 mnt/
4. on /data/tmp/mnt
# mdkir cpio
5. cat ../ramdisk.img | gunzip | cpio -idv
Then, we can modify the init.rc
such as
1. mount mtd partition from ext2 to ext3
>>mount ext3 /dev/block/mmcblk0p2 /system
>>mount ext3 /dev/block/mmcblk0p2 /system ro remount
>>mount ext3 /dev/block/mmcblk0p3 /data nosuid nodev
2. global environment
>>export PATH /system/busybox:/sbin:/system/sbin:/system/bin:/system/xbin
>>export HOME /
3. Added other service
>>service otg /data/tmp/otg.sh
>>oneshot

If you change successfully, you can comparess and umount it
1. on /data/tmp/mnt/cpio
#find . | cpio -o -H newc | gzip > ../ramdisk.img
#umount mnt

1 則留言:

  1. # mount -o ro -t ext3 /dev/block/mmcblk0p1 /tmp/mnt
    mount: Device or resource busy

    其實點知那一個block/dev才是ramdisk呢?

    回覆刪除