document updated 15 years ago, on Sep 8, 2009
It's very educational to peer inside the initrd/initramfs of various distributions.
While it can be hard to remember the commands to unpack them, there are really only two commands you need to remember:
- mount -o loop somefile.ext /mnt/
peek inside a .iso, .img, MINIX filesystem, etc
- file somefile.ext
This ONE command quickly tells you, regardless of the extension, whether the file is a gzip, a kernel image, a MINIX fs, a cpio archive, whatever. This way, you don't have to remember in what order to run the gzip/cpio/whatever, just strip off the outer layer, and file it again. It also means you don't have to remember ALL the filenames that kernel are shipped as.
NOTE though that if it tells you it's a LILO image, note that those can be loop-mounted and unpacked too.
Sometimes you run into a cpio archive, use this to unpack it:
cpio -i < somefile.ext