LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 09-03-2006, 09:28 AM   #1
asahlot
Member
 
Registered: Sep 2005
Location: india
Distribution: Fedora Core 2
Posts: 62

Rep: Reputation: 15
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
 
Old 09-04-2006, 02:19 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
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.
 
Old 09-04-2006, 08:20 AM   #3
asahlot
Member
 
Registered: Sep 2005
Location: india
Distribution: Fedora Core 2
Posts: 62

Original Poster
Rep: Reputation: 15
Thanks Chris..
Would someone else please answer??

 
Old 09-04-2006, 04:01 PM   #4
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
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.
 
Old 09-04-2006, 05:19 PM   #5
masonm
Senior Member
 
Registered: Mar 2003
Location: Following the white rabbit
Distribution: Slackware64 -current
Posts: 2,300

Rep: Reputation: 90
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.
 
Old 09-05-2006, 08:24 AM   #6
asahlot
Member
 
Registered: Sep 2005
Location: india
Distribution: Fedora Core 2
Posts: 62

Original Poster
Rep: Reputation: 15
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,
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
HELP bzImage NTK Debian 2 08-25-2006 07:01 AM
Problems vlinuz and grub Gortex Linux - Newbie 5 01-07-2006 03:30 AM
bzImage!!! BattleAxe_19 Linux - General 2 12-22-2003 09:57 AM
bzImage.. help unmada Linux - Software 2 06-13-2002 11:59 PM
bzimage jnsc Linux From Scratch 13 04-16-2002 02:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 01:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration