After configuring and building the kernel using make, why don't I have vmlinuz-<version>-default.img and initrd-<version>.img, but only got a huge vmlinux binary (~150MB)?

  • 4
    Did you forget to run make bzImage? Also, did you make a monolithic kernel? Are you running a Debian-like OS? If so, and you're not cross-compiling, there are easier ways to build a kernel.
    – Alexios
    May 16 '12 at 9:03
  • I compiled it in OpenSUSE (however, I downloaded the latest source from kernel.org). After make menuconfig, I typed make and let it does the job.
    – Amumu
    May 16 '12 at 9:05
  • 1
    You need make bzImage to generate the bzImage kernel. Say make help to see some brief instructions. Check the Linux Kernel Howto for detailed instructions. If you answered every make menuconfig question with Y (rather than M where appropriate), you've tried to include every driver in the kernel proper. This is a very, very bad idea and the kernel won't boot because it's too large. The initrd image is generated by other tools.
    – Alexios
    May 16 '12 at 9:12
  • I've just checked the config again. It seems I have not enabled loadable kernel module support. I thought it is default. I will try to compile again and will notify when it's done.
    – Amumu
    May 16 '12 at 9:18
  • Lots of the comments above look like good answers to me. May 16 '12 at 15:05

The compressed images are under arch/xxx/boot/, where xxx is the arch. For example, for x86 and amd64, I've got a compressed image at /usr/src/linux/arch/x86/boot/bzImage, along with /usr/src/linux/vmlinux.

If you still don't have the image, check if bzip2 is installed and working (but I guess if that were the problem, you'd get a descriptive error message, such as "bzip2 not found").

Also, the kernel config allows you to choose the compression method, so the actual file name and compression algorithm may differ if you changed that kernel setting.

As others already mentioned, initrds are not generated by the linux compilation process, but by other tools. Note that unless, for some reason, you need external files (e.g. you need modules or udev to identify or mount /), you don't need an initrd to boot.


According to documentation:


When you do:

make bzImage

and then:

cp bzImage vmlinuz

to create the vmlinuz file. Ie, they are the same file :-).

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.