# Configuring kernel for acpi, errors

## brandon_r87

Hi,

I'm using Gentoo for the first time and trying to configure my kernel.  I've never had to do this, so I'm making a few mistakes.  First of all, when I run 

```
make && make modules_install
```

I get this in my output

```
...

MODPOST WARNING: drivers/acpi/processor.o - Section mismatch: reference to .init.data: from .text between 'acpi_processor_power_init' (at offset 0xf96) and 'acpi_safe_halt'
```

When I boot, it freezes during the load

```
...

VFS: Cannot open root device "ram0" or unknown-block(0,0)

Please append a correct "root=" boot option

...

Kernel panic - not syncing: VFS: unable to mount root fs on unknown-block(0,0)
```

I'm running a Dell Inspiron 1300, Pentium M and I'm trying to enabl acpi in the kernel.

Brandon

----------

## cokey

post grub.conf and tell us your partition layout please

----------

## brandon_r87

Here's my partitions:

hda1 - 47MB FAT16 (Dell Diagnostics)

hda2 - 26.34GB NTFS (WinXP)

hda3 - 101.98MB ext2 (Boot)

hda4 - 29.4GB (extended)

   hda5 - 988.34MB (swap)

   hda6 - 28.44GB ext3 (gentoo)

here's grub.conf.  The one titled Gentoo (Brandon) is the kernel I'm having trouble with, the other is just from gentoo-sources.

http://www.freewebs.com/mxpx_bea/grub.conf

----------

## cokey

 *brandon_r87 wrote:*   

> Here's my partitions:
> 
> hda1 - 47MB FAT16 (Dell Diagnostics)
> 
> hda2 - 26.34GB NTFS (WinXP)
> ...

 

```
default 0

timeout 30

splashimage=(hd0,2)/grub/splash.xpm.gz

title=Gentoo Linux

root (hd0,2)

kernel /kernel-genkernel-x86-2.6.17-gentoo-r7 root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/hda6 

initrd /initramfs-genkernel-x86-2.6.17-gentoo-r7

title=Possible Windows P2

rootnoverify (hd0,1)

makeactive

chainloader +1

title Gentoo Linux

   root (hd0,2)

   kernel /kernel-genkernel-x86-2.6.17-gentoo-r7 root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/hda6

   initrd /initramfs-genkernel-x86-2.6.17-gentoo-r7

title Gentoo Linux (Brandon)

   root (hd0,2)

   kernel /kernel-2.6.17-gentoo-richard root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/hda6

   initrd /initramfs-genkernel-x86-2.6.17-gentoo-r7

title Windows XP Home Edition

   rootnoverify (hd0,1)

   makeactive

   chainloader +1
```

(just so others can see it)

Should /initramfs-genkernel-x86-2.6.17-gentoo-r7 be there when it is exactly the same as the one above? Isn't the name wrong?

----------

## brandon_r87

I've decided that while I might be able to fix the kernel I've been working on, since it's my first time doing this, I'd like to take my working kernel configuration and try to start from that, rather than starting from scratch.  Is there anyway to do this?

----------

## cokey

 *brandon_r87 wrote:*   

> I've decided that while I might be able to fix the kernel I've been working on, since it's my first time doing this, I'd like to take my working kernel configuration and try to start from that, rather than starting from scratch.  Is there anyway to do this?

 save the config file somewhere, unpack the new kernel but *dont* compile it then: 

```
cd /usr/src/linux

make mrproper

cp <old config> /usr/src/linux/.config

make oldconfig
```

----------

## brandon_r87

Maybe you don't understand what I'm saying, or maybe I just don't understand, but I don't think I have a config file for the kernel I'm using.  It was automatically configured for me, but without some of the things I want.  I'm also not sure what you mean by "new kernel."  I just want to take the kernel out of /boot and reconfigure that if possible.  Otherwise, I'd like to have something detect my hardware and configure the kernel based on that, if that's even possible.

----------

## cokey

 *brandon_r87 wrote:*   

> Maybe you don't understand what I'm saying, or maybe I just don't understand, but I don't think I have a config file for the kernel I'm using.  It was automatically configured for me, but without some of the things I want.  I'm also not sure what you mean by "new kernel."  I just want to take the kernel out of /boot and reconfigure that if possible.  Otherwise, I'd like to have something detect my hardware and configure the kernel based on that, if that's even possible.

 Aaahhhhhhhhhhhhhhhhhhhhhhhhhhhhhh  :Idea:  I get it now!

Right. By new kernel i meant... another new kernel, as in scrap the one that is in /usr/src. Also the file that is in /boot is not a kernel, it is an executable and bootable kernel image, bzImage or vmlinux/z.

