LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices



Reply
 
Search this Thread
Old 10-22-2004, 10:18 AM   #1
microsoft/linux
Senior Member
 
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445
Blog Entries: 9

Rep: Reputation: 45
Kernel initrd.img?


I recently complied a custom kernel, Do I need to set an initrd.img for it? if so how do I go about doing so? ANything else I should know? After compilation it got a file vmlinux, should I have anything else?
 
Old 10-22-2004, 12:11 PM   #2
secesh
Senior Member
 
Registered: Sep 2004
Location: Savannah, GA
Distribution: Ubuntu, Gentoo, Mythbuntu, ClarkConnect
Posts: 1,154

Rep: Reputation: 47
debian?
--i don't think you need to worry about it, but here's some info:

Quote:
Slackware initrd mini HOWTO
by Patrick Volkerding, volkerdi@slackware.com
Sun Jun 20 01:38:41 PDT 2004

This document describes how to create and install an initrd, which may be
required to use the 2.6 kernel. Also see "man mkinitrd".

1. What is an initrd?
2. Why to I need an initrd?
3. How do I build the initrd?
4. Now that I've built an initrd, how do I use it?


1. What is an initrd?

Initrd stands for "initial ramdisk". An initial ramdisk is a very small
Linux filesystem that is loaded into RAM and mounted as the kernel boots,
and before the main root filesystem is mounted.

2. Why do I need an initrd?

The usual reason to use an initrd is because you need to load kernel
modules before mounting the root partition. Usually these modules are
required to support the filesystem used by the root partition (ext3,
reiserfs, xfs), or perhaps the controller that the hard drive is attached
to (SCSI, RAID, etc). Essentially, there are so many different options
available in modern Linux kernels that it isn't practical to try to ship
many different kernels to try to cover everyone's needs. It's a lot more
flexible to ship a generic kernel and a set of kernel modules for it. The
generic 2.6 kernel in Slackware supports the ext2 filesystem (which is
used by the initrd), and also supports most IDE controllers (much like the
old bare.i kernel). So, if you have an IDE based system that uses the
ext2 filesystem, then you will not need to use an initrd to boot.
Otherwise, read on.

3. How do I build the initrd?

The easiest way to make the initrd is to use the mkinitrd script included
in Slackware's mkinitrd package. We'll walk through the process of
upgrading to the 2.6.7 Linux kernel using the packages found in
Slackware's testing/packages/linux-2.6.7/ directory.

First, make sure the kernel, kernel modules, and mkinitrd package are
installed (the current version numbers might be a little different, so
this is just an example):

installpkg kernel-generic-2.6.7-i486-3.tgz
installpkg kernel-modules-2.6.7-i486-2.tgz
installpkg mkinitrd-1.0.1-i486-1.tgz

Change into the /boot directory:

cd /boot

Now you'll want to run "mkinitrd". I'm using reiserfs for my root
filesystem, and since it's an IDE system the reiserfs module will be
the only one I need to load:

mkinitrd -c -k 2.6.7 -m reiserfs

This should do two things. First, it will create a directory
/boot/initrd-tree containing the initrd's filesystem. Then it will
create an initrd (/boot/initrd.gz) from this tree. If you wanted to,
you could make some additional changes in /boot/initrd-tree/ and
then run mkinitrd again without options to rebuild the image. That's
optional, though, and only advanced users will need to think about that.

Here's another example: Build an initrd image using Linux 2.6.7 kernel
modules for a system with an ext3 root partition on /dev/hdb3. Note
that you need both the jbd and ext3 modules to use ext3:

mkinitrd -c -k 2.6.7 -m jbd:ext3 -f ext3 -r /dev/hdb3


4. Now that I've built an initrd, how do I use it?

Now that you've got an initrd (/boot/initrd.gz), you'll want to load
it along with the kernel at boot time. If you use LILO for your boot
loader you'll need to edit /etc/lilo.conf and add a line to load the
initrd. Here's an example section of lilo.conf showing how this is
done:

