Debian This forum is for the discussion of Debian Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
|
10-22-2004, 10:18 AM
|
#1
|
Senior Member
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445
Rep:
|
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?
|
|
|
10-22-2004, 12:11 PM
|
#2
|
Senior Member
Registered: Sep 2004
Location: Savannah, GA
Distribution: Ubuntu, Gentoo, Mythbuntu, ClarkConnect
Posts: 1,154
Rep:
|
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!
|
|
|
|
10-23-2004, 09:42 PM
|
#3
|
Senior Member
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445
Original Poster
Rep:
|
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?
|
|
|
10-24-2004, 07:27 AM
|
#4
|
Member
Registered: Mar 2004
Location: Netherlands
Distribution: Debian
Posts: 729
Rep:
|
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.
|
|
|
10-24-2004, 12:23 PM
|
#5
|
Senior Member
Registered: Sep 2004
Location: Savannah, GA
Distribution: Ubuntu, Gentoo, Mythbuntu, ClarkConnect
Posts: 1,154
Rep:
|
of course it doesn't apply to debian... but it did have a lot of info about what an initrd is...
|
|
|
10-25-2004, 01:38 PM
|
#6
|
Senior Member
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445
Original Poster
Rep:
|
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?
|
|
|
10-25-2004, 03:43 PM
|
#7
|
Member
Registered: Mar 2004
Location: Netherlands
Distribution: Debian
Posts: 729
Rep:
|
- 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.
|
|
|
10-25-2004, 03:50 PM
|
#8
|
Member
Registered: Jun 2004
Distribution: Ubuntu
Posts: 185
Rep:
|
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
|
|
|
10-26-2004, 12:14 PM
|
#9
|
Senior Member
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445
Original Poster
Rep:
|
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.
|
|
|
10-26-2004, 12:52 PM
|
#10
|
Member
Registered: Jun 2004
Distribution: Ubuntu
Posts: 185
Rep:
|
No prob. It just seems to be a lot of initrd.img questions at the moment...
/TLV
|
|
|
10-26-2004, 01:02 PM
|
#11
|
Senior Member
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445
Original Poster
Rep:
|
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
|
|
|
10-26-2004, 03:42 PM
|
#12
|
Member
Registered: Jun 2004
Distribution: Ubuntu
Posts: 185
Rep:
|
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.
|
|
|
10-27-2004, 10:46 AM
|
#13
|
Senior Member
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445
Original Poster
Rep:
|
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?
|
|
|
10-27-2004, 11:54 AM
|
#14
|
Member
Registered: Jun 2004
Distribution: Ubuntu
Posts: 185
Rep:
|
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
|
|
|
10-27-2004, 01:13 PM
|
#15
|
Member
Registered: Apr 2004
Location: Europe:Salzburg Austria USA:Orlando,Florida;
Distribution: Debian
Posts: 643
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 08:49 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|