Page 1 of 1
initrd for custom kernel
Posted: Wed May 30, 2007 6:01 pm
by piranha
How do you compile an initrd for a custom kernel?
I don't want to install it, I just want to compile it to a specific directory. the kernel is located in a specific directory as well.
Posted: Thu May 31, 2007 1:12 am
by Brynet-Inc
Compile initrd? Isn't that some sort of ramdisk image... ?
![Confused :?](./images/smilies/icon_confused.gif)
Posted: Thu May 31, 2007 4:29 pm
by piranha
Um....yeah....I used the word "compile" because I was tired and I couldn't think of another word.....sorry.....
create an initrd..... help?
Posted: Thu May 31, 2007 4:45 pm
by jnc100
Well I guess you could
Code: Select all
dd if=/dev/zero of=initrd bs=1k count=initrd_size
mk(filesystem of choice)fs initrd
mount -t filesystem -o loop,rw initrd /mnt
cd /mnt
cp all_my_files .
cd /
umount /mnt
and even gzip it if you're feeling clever
But that's just off the top of my head so I've probably forgotten something...
Regards,
John.
Posted: Thu May 31, 2007 4:49 pm
by Brynet-Inc
I'm not sure I get what you mean... will you be mounting this "ramdisk" image via your kernel? You'll have to write support code for that..
As for "creating" the actual image... Create it like any other disk image, You can use the dd command and then setup a vnode/loopback device to create a file system (
FFS/Ext2.. or FAT if you must..)
http://www.osdev.org/wiki/Loopback_Device
Have fun
(
Dang.. jnc100 replied first... ![Laughing :lol:](./images/smilies/icon_lol.gif)
)
Posted: Thu May 31, 2007 8:12 pm
by piranha
thanks guys!!!!!!
![Razz :P](./images/smilies/icon_razz.gif)