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)?
-
4Did 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 09: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 09:05
-
1You 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 09: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 09:18
-
Lots of the comments above look like good answers to me. – James Youngman May 16 '12 at 15:05
2 Answers
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.
- 13,345
- 1
- 27
- 29
According to documentation:
http://tldp.org/LDP/lame/LAME/linux-admin-made-easy/kernel-custom.html
When you do:
make bzImage
and then:
cp bzImage vmlinuz
to create the vmlinuz file. Ie, they are the same file :-).
- 267
- 2
- 7