I think you should leave the idea of a automatically generated kernel behind. Find out what hardware you have and compile your kernel manually and when something goes wrong just ask here and we can help you add it in, soon you'll be doing your own kernels all over the place and you'll wonder why you never did before.

http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=7#doc_chap3

delete the file that /usr/src/linux is symlinked to and delete that image out of boot and start again following the instructions

----------

## brandon_r87

This is the tutorial I followed the first time that I screwed up with, but now that I've given it a shot maybe it will make more sense.  I'll give it another try tomorrow, but I have some questions in the mean time.  I'm not sure what you meant by "delete the file that /usr/src/linux is symlinked to."  Deleting the image I think I understood, that was the file I copied to /boot after configuring and making the kernel, right? I deleted all my different test images that failed then.  I accidentily saved over the .config, so is there a way to get it back to the default?

----------

## cokey

ok, easy way to sort this out.

First delete all the kernel files in /boot, those will be the System.Map files (if you copied them over) the .config files (if you copied them over) and the kernel images.

Then go to /usr/src and delete all the files *except* the linux directory. Do a ls -al to make sure that the only thing in there is a directory called "linux" and it is not symlinked to anything.

Then emerge gentoo-sources That will take everything back to how it was before anything happened and you should have a directory in /usr/src called linux-2.6.XX-blah-blah

then 

```
ln -s /usr/src/linux-2.6.XX-blah /usr/src/linux
```

then go through the configuring the kernel part again.

It took me a couple of goes to get my kernel right, i'd find that i had missed something out and recompile but it is very simple to fix, you just add the bit you missed out and make && make modules_install

----------

## brandon_r87

Ok, It stopped with the same error

```
VFS: Cannot open root device "ram0" or unknown-block(0,0)

Please append a correct "root=" boot option

Kernel panic - not syncing: VFS: unable to mount root fs on unknown-block(0,0)
```

I'm obviously missing something in the kernel or the way it's booted in grub.

----------

## cokey

 *brandon_r87 wrote:*   

> Ok, It stopped with the same error
> 
> ```
> VFS: Cannot open root device "ram0" or unknown-block(0,0)
> 
> ...

 This time we are going to write the grub.conf differently. You should take a look in the handbook about grub, i think it will think that you have compiled your kernel by hand so we need to set up grub without the genkernel specific options ram0 etc

change this:

```
title Gentoo Linux (Brandon)

   root (hd0,2)

   kernel /kernel-2.6.17-gentoo-richard root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/hda6

   initrd /initramfs-genkernel-x86-2.6.17-gentoo-r7 
```

to this:

```
title Gentoo Linux (Brandon)

   root (hd0,2)

   kernel /kernel-2.6.17-gentoo-richard root=/dev/hda6

```

Change the kernel /kernel-2.6.17-gentoo-richard line to whatever you have called the kernel that is in /boot

----------

## cokey

If this all works i want you compiling your own kernel from now on ok?  :Wink:  All you have to do is know what hardware you have (mobo bits, chipset, graphics card, sound card) what fs you want (very important) and you can go through and have a look at other bit's you might want. If you dont understand any of it then just ask, that is why Gentoo is know for it's community  :Smile: 

----------

## brandon_r87

```
default 1

timeout 30

splashimage=(hd0,2)/grub/splash.xpm.gz

title=Gentoo Linux

root (hd0,2)

kernel /kernel-genkernel-x86-2.6.17-gentoo-r7 root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/hda6 

initrd /initramfs-genkernel-x86-2.6.17-gentoo-r7

title=Possible Windows P2

rootnoverify (hd0,1)

makeactive

chainloader +1

title Gentoo Linux

   root (hd0,2)

   kernel /kernel-genkernel-x86-2.6.17-gentoo-r7 root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/hda6

   initrd /initramfs-genkernel-x86-2.6.17-gentoo-r7

title Possible Windows P2

   rootnoverify (hd0,1)

   makeactive

   chainloader +1

title Gentoo Linux

   root (hd0,2)

   kernel /kernel-genkernel-x86-2.6.17-gentoo-r7 root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/hda6

   initrd /initramfs-genkernel-x86-2.6.17-gentoo-r7

title Gentoo Linux (Test Kernel)

   root (hd0,2)

   kernel /kernel-2.6.17-eins root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/hda6

   initrd /kernel-2.6.17-eins

title Possible Windows P2

   rootnoverify (hd0,1)

   makeactive

   chainloader +1
