LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   Why two files bzImage and vlinuz? (https://www.linuxquestions.org/questions/linux-kernel-70/why-two-files-bzimage-and-vlinuz-480015/)

asahlot 09-03-2006 09:28 AM

Why two files bzImage and vlinuz?
 
Hi all,
While compiling kernel source code, when we do

$ make bzImage

then we get two output files.
one is "bzImage" and other is "vmlinuz".

Q.1.Could someone please tell me what is the difference between these two files?

Now after $ make bzImage when we run
$ make install

two more files namely "initrd-x.x.x.img" and "vmlinuz-x.x.x" are created and placed in /boot directroy.

Q.2. Could someone please tell me how does "$make install" create these files, and what purpose these files fullfil, which one is actual kernel image, which is executed and why do we need these two files to run system cannot we have single image file?
And yeah when "$make bzImage" has already created image files i.e. bzImage and vmlinuz then why do we need to created these files further? I mean what is additional in these files to "bzImage" and "vmlinuz"?

Q.3. What is raw Image?

Please help me out in this regard.
Thanks in advance.
Best Regards,
arvind

acid_kewpie 09-04-2006 02:19 AM

i've not compiled a kernel for a little while actually, been living in ignorance in fedora, but you don't get "bzImage" and "vmlinuz", you get "bzImage" and "vmlinux" the bzImage file is a bzipped version of the vmlinux file, which you would then copy to /boot calling it vmlinuz. not sure why, but that's the way it's been.

asahlot 09-04-2006 08:20 AM

Thanks Chris..
Would someone else please answer??

:confused:

AwesomeMachine 09-04-2006 04:01 PM

bzImage is the compressed kernel according to your .config file. It is compressed, confusingly, with gzip. Vmlinuz is the kernel, and if you specify the location and name to grub it will boot the machine if you used mkinitrd to make initrd. You need to understand a little about a Makefile. Makefiles are scripts for building packages. Install is a common name for a script Make uses to install a package, but install doesn't make anything, it just installs, and might run some other program, like mkinitrd, which makes initrd. I can't explain Makefiles in a forum post, but I will say that the program "make' looks for a file named Makefile. If make finds a file with that name in the working directory it runs the file to build a package. You know how source software installs:

./configure
make
make install

A kernel is the same way, but the configure part is manual, not automatic.

Many people have more than one kernel they run. These can't all be called vmlinuz, so version numbers are attached. You need initrd because it is a ramdisk, and can load drivers for the HDD from system memory. Most systems prefer to use initrd, rather than compile everything into the kernel.

masonm 09-04-2006 05:19 PM

BzImage is the actual file created when you compile the kernel. vmlinuz is what you rename it when you put it in /boot (or is a symlink to the actual file).

The initrd is only needed if you didn't compile support for your filesystems into the kernel. If you compiled your file system support into the kernel (not as modules) then no initrd is needed. I always compile my file system support into my kernels.

There's actually nothing that says you have to call your kernel file vmlinuz in /boot. You can name it "fred" if you want, as long as you properly identify it in your bootloader config. Vmlinuz is a standard that's used, and most of us try to stick to the standards, but that's all it is. Call it whatever you like if you don't like vmlinuz for some reason.

I have multiple kernels. The primary one is vmlinuz, and then I have others with other names (vmlinuz with versions attached such as vmlinuz-amd, vmlinuz-2.4.32-generic, etc.

asahlot 09-05-2006 08:24 AM

Thanks a lot for your replies..

@AwesomeMachine--- Could you please tell me sth about ramdisk? what is this? is this hardware like its name contains disk or it is some software?


I think I am fool, know nthing abt linux.

Thanks in advance
Best Reagards,


All times are GMT -5. The time now is 05:42 PM.