2009年9月11日 星期五

SOP modifiy content of ramdisk.img, e.g., init.rc

Step 1. rename ramdisk.img.
$ mv ramdisk.img ramdisk.img.gz
Step 2. decompress ramdisk.img.gz through gunzip.
$ gunzip ramdisk.img.gz
Step 3. create a directory.
$ mkdir <dir-name>
Step 4. enter the directory that you just created.
$ cd ramdisk
Step 5. unpack ramdisk.img through cpio
$ cpio -i -F ../ramdisk.img
Note. After step 5, the whole ramdisk.img content decompressed.

Step 6. modify the content that you want.

Step 7. Generate pack list.
$ cpio -i -t -F ../ramdisk.img > list
Step 8. pack new.img.
$ cpio -o -H newc -O new.img < list
Step 9. Compress new.img
$ gzip new.img

沒有留言:

張貼留言