There are at least two common init ramdisk formats. The one I tend to use is the older flavor; a compressed cpio archive. A Google search for 'compressed cpio archive initrd' turns up lots of useful hits, including '
How to View, Modify and Recreate initrd.img', which seems to have most of the critical details.
If your question is about how to actually build the filesystem
content, then I suggest that you use, or at least start with, a buildroot-based product. Once you've got a cross toolchain,
Buildroot is fairly painless to use to build your root filesystem.
It may be that you require an initramfs style root filesystem, and I believe Buildroot can also create those. The difference is primarily in how the filesystem image is formatted.
--- rod.