```

Don't ask me why some of the options repeat, I have deleted them out using Gnome's boot wizard several times, but on each reboot they duplicate.  I tried fixing what you mentioned earlier about initrd not saying the same thing as kernel, but it didn't seem to help.

----------

## cokey

 *brandon_r87 wrote:*   

> 
> 
> ```
> default 1
> 
> ...

 Why are you using gnome's boot wizard? This is Gentoo, you edit the configs by hand.

Open up gedit or gvim or nano as root and edit it by hand.

Ok, i'll give you your grub.conf:

```
default 0

timeout 30

splashimage=(hd0,2)/grub/splash.xpm.gz

title=Gentoo Linux

root (hd0,2)

kernel /kernel-genkernel-x86-2.6.17-gentoo-r7 root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/hda6 

initrd /initramfs-genkernel-x86-2.6.17-gentoo-r7

title Gentoo Linux (Brandon)

   root (hd0,2)

   kernel /kernel-2.6.17-gentoo-richard root=/dev/hda6

title Gentoo Linux (Test Kernel)

   root (hd0,2)

   kernel /kernel-2.6.17-eins root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/hda6

   initrd /kernel-2.6.17-eins

title Windows XP

   rootnoverify (hd0,1)

   makeactive

   chainloader +1

```

The first one was the original one that worked (i think).

EDIT GRUB.CONF BY HAND!

----------

## brandon_r87

 *Quote:*   

> EDIT GRUB.CONF BY HAND!

 

 :Smile:   OK... Even though I'm doing this mostly to learn, I suppose I still always want to take the easy way out.  I'll just have to remember that if I wanted it easy, I could just throw Ubuntu on there and that isn't what I want to do.

Aside from that, I don't see how you've changed grub.conf any besides cleaning it up.  I looked at the differences between the working and nonworking and noticed initrd was different between them, so I tried this:

```
title Gentoo Linux (Test Kernel)

   root (hd0,2)

   kernel /kernel-2.6.17-eins root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/hda6

   initrd /initramfs-kernel-2.6.17-eins
```

I figured it wouldn't work and I was correct.  It gives me an error, file not found.  I recall initrd or initramfs being something I can enable when configuring the kernel, so would this create that file?  I'm probably way off, but I don't really know what else to even try.

----------

## cokey

No, the main bit i changed was this.

```
title Gentoo Linux (Brandon)

   root (hd0,2)

   kernel /kernel-2.6.17-gentoo-richard root=/dev/hda6 
```

Ok, it says file not found.

Give me an 

```
ls /boot
```

Also, when you remade your kernel, did you copy over the new bzImage and .config to /boot?

----------

## brandon_r87

Oh, I have deleted that kernel file now.  Now the one I am working with is kernel-2.6.17-eins, so I see what you've changed now.

I just tried it and now I get the same error, except instead of saying Cannot open root device "ram0" it says "hda6"  The rest of the error is the same after that.

----------

## cokey

 *brandon_r87 wrote:*   

> Oh, I have deleted that kernel file now.  Now the one I am working with is kernel-2.6.17-eins, so I see what you've changed now.
> 
> I just tried it and now I get the same error, except instead of saying Cannot open root device "ram0" it says "hda6"  The rest of the error is the same after that.

 heh, i think i see what you have done now, 

change 

kernel /kernel-2.6.17-eins root=/dev/hda6 

to 

kernel /kernel-2.6.17-eins root=/dev/hda5

----------

## brandon_r87

Yes, I actually thought about that as I was in class, but it doesn't work.  It just swaps "hda5" into the error where "ram0" was.  I think root=/dev/hda6 is correct because that is how it is set up with my working configuration.

Edit: I also tried it with 

```
title Gentoo Linux (Test Kernel)

   root (hd0,2)

   kernel /kernel-2.6.17-eins root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/hda5

   initrd /initramfs-kernel-2.6.17-eins
```

but this didn't work either.

----------

## cokey

ok, 

```
unable to mount root fs on unknown-block(0,0)
```

usually means that the driver for your storage driver isn't loaded in the kernel (which i find hard to believe).

If you are in the kernel that works now can you post the output of lspci

----------

## brandon_r87