# Linux bootable partition config begins
image = /boot/vmlinuz-generic-2.6.7
initrd = /boot/initrd.gz
root = /dev/hda6
label = Linux267
read-only
# Linux bootable partition config ends

The initrd is loaded by the "initrd = /boot/initrd.gz" line.
Just add the line right below the line for the kernel image you use.
Save the file, and then run LILO again ('lilo' at the command line).
You'll need to run lilo every time you edit lilo.conf or rebuild the
initrd.

Other bootloaders such as syslinux also support the use of an initrd.
See the documentation for those programs for details on using an
initrd with them.


---------

Have fun!
 
Old 10-23-2004, 09:42 PM   #3
microsoft/linux
Senior Member
 
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445
Blog Entries: 9

Original Poster
Rep: Reputation: 45
thanks, you don't think I need a initrd.img? When I add my custom kernel to the grub menu.lst, it boot in and everything, then gets to loading the root file system and says is can't find it, but I've compared what I have to what is in my other working kernel and nothings different. Any ideas?
 
Old 10-24-2004, 07:27 AM   #4
Moloko
Member
 
Registered: Mar 2004
Location: Netherlands
Distribution: Debian
Posts: 729

Rep: Reputation: 30
If you compile filesystem support in the kernel you don't, otherwise you do. Use: "make-kpkg --initrd kernel-image" to build a kernel with an initrd image. The Slackware guide doesn't apply to Debian.
 
Old 10-24-2004, 12:23 PM   #5
secesh
Senior Member
 
Registered: Sep 2004
Location: Savannah, GA
Distribution: Ubuntu, Gentoo, Mythbuntu, ClarkConnect
Posts: 1,154

Rep: Reputation: 47
of course it doesn't apply to debian... but it did have a lot of info about what an initrd is...
 
Old 10-25-2004, 01:38 PM   #6
microsoft/linux
Senior Member
 
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445
Blog Entries: 9

Original Poster
Rep: Reputation: 45
when you say

Quote:
Use: "make-kpkg --initrd kernel-image"
I tried it without the --initrd it won't let me boot it because it's a .deb file. Will the same happen?
 
Old 10-25-2004, 03:43 PM   #7
Moloko
Member
 
Registered: Mar 2004
Location: Netherlands
Distribution: Debian
Posts: 729

Rep: Reputation: 30
- install with dpkg -i *.deb
- a built with --initrd creates a deb as well, install it and you get an initrd.img in /boot/ too.
 
Old 10-25-2004, 03:50 PM   #8
TLV
Member
 
Registered: Jun 2004
Distribution: Ubuntu
Posts: 185

Rep: Reputation: 30
Quote:
Originally posted by microsoft/linux
I tried it without the --initrd it won't let me boot it because it's a .deb file. Will the same happen?
You really, really, really should read some documentation when starting to compile the kernel. Debian has their own, somewhat unique way of compiling a kernel. Well, the compilation is the same, it's just that the Debian way creates a Debian-package of the whole kernelthingy and one can install the kernel just like any other package.

There's a sticky-thread in this forum. Read it.

http://www.linuxquestions.org/questi...hreadid=206992

Here's one resource. Read it.

http://www.desktop-linux.net/debkernel.htm

The .deb file is the package you need to install with the command:

dpkg -i whatever_filename.deb

/TLV
 
Old 10-26-2004, 12:14 PM   #9
microsoft/linux
Senior Member
 
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445
Blog Entries: 9

Original Poster
Rep: Reputation: 45
TLV,

I did look for documentation, I asked a question in this forum as to what I have to do. I didn't find any information other than the generic way as to how to compile a kernel. Thank you for the information. I'll read those. Thanks again.
 
Old 10-26-2004, 12:52 PM   #10
TLV
Member
 
Registered: Jun 2004
Distribution: Ubuntu
Posts: 185

