I would like to boot the Linux kernel alone and run busybox, not including a GUI.
How can I do that? How can I make a custom
initrd.img and how can I change the file structures in that images?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
This might help you: http://www.linuxfromscratch.org/ You can customize as per you want.
Two things you need to do:
For the first part, you are best using the "genkernel" tool. You can probably achieve what you want by issuing
genkernel --menuconfig all. This will allow you to first configure the kernel, then build it together with modules (if any) and a ramdisk image (initrd/initramfs).
However, if you have never built a custom kernel, bear in mind that kernel configuration is not an easy task. You're best staying with as many defaults as you can.
After that step, you'll find your kernel image and initramfs under
/boot/ - they will be named something like
Once you have that, you can go for building your custom bootable USB stick containing the files. To do that, I'd recommend following the Gentoo Linux documentation, replacing
emerge with the appropriate package manager command for your distribution.