LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 11-02-2003, 09:47 PM   #1
britishnemesis
LQ Newbie
 
Registered: Oct 2003
Posts: 14

Rep: Reputation: 0
How do you make a initrd and vmlinux file?


I just compiled my very own 2.6 test 9 kernel for the first time. However it complains at boot that it needs an initrd file (and I assume a vmlinux file as well). How can I make these files?
 
Old 11-02-2003, 10:14 PM   #2
exodist
Senior Member
 
Registered: Aug 2003
Location: Portland, Oregon
Distribution: Gentoo
Posts: 1,372

Rep: Reputation: 46
hm, initrd is part of lilo I believe, did you deleate old one?
if by vmlinux you are refering to kernel image it is in:
/usr/src/linux[or path to kernel source dir]/arch/i386/boot/bzImage that is usually copied to /boot/vmlinuz

that is hopefully helpful.
 
Old 11-02-2003, 10:40 PM   #3
Robert0380
Guru
 
Registered: Apr 2002
Location: Atlanta
Distribution: Gentoo
Posts: 1,280

Rep: Reputation: 47
hold on, as soon as i find the script in genkernel that creates one i'll post it (a gentoo thing)
 
Old 11-02-2003, 10:45 PM   #4
Robert0380
Guru
 
Registered: Apr 2002
Location: Atlanta
Distribution: Gentoo
Posts: 1,280

Rep: Reputation: 47
Code:
initrd() {
        ebegin "Creating initrd"
        local modc i mods mymod
        for modc in storage firewire ataraid pcmcia usb
        do
                install -d ${TEMP}/kernel-initrd/modules/${modc}
                mods=`echo $modc | tr [:lower:] [:upper:]`_MODULES
                for i in ${!mods}
                do
                        mymod=`find /lib/modules/${KV} -name "${i}.o"`
                        if [ -z "${mymod}" ]
                        then
                                echo "Warning: ${i}.o not found; skipping..."
                                continue
                        fi
                        cp $mymod ${TEMP}/kernel-initrd/modules/${modc}
                done
        done
        #tweak our storage module settings based on our initrd
        cat ${GK_SHARE}/linuxrc | sed -e "s/##STORAGE_MODULES##/${STORAGE_MODULES}/" \
                                        -e "s/##FIREWIRE_MODULES##/${FIREWIRE_MODULES}/" \
                                        -e "s/##ATARAID_MODULES##/${ATARAID_MODULES}/" \
                                        -e "s/##PCMCIA_MODULES##/${PCMCIA_MODULES}/" \
                                        -e "s/##USB_MODULES##/${USB_MODULES}/" \
                                        > ${TEMP}/kernel-initrd/linuxrc
        chmod +x ${TEMP}/kernel-initrd/linuxrc
        umount ${TEMP}/initrd
if [ $BOOTSPLASH = "yes" ]
        then
        ebegin "Adding Bootsplash Initrd"
        cat ${BOOT_SPLASH_INITRD} >> ${TEMP}/initrd || die
        cp -f ${TEMP}/initrd /boot/initrd-${KV}
        eend
        else
        gzip -f -9 ${TEMP}/initrd
        mv -f ${TEMP}/initrd.gz /boot/initrd-${KV}
        eend
fi
}
i have NO CLUE how this works man, in Gentoo all i have to do is:

genkernel and it compiles the kernel for me (baring i have set the symbolic link /usr/src/linux to point to the kernel source tree) and it also creates and install initrd.

if i want to configure the kernel

genkernel --config

and it adds make menuconfig to the mix so i can configure it. what i have posted is the initrd( ) function from that shell script.
 
Old 11-02-2003, 10:49 PM   #5
Robert0380
Guru
 
Registered: Apr 2002
Location: Atlanta
Distribution: Gentoo
Posts: 1,280

Rep: Reputation: 47
oh, initrd is not part of lilo, it stands for initial root disk and contains some config info for booting. it isnt really needed and in gentoo if you compile your own kernel you wont make one (it even tell you that you will leave the initrd line out of the <brand-name>.conf file (where brand-name is lilo or grub).

so basically, you SHOULDNT need one but i dont know much about the 2.6 kernel.
 
Old 11-02-2003, 10:49 PM   #6
chii-chan
Member
 
Registered: Sep 2003
Location: chikyuu (E103N6)
Distribution: Redhat 8.0 (2.4.25-custom), Fedora Core 1 (2.4.30-custom)
Posts: 357

Rep: Reputation: 30
Hi!

I suppose that you use grub. To make initrd file.

->su -
password:******
->mkinitrd /boot/initrd-2.6-xxxx.img 2.6-xxx

The last part [2.6-xxx] refers to /lib/modules/2.6-xxx dir.

The mkinitrd is located in /sbin or /usr/sbin dir [which one?].

But as far as I know the kernel compilation for 2.6 has some command to install all those files (initrd, vmlinuz and the other one [I can't check it now since I'm using windows on public computer]) in the /boot dir.

But the way to make initrd that described above is for 2.4. Is it the same as for 2.6?



 
Old 11-02-2003, 10:50 PM   #7
exodist
Senior Member
 
Registered: Aug 2003
Location: Portland, Oregon
Distribution: Gentoo
Posts: 1,372

Rep: Reputation: 46
2.6 does not need one, I use it and have never made one, and there is no reference to it in my lilo, i assumed that it used it if it needed it and left it in the /boot dir.
 
Old 11-02-2003, 10:59 PM   #8
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,111

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
hmm, i'm not sure how to make initrd images, i usually end up doing without them, i'm not sure they're required in fact they support for initial ram disks can even be compiled out of the kernel. as for vmlinuz files, that's done by recompiling the kernel
 
Old 11-02-2003, 11:08 PM   #9
exodist
Senior Member
 
Registered: Aug 2003
Location: Portland, Oregon
Distribution: Gentoo
Posts: 1,372

Rep: Reputation: 46
Oh! arent initrd images the splash screen ? like in suse/redhat where it has a background image for lilo?
 
Old 11-03-2003, 04:00 AM   #10
Robert0380
Guru
 
Registered: Apr 2002
Location: Atlanta
Distribution: Gentoo
Posts: 1,280

Rep: Reputation: 47
there is splash stuff in the initrd but it contains some config info. if you compile your own kernel you dont need it.
 
Old 11-03-2003, 10:30 AM   #11
vasudevadas
Member
 
Registered: Jul 2003
Location: Bedford, UK
Distribution: Slackware 11.0, LFS 6.1
Posts: 519

Rep: Reputation: 30
<Oh! arent initrd images the splash screen ? like in suse/redhat where it has a background image for lilo?>

Nope - INITial RamDisk. I think the original point of them was that, when booting linux, the filesystems were first mounted read-only, so the initial ram disk provides a file system where temporary files can be written to, until the filesystems are remounted as read/write.

They don't seem always to be necessary; I've compiled kernels and used them without OK, although I tend to use them by default because Mandrake uses them and, if I compile a kernel and do "make install," it creates an initrd image automatically and tells lilo to use it.
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
where are the files: vmlinux, initrd.gz ??? kate boardman Debian 1 09-05-2005 08:47 PM
making kernel RPM. does not make initrd file mindcry Linux - Software 5 08-12-2004 11:20 PM
make: *** [vmlinux] Error 1 abefroman Mandriva 0 04-26-2004 03:33 PM
initrd how to make one? watashiwaotaku7 Linux - General 18 03-20-2004 12:53 AM
New Kernel 2.4.22 won't make initrd jon1591 Linux - Newbie 3 12-13-2003 03:09 PM


All times are GMT -5. The time now is 06:54 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration