ramdisk.img is included in the google android sdk, it exists in folder $SDK_ROOT/tools/lib/images/ramdisk.img. The ramdisk.img included in the google android sdk is a gzipped ramdisk.cpio file.
Here is the steps:
- Upload the ramdisk.img to your linux machine
- Change the ramdisk.img name to ramdisk.cpio.gz, and extract it by: # gzip -d ramdisk.cpio.gz
- Create a temporary folder, say tmp, copy ramdisk.cpio to tmp folder
- Extract the ramdisk.cpio in the tmp folder with command: # cpio -i -F ramdisk.cpio
- Remove the ramdisk.cpio in the tmp folder, and make any changes you want to the extracted ramdisk.cpio in tmp folder
- Recreate the ramdisk.cpio with command: # cpio -i -t -F ../ramdisk.cpio | cpio -o -H newc -O ../ramdisk_new.cpio
Some notes:
- I change ramdisk.img to ramdisk.cpio.gz, and unzip it. It is because I find the -z parameter is not supported with my cpio. I tried the latest cpio (2.9), it doesn't work too.
- Check cpio version by # cpio --version. I'm using cpio version 2.4.
- Find the latest cpio (v 2.9) on site: gnu cpio
- Notice that in step 6, the command includes two O's. First o is lower-case, second is up-case.
- Notice in step 6, please remain ramdisk.cpio in up folder of tmp folder. The command need it there.
本文详细介绍了如何将gzip压缩的RAM Disk文件解压缩,并进行自定义修改。包括上传文件、重命名、解压缩、创建临时文件夹、复制文件、解压、修改内容、重建文件等步骤,以及遇到的问题与解决方案。

被折叠的 条评论
为什么被折叠?



