An initramfs image will take up less space than initrd; create the directory structure, let's say it's in a directory called '/stuff'. According to the documentation in the Linux source directory you'd do something like:
cd /stuff
find . | cpio -o -H newc | gzip > ../myinitrd.img
Note: the documentation states that the 'cpio' documentation gives bad advice on how to generate the image, so don't follow any cpio docs on how to create the initramfs image.
The trick now is in the booting; for a genuine initrd, you need to pass the kernel "init=blah" to tell the kernel what to use for init (for example: init=/bin/sh), but for an initramfs you need "rdinit=blah".
But - if you really want an initrd:
dd if=/dev/zero of=myinitrd bs=512 count=40000
mke2fs myinitrd
mount myinitrd /mnt -o loop
and so on ... and after copying files into the image:
gzip myinitrd
|