```
00:00.0 Host bridge: Intel Corporation Mobile 915GM/PM/GMS/910GML Express Processor to DRAM Controller (rev 03)

00:02.0 VGA compatible controller: Intel Corporation Mobile 915GM/GMS/910GML Express Graphics Controller (rev 03)

00:02.1 Display controller: Intel Corporation Mobile 915GM/GMS/910GML Express Graphics Controller (rev 03)

00:1b.0 Audio device: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) High Definition Audio Controller (rev 03)

00:1c.0 PCI bridge: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) PCI Express Port 1 (rev 03)

00:1c.3 PCI bridge: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) PCI Express Port 4 (rev 03)

00:1d.0 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #1 (rev 03)

00:1d.1 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #2 (rev 03)

00:1d.2 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #3 (rev 03)

00:1d.3 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #4 (rev 03)

00:1d.7 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB2 EHCI Controller (rev 03)

00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev d3)

00:1f.0 ISA bridge: Intel Corporation 82801FBM (ICH6M) LPC Interface Bridge (rev 03)

00:1f.1 IDE interface: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) IDE Controller (rev 03)

02:00.0 Ethernet controller: Broadcom Corporation BCM4401-B0 100Base-TX (rev 02)02:03.0 Network controller: Intel Corporation PRO/Wireless 2200BG Network Connection (rev 05)
```

There's my lspci output.  I actually thought of that earlier, so I did some research on my drive.  It connects through Ultra ATA, which I read up on and it seemed to be an update of regular ATA, so I wasn't sure if I needed SCSI and SATA drivers.

Edit: I already had SCSI support, but I'm now adding 

Device Drivers

     SCSI Driver Support

          SCSI Lowlevel Drivers

               [*] Serial ATA (SATA) Support

                    [*] Intel PIIX/ICH SATA support 

I think the Intel ICH one is the one that matches my lspci output because I keep seeing "ICH6 Family."

----------

## brandon_r87

Still does not work...

----------

## cokey

do a quick grep of the .config for the SATA stuff:

```
cat /usr/src/linux.config | grep SATA
```

----------

## brandon_r87

Doing a grep on linux.config turned up a file not found, so I did it on .config which is what it has been saving changes to I think.

```
# CONFIG_BLK_DEV_IDE_SATA is not set

CONFIG_SCSI_SATA=y

# CONFIG_SCSI_SATA_AHCI is not set

# CONFIG_SCSI_SATA_SVW is not set

# CONFIG_SCSI_SATA_MV is not set

# CONFIG_SCSI_SATA_NV is not set

# CONFIG_SCSI_SATA_QSTOR is not set

# CONFIG_SCSI_SATA_PROMISE is not set

# CONFIG_SCSI_SATA_SX4 is not set

# CONFIG_SCSI_SATA_SIL is not set

# CONFIG_SCSI_SATA_SIL24 is not set

# CONFIG_SCSI_SATA_SIS is not set

# CONFIG_SCSI_SATA_ULI is not set

# CONFIG_SCSI_SATA_VIA is not set

# CONFIG_SCSI_SATA_VITESSE is not set

CONFIG_SCSI_SATA_INTEL_COMBINED=y

```

----------

## cokey

 *brandon_r87 wrote:*   

> Doing a grep on linux.config turned up a file not found, so I did it on .config which is what it has been saving changes to I think.

 sorry, that was a typo, i missed out the "/" 

 *brandon_r87 wrote:*   

> 
> 
> ```
> # CONFIG_BLK_DEV_IDE_SATA is not set
> 
> ...

 hmmmm, that all looks fine as well. I think you should ask Neddy Seagoon to help you on this, he knows more than me. Can you get on to IRC and go to #gentoo-forums on freenode and ask him for help because i'm all out of ideas

----------

## brandon_r87

For some reason, I can't connect to freenode, it always reports Connection Refused.  I figured it was down, so I waited a a few days and tried again.  I've never connected to freenode before, so is there something I need to do first?

----------

## cokey

Just PM him here. Tell him about your freenode problem as well  :Very Happy: 

----------

## NeddySeagoon

brandon_r87,

Your imediate problem is that with a self configured kernel, you don't you a initrd to get you started.

From your error, 

```
VFS: Cannot open root device "ram0" or unknown-block(0,0) 
```

the kernel has loaded but then failing to mount the initrd as its temporary root. 

Your grub.conf entry should look something like 

```
title Gentoo Linux (Test Kernel)

root (hd0,2)

kernel /kernel-2.6.17-eins root=/dev/hda6

```

notice the complete absence of initrd related items ?

To boot now, the kernel must have everything it needs to start built in, not modules. 

Your IDE disk setup for your kernel is covered here Even though it says its for ICH4 chipsets, the setup is valid for all the Intel ICH series up to and including ICH6, which is what you have. You don't have SATA/SCSI, so you don't need the Low Level SCSI drivers.  Leave SCSI Disk support - its needed for USB storage devices. 

For freenode, point your IRC client at irc.freenode.net.

----------

## brandon_r87

It works! Thank you very much!

Edit: And about freenode, that's where I had my IRC client pointed.  It would then direct me to a mirror which wouldn't work and then move to a different one.  I'd come back half an hour later and still be getting Connection Refused.

----------

