remastering initrd
Loïc Grenié
loic.grenie at gmail.com
Thu Nov 5 11:51:07 UTC 2009
2009/11/3 Stuart Murray-Smith <eight32 at gmail.com>:
> Greetings list :)
>
> Calling all initrd ninjas! :) I need to customise/remaster an Ubuntu
> 9.04 initrd so that networking is available in a shell when I PXE-boot
> a workstation.
>
> Do I manually fold in networking (file-for-file, && where is the best
> place to get documentation for this), or use a toolset (something like
> initramfs-tools) to build a custom intrd?
>
> Any insight/help highly appreciated as always :)
If you need a dhcp client, you (probably) need to recompile
busybox to have udhcpc (dhcp client). It is a good idea to
recompile it anyway because busybox if statically linked
by default so it's bigger (since libc.so is included in the
initrd, you can dynamically link busybox without problem).
You can copy busybox to /usr/lib/initramfs-tools/bin afterwards
(it's not very clean, but it's easy). That should be enough for
dhcp configuration. If the network configuration is static, you
don't need udhcpc.
Then you need the tools you want to use, obviously. If they are
available as busybox tools, use them. Otherwise, look at
the files in /usr/share/initramfs-tools/hooks, find one simple enough
(brltty for instance but whatever will do), copy it to
/etc/initramfs-tools/conf.d (with a new name) and modify it slightly
to add the programs you need to the initrd.
Do a
update-initramfs -k all
and you should be ready to go. Test, rinse, come back here to
tell us if you managed to do it.
Hope this helps,
Loïc
More information about the ubuntu-users
mailing list