Well, making an initrd in general depends a little on which distro you are using. You can use mkinitrd to make an initrd, but to add anything fancy is more complicated. What follows is more advice than a HOWTO. I'm sure what you want to do is possible.
For example, in slackware, the layout of the initrd is saved under /boot/initrd-tree. If you want to add something, like the dd command, then simply make sure that the command exists in /boot/initrd-tree/bin or sbin, then edit the /boot/initrd-tree/init file to add the command wherever you want it in the boot process. Then rerun the mkinitrd command without parameters to generate a new initrd. Using GRUB, it's pretty easy to test the new initrd without making your system unbootable.
In your case, you will have to make sure your init sets up the network first. If I were doing this, I would study the current boot process and add only the necessary modules. In slackware, for example, you would look at /etc/rc.d/rc.inet1 and 2...
Unfortunately, if you're using a different distro, the details will vary tremendously. There may be no /boot/initrd-tree to conveniently edit. Slackware uses busybox, which is very versatile, but not every distro does.
Hope that helps a bit. Maybe though, what you're trying to do has a better solution. Why is that you want to download and dd?
Last edited by mostlyharmless; 05-27-2009 at 02:20 PM.
|