Chinaunix首页 | 论坛 | 博客
  • 博客访问: 301662
  • 博文数量: 43
  • 博客积分: 3000
  • 博客等级: 中校
  • 技术积分: 790
  • 用 户 组: 普通用户
  • 注册时间: 2007-04-06 15:15
文章分类

全部博文(43)

文章存档

2011年(11)

2010年(14)

2009年(7)

2008年(11)

我的朋友

分类: LINUX

2008-06-12 15:43:49

Step by step to create/modify ramdisk.img

Benno's blog has an article to change the ramdisk image, I tried it and give more details here.

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:

  1. Upload the ramdisk.img to your linux machine
  2. Change the ramdisk.img name to ramdisk.cpio.gz, and extract it by: # gzip -d ramdisk.cpio.gz
  3. Create a temporary folder, say tmp, copy ramdisk.cpio to tmp folder
  4. Extract the ramdisk.cpio in the tmp folder with command: # cpio -i -F ramdisk.cpio
  5. Remove the ramdisk.cpio in the tmp folder, and make any changes you want to the extracted ramdisk.cpio in tmp folder
  6. Recreate the ramdisk.cpio with command: # cpio -i -t -F ../ramdisk.cpio | cpio -o -H newc -O ../ramdisk_new.cpio
Some notes:
  1. 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.
  2. Check cpio version by # cpio --version. I'm using cpio version 2.4.
  3. Find the latest cpio (v 2.9) on site:
  4. Notice that in step 6, the command includes two O's. First o is lower-case, second is up-case.
  5. Notice in step 6, please remain ramdisk.cpio in up folder of tmp folder. The command need it there.
阅读(1253) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~