7

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 bzImage, initrd.img and how can I change the file structures in that images?

migrated from stackoverflow.com Jul 24 '11 at 9:25

This question came from our site for professional and enthusiast programmers.

5

This might help you: http://www.linuxfromscratch.org/ You can customize as per you want.

3

Two things you need to do:

  1. Build a custom kernel and an initrd image
  2. Make a bootable USB containing the above

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 kernel-genkernel-<something_including_your_kernel_version> and initramfs-genkernel-<the_same_ending>.

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy