Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

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

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

add comment

2 Answers

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.

share|improve this answer
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.