# read kernel's initramfs

## unghio

hi, 've tried to search for it and i've found a lot of nice "how-to include your initramfs into the kernel"... but... actually i have to know the content of the initramfs included in a ******* kernel... how do i should, perhaps, even?

----------

## desultory

It is typically a, possibly compressed, ext2 or cramfs image, as such simply mounting it as a loop device, after possibly decompressing it, should work.

Moved from Gentoo Chat to Kernel & Hardware.

----------

## 165177

That's an initial ramdisk (initrd).  An initial ram filesystem (initramfs) is a possibly compressed cpio archive, whose contents are extracted into a "tmpfs" upon boot.  Modern linux systems typically use an initramfs, because such images are easier to create, faster and do not require a filesystem driver compiled into the kernel.  Such images can simply be extracted using "cpio".

More background is available at "/usr/src/linux/Documentation/initrd.txt".

----------

## unghio

yes, you'r right... well, i was drunk when i wrote the message  :Smile: 

well, the real question is (was, read ahead for more on this): AFAIK the kernel has always an initramfs "compiled" in, (no matter if it's empty or you've putted something in it), and i was wondering how *** **** i can see if it's emty or not... ill' try using cpio on the kernel (well, another kernel...)... i don't think it'll work... but it could be  :Very Happy: 

now... actually, the kernel i'm working on is a 2.4.something... so... it can't have an initramfs in it, i think  :Smile:  i'm wrong?

----------

