Unpack
1. view the file format: file ramdisk. img
Ramdisk. IMG: gzip compressed data, from UNIX
Ramdisk. IMG is a compressed package. Of course, ramdisk. IMG compression is not required
2. decompress the ramdisk. IMG package: gunzip-S. IMG ramdisk. img
Because the file name is not .gz, you need to add-s and decompress it to generate the ramdisk file.
3. view the extracted file ramdisk: file ramdisk.
Ramdisk: ASCII cpio archive (svr4 with no CRC)
Cpio package files.
4 unpack package file ramdisk: mkdir rootfs; CD rootfs; cpio-I-f ../ramdisk; LS
Data Dev init. Goldfish. RC proc sys ueventd. Goldfish. RC
Default. Prop init. RC sbin system ueventd. RC
This is all the files.
Then we can modify the files under rootfs. To use the modified rootfs, we only need to repackage rootfs as ramdisk. IMG.
Package
1. Generate a cpio package: CD rootfs; find. | cpio-o-h NEWC> ../tmp_ramdisk.img
2. compress the cpio package: gzip-C tmp_ramdisk.img> ramdisk. img
The newly generated ramdisk. IMG contains the modified