RTP常用网址

来源:互联网 发布:惠普m126a端口是什么 编辑:程序博客网 时间:2024/04/29 18:51

http://blog.csdn.net/eustoma/article/details/6704137

http://blog.csdn.net/eustoma/article/details/6704099

http://blog.csdn.net/chaigang1983/article/details/4738408

转载: 
------------------------------------------------------ 
一.ramdisk.img 


android编译后生成的ramdisk.img是一个gzip格式的文件 
# file ramdisk.img 
ramdisk.img: gzip compressed data, from Unix 

那么先解压,因为后缀不是.gz,所以用-s 选项 
gunzip -S .img ramdisk.img 

这样生成了一个新文件ramdisk 
查看是什么格式 
# file ramdisk 
ramdisk: ASCII cpio archive (SVR4 with no CRC) 

ok,是一个cpio格式的文件 
再次解压 
先创建一个目录,假设叫rfs,并进入 
# cpio -i -F ../ramdisk 
512 blocks 
ok,那么得到结果是 
# ll 
total 160 
drwxrwx--x 2 root root   4096 2010-08-21 19:10 data 
-rw-r--r-- 1 root root    118 2010-08-21 19:10 default.prop 
drwxr-xr-x 2 root root   4096 2010-08-21 19:10 dev 
-rwxr-x--- 1 root root 107412 2010-08-21 19:10 init 
-rwxr-x--- 1 root root   1677 2010-08-21 19:10 init.goldfish.rc 
-rwxr-x--- 1 root root  12995 2010-08-21 19:10 init.rc 
drwxr-xr-x 2 root root   4096 2010-08-21 19:10 proc 
drwxr-x--- 2 root root   4096 2010-08-21 19:10 sbin 
drwxr-xr-x 2 root root   4096 2010-08-21 19:10 sys 
drwxr-xr-x 2 root root   4096 2010-08-21 19:10 system 

这就是全部内容了。 

生成就是一个逆向的操作而已。 

二.如何将目录打包成ramdisk.img 
1.对ramdisk目录进行cpio生成 
luther@gliethttp:/vobs/tmp/ramdisk$ find . | cpio -o -H newc > ../tmp_ramdisk.img 
450 blocks 
2.压缩成gz文件,生成我们需要的ramdisk.img 
仅仅对生成的tmp_ramdisk.img进行gzip压缩就行了. 
luther@gliethttp:/vobs/tmp$ gzip -c tmp_ramdisk.img > luther_ramdisk.img 
这样我们新的ramdisk.img就成功生成了,把luther_ramdisk.img烧写到手机上即可[luther.gliethttp] 


注: 
其实ramdisk.img的内容就是/opt/froyo/out/target/product/generic/root的压缩而已。 



二.system.img userdata.img 


1 解压 

    file system.img和userdata.img发现他们都是 

     VMS Alpha executable类型.可通过以下命令来解压出来 

    xyaffs2 img_file output_dir 

    xyaffs2可以从下面找到: 

    http://limodev.cn/download/xyaffs.tar.gz 

    2 替换 

    库文件在lib目录下,执行程序在xbin目录下,你可以把自己的库文件和执行程序放进去。 

    3 打包 

     mkyaffs2image [-f] [-c <size>] [-s <size>] dir image_file [convert] 

     mkyaffs2image可以直接从yaffs2网站上找到,或者直接用android open source里面的。 

     ./out/host/linux-x86/bin/mkyaffs2image


0 0
原创粉丝点击