Rep: Reputation: 30
No prob. It just seems to be a lot of initrd.img questions at the moment...

/TLV
 
Old 10-26-2004, 01:02 PM   #11
microsoft/linux
Senior Member
 
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445
Blog Entries: 9

Original Poster
Rep: Reputation: 45
yeah I noticed that, so with the .deb package and the ext3 filesystem built into the kernel, I do not need a initrd.img? Just trying to clarify
 
Old 10-26-2004, 03:42 PM   #12
TLV
Member
 
Registered: Jun 2004
Distribution: Ubuntu
Posts: 185

Rep: Reputation: 30
You need to have enough in the kernel so that it can survive the very first boot stage(s). This includes mainly the filesystem (ext2, ext3, xfs, or whatever you use for your '/' partition). It also includes support for your harddisk so the kernel can read from it - this is highly dependent on what hardware you have.

Once the kernel gets past the initial stage(s), it can load other functionality through modules.

I'm no kernel, nor a boot expert so perhaps other people can clarify what I try to explain. Or it can probably be found in some documentation.

The .deb package is just a conveniently packaged kernel binary (and then some). You have to actually install the package in order to use the kernel. "man dpkg" will get you started...

/TLV

Last edited by TLV; 10-26-2004 at 03:45 PM.
 
Old 10-27-2004, 10:46 AM   #13
microsoft/linux
Senior Member
 
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445
Blog Entries: 9

Original Poster
Rep: Reputation: 45
ok, judging form you last post, when I try to boot into the kernel and it tells me
Quote:
kernel panic: VFS: unable to mount root fs on unknown-block (0,0)
that probably means it doesn't recognize my harddrive?
 
Old 10-27-2004, 11:54 AM   #14
TLV
Member
 
Registered: Jun 2004
Distribution: Ubuntu
Posts: 185

Rep: Reputation: 30
Could be.

On my computer (laptop) I have the Intel 82801 chipset (as seen when doing a lspci). Besides the file system (ext3), what I have compiled in the kernel (not modules) related to my IDE drive is:

- ATA/ATAPI/MFM/RLL support
- Enhanced IDE/MFM/RLLL support
- Include IDE/ATA-2 DISK support
- IDE Taskfile IO (not sure why)
- PCI IDE chipset support
- Sharing PCI IDE interrupts support
- Generc PCI bus-master DMA support
- Use PCI DMA by default when available
- Intel PIIXn chipset support (very important this one)

Of course, your config may vary. It this doesn't help. Do it the trial'n'error way. Take a config known to work (with initrd.img). Compile individual modules into the kernel one by one, and don't use initrd...

I also have "RAM disk support" (device drivers/block devices) and CramFS (file systems/misc filesystems) in the kernel, though I'm not 100% that's really needed - I just never bothered to remove them.

/TLV
 
Old 10-27-2004, 01:13 PM   #15
utanja
Member
 
Registered: Apr 2004
Location: Europe:Salzburg Austria USA:Orlando,Florida;
Distribution: Debian
Posts: 625

Rep: Reputation: 32
Quote:
RAM disk support" (device drivers/block devices) and CramFS (file systems/misc filesystems)
i run 2.6.8 without initrd.img...and do not have installed in the kernel
utanja

Last edited by utanja; 10-27-2004 at 01:14 PM.
 
  


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
Where to find initrd .img and kernel parameter satimis Linux From Scratch 10 08-06-2005 05:23 AM
how to make initrd.img for your kernel without boot disk? donaldtalbert Linux - Software 1 06-19-2005 11:30 PM
initrd.img GONE after kernel instal?!?! denniz Debian 5 08-17-2004 04:55 PM
no initrd.img after install of new kernel? denniz Linux - General 1 08-17-2004 10:25 AM
no initrd.img after upgrading kernel buknoy Linux - General 1 10-10-2003 05:22 AM


All times are GMT -5. The time now is 01:25 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration