# Problems compiling the kernel

## lince_0011

Hello everyone ...

I installed Gentoo, but I can not even starting the kernel ..

The system was installed on an HP Pavilion G4, but I think I have problems with the part of the hard disk drivers ..

I added support for my SATA drive, but obviously I'm missing something that even the kernel does not start ..

When I boot my system the kernel is frozen and this message appears:

```
Begin waiting for root file system..

ALERT! /dev/sda1 does not exist. Dropping to a shell!
```

Here is my kernel config:

http://pastebin.com/HVKcY2TH

lspci -n:

```
00:00.0 0600: 1022:1410

00:01.0 0300: 1002:9990

00:01.1 0403: 1002:9902

00:04.0 0604: 1022:1414

00:10.0 0c03: 1022:7812 (rev 03)

00:10.1 0c03: 1022:7812 (rev 03)

00:11.0 0106: 1022:7804

00:12.0 0c03: 1022:7807 (rev 11)

00:12.2 0c03: 1022:7808 (rev 11)

00:13.0 0c03: 1022:7807 (rev 11)

00:13.2 0c03: 1022:7808 (rev 11)

00:14.0 0c05: 1022:780b (rev 14)

00:14.2 0403: 1022:780d (rev 01)

00:14.3 0601: 1022:780e (rev 11)

00:14.4 0604: 1022:780f (rev 40)

00:14.5 0c03: 1022:7809 (rev 11)

00:15.0 0604: 1022:43a0

00:15.1 0604: 1022:43a1

00:18.0 0600: 1022:1400

00:18.1 0600: 1022:1401

00:18.2 0600: 1022:1402

00:18.3 0600: 1022:1403

00:18.4 0600: 1022:1404

00:18.5 0600: 1022:1405

02:00.0 0280: 168c:0032 (rev 01)

04:00.0 ff00: 10ec:5229 (rev 01)

05:00.0 0200: 10ec:8136 (rev 05)

```

lspci:

```
00:00.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 10h-1fh) Processor Root Complex

00:01.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Trinity [Radeon HD 7520G]

00:01.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Trinity HDMI Audio Controller

00:04.0 PCI bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 10h-1fh) Processor Root Port

00:10.0 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB XHCI Controller (rev 03)

00:10.1 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB XHCI Controller (rev 03)

00:11.0 SATA controller: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode]

00:12.0 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB OHCI Controller (rev 11)

00:12.2 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB EHCI Controller (rev 11)

00:13.0 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB OHCI Controller (rev 11)

00:13.2 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB EHCI Controller (rev 11)

00:14.0 SMBus: Advanced Micro Devices, Inc. [AMD] FCH SMBus Controller (rev 14)

00:14.2 Audio device: Advanced Micro Devices, Inc. [AMD] FCH Azalia Controller (rev 01)

00:14.3 ISA bridge: Advanced Micro Devices, Inc. [AMD] FCH LPC Bridge (rev 11)

00:14.4 PCI bridge: Advanced Micro Devices, Inc. [AMD] FCH PCI Bridge (rev 40)

00:14.5 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB OHCI Controller (rev 11)

00:15.0 PCI bridge: Advanced Micro Devices, Inc. [AMD] Hudson PCI to PCI bridge (PCIE port 0)

00:15.1 PCI bridge: Advanced Micro Devices, Inc. [AMD] Hudson PCI to PCI bridge (PCIE port 1)

00:18.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 10h-1fh) Processor Function 0

00:18.1 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 10h-1fh) Processor Function 1

00:18.2 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 10h-1fh) Processor Function 2

00:18.3 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 10h-1fh) Processor Function 3

00:18.4 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 10h-1fh) Processor Function 4

00:18.5 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 10h-1fh) Processor Function 5

02:00.0 Network controller: Qualcomm Atheros AR9485 Wireless Network Adapter (rev 01)

04:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS5229 PCI Express Card Reader (rev 01)

05:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller (rev 05)

```

hwinfo:

```
hwinfo | grep SATA

  E: ID_MODEL_FROM_DATABASE=FCH SATA Controller [AHCI mode]

  E: ID_PCI_SUBCLASS_FROM_DATABASE=SATA controller

  E: ID_ATA_SATA=1

  E: ID_ATA_SATA_SIGNAL_RATE_GEN1=1

  E: ID_ATA_SATA_SIGNAL_RATE_GEN2=1

  E: ID_ATA_SATA=1

  E: ID_ATA_SATA_SIGNAL_RATE_GEN1=1

  E: ID_ATA_SATA_SIGNAL_RATE_GEN2=1

  E: ID_ATA_SATA=1

  E: ID_ATA_SATA_SIGNAL_RATE_GEN1=1

  E: ID_ATA_SATA_SIGNAL_RATE_GEN2=1

  E: ID_ATA_SATA=1

  E: ID_ATA_SATA_SIGNAL_RATE_GEN1=1

  E: ID_ATA_SATA_SIGNAL_RATE_GEN2=1

  E: ID_ATA_SATA=1

  E: ID_ATA_SATA_SIGNAL_RATE_GEN1=1

  E: ID_ATA_SATA_SIGNAL_RATE_GEN2=1

  E: ID_ATA_SATA=1

  E: ID_ATA_SATA_SIGNAL_RATE_GEN1=1

  E: ID_ATA_SATA_SIGNAL_RATE_GEN2=1

  E: ID_ATA_SATA=1

  E: ID_ATA_SATA_SIGNAL_RATE_GEN1=1

  E: ID_ATA_SATA_SIGNAL_RATE_GEN2=1

  E: ID_ATA_SATA=1

  E: ID_ATA_SATA_SIGNAL_RATE_GEN1=1

17: PCI 11.0: 0106 SATA controller (AHCI 1.0)

  Model: "AMD SATA controller"

  Attached to: #17 (SATA controller)

  Attached to: #17 (SATA controller)

```

lsmod in live CD:

```
Module                  Size  Used by

uvcvideo               61372  0 

videodev               64318  1 uvcvideo

v4l1_compat            15578  2 uvcvideo,videodev

v4l2_compat_ioctl32    10212  1 videodev

joydev                 10055  0 

hp_wmi                  5932  0 

rfkill                 15882  1 hp_wmi

hp_accel               13384  0 

lis3lv02d               8131  1 hp_accel

input_polldev           3186  1 lis3lv02d

led_class               2331  1 hp_accel

video                  19305  0 

output                  1940  1 video

ac                      3105  0 

battery                10231  0 

button                  4834  0 

thermal                12242  0 

shpchp                 26453  0 

processor              25936  2 

snd_hda_codec_idt      55153  1 

psmouse                52592  0 

pci_hotplug            24287  1 shpchp

wmi                     8051  1 hp_wmi

snd_hda_codec_atihdmi     2739  1 

i2c_piix4               8192  0 

i2c_core               18790  2 videodev,i2c_piix4

snd_seq_dummy           1431  0 

snd_seq_oss            28760  0 

snd_seq_midi_event      5436  1 snd_seq_oss

snd_seq                50082  5 snd_seq_dummy,snd_seq_oss,snd_seq_midi_event

evdev                   8519  15 

serio_raw               4486  0 

snd_hda_intel          22317  0 

snd_hda_codec          79288  3 snd_hda_codec_idt,snd_hda_codec_atihdmi,snd_hda_intel

snd_pcm_oss            39221  0 

snd_mixer_oss          17106  1 snd_pcm_oss

snd_usb_audio          85240  0 

snd_pcm                71953  4 snd_hda_intel,snd_hda_codec,snd_pcm_oss,snd_usb_audio

snd_timer              19265  2 snd_seq,snd_pcm

snd_page_alloc          7249  2 snd_hda_intel,snd_pcm

snd_hwdep               6110  2 snd_hda_codec,snd_usb_audio

snd_usbmidi_lib        18212  1 snd_usb_audio

snd_rawmidi            19205  1 snd_usbmidi_lib

snd_seq_device          5297  4 snd_seq_dummy,snd_seq_oss,snd_seq,snd_rawmidi

snd                    57562  14 snd_hda_codec_idt,snd_seq_oss,snd_seq,snd_hda_intel,snd_hda_codec,snd_pcm_oss,snd_mixer_oss,snd_usb_audio,snd_pcm,snd_timer,snd_hwdep,snd_usbmidi_lib,snd_rawmidi,snd_seq_device

soundcore               5969  1 snd

squashfs               27079  2 

loop                   15194  4 

aufs                  178834  727 

exportfs                3530  1 aufs

udf                    82548  1 

crc_itu_t               1297  1 udf

sg                     25652  0 

sr_mod                 14954  1 

cdrom                  35851  1 sr_mod

sd_mod                 25856  0 

ahci                   20353  1 

libahci                18110  1 ahci

ohci_hcd               21271  0 

libata                156316  2 ahci,libahci

ehci_hcd               36988  0 

xhci_hcd               57936  0 

r8169                  35943  0 

mii                     3826  1 r8169

scsi_mod              124891  4 sg,sr_mod,sd_mod,libata

usbcore               137570  7 uvcvideo,snd_usb_audio,snd_usbmidi_lib,ohci_hcd,ehci_hcd,xhci_hcd
```

Surely I'm missing some module, but still can not identify what it is.

I have compiled the kernel on other computers and have had no problem, but on my laptop I can not make it work ..

If you need extra data only have to ask for them ....

PD: Sorry for my English ..Last edited by lince_0011 on Thu Oct 10, 2013 5:49 pm; edited 1 time in total

----------

## N8Fear

Are you sure that this is the config of your freshly installed kernel? gentoo-sources-3.2.9 aren't in portage (as of now).

Could it possibly be that this config is from your install media?

Your controler is configured for AHCI and this is enabled in the config you posted.

If you can access it from install media a hardware defect can be ruled out so I guess there is something strange here...

(If it really is the config from the live medium you can try to take it (zgrep /proc/config.gz > /usr/src/linúx and afterwards make oldconfig inside that directory (will most likely ask many questions but should give you a more or less reasonable kernel to start tweaking from).

----------

## lince_0011

No..

I have a fresh installation of Gentoo, I forget that I have installed kernel version.

The Gentoo kernel was compiled using genkernel, but that's not what I want.

I want to optimize, loading only the modules that I will use.

I want to upgrade the kernel to a newer version, but first I have to make it work.

----------

## N8Fear

Which kernelsources are you using (name of the package, e.g. gentoo-sources and version)?

----------

## lince_0011

I'm using:

```
linux-3.2.1-gentoo-r2
```

----------

## N8Fear

```

    #

    # Automatically generated file; DO NOT EDIT.

    # Linux/x86_64 3.2.9 Kernel Configuration

    #

```

This is the beginning of the config file you posted earlier...

Since the version differ, I guess that your config for 3.2.1 is wrong (only guess work because you didn't post it). So either use the posted config inside your kernel tree (make oldconfig && make && make modules_install and depending on what you use your bootloader stuff.

I'd recommend you to use a newer kernel anyways (3.2.51 is the newest 3.2.x kernel in portage, stable is 3.10.7-r1). I don't see any merits in configuring an old kernel just to replace it afterwards...

----------

## lince_0011

But that's not what I want ..

What I want is to optimize the kernel by adding only the modules for my laptop ..

Well I copied the 3.2.9 kernel configuration, now that I'm missing modules for the kernel linux-3.2.1-gentoo-r2 to boot?

----------

## N8Fear

This is definitely not the config you used for the kernel build. It's clear because you have different versions. Either give us the actual file from your kernel source directory (/usr/src/linux/.config) or we won't be able to help you.

The error message states that there is no device /dev/sda, you lspci shows that you SATA controller supports AHCI, in the posted config you have that enabled. Therefore my guess is, that your actual config differs.

If you want help, post the used config and not one you intended to use, please...

----------

## lince_0011

Ok this is the kernel config from  linux-3.2.1-gentoo-r2:

http://pastebin.com/SSPFzx5X

Although not as that configuration can help ..

The configuration has many modules loaded by default using genkernel, what I want is to optimize and load only the modules needed for my laptop.

----------

## 666threesixes666

boot a live cd.....

open terminal

run

```

lsmod

```

edit results into post no. 1

i run vanilla sources, with all the modules from lsmod on live media compiled into my kernel as *, not M....  i make sure everything i see in lsmod is * on my base system.

ensure you compile in devtmpfs, and your file system of choice....  as good measure, compile in .config running kernel.....

use / in menuconfig, and see the manual kernel compilation wiki.....  https://wiki.gentoo.org/wiki/Kernel/Configuration  & maybe this one will do you a bit of justice also...  https://wiki.gentoo.org/wiki/Kernel/Upgrade

----------

## VoidMage

You've pretty much optimized your kernel into unworking state.

First of all, though unrelated to the issue at hand, most of hardware specific CONFIG_FB_* options should be off, with a possible exception of FB_EFI.

Back to the problem, if you aren't using an initramfs, the driver for your SATA controller needs to be builtin, not a module.

----------

## N8Fear

After posting the right config, I can tell you, your problem is:

```

CONFIG_SATA_AHCI=m

```

Change it to:

```

CONFIG_SATA_AHCI=y

```

Then you'll be fine. Otherwise you can put your modules inside an initrd/initramfs. You have the choice.

If you had posted that config first the problem would have been resolved in my first post, so just for the future: If you want meaningful help, try to provide all the help you can to make it easier for the helpers. And if your kernel config is likely to be the culprit: post it and not the one you intend to use or the one you started off...

----------

## lince_0011

Ok I edited the first post with the result of lsmod on a live cd.

I think they're a bit confused ....

I have two kernels, the first is that of gentoo (aka linux-3.2.1-gentoo-r2), and this is the configuration of the kernel:

http://pastebin.com/SSPFzx5X

That kernel was compiled using genkernel, and obviously includes many modules do not need my laptop.

Then I kernel.org down another version, that version is 3.2.9 and the kernel is compiled for myself ..

That second kernel (aka 3.2.9) will not start, the message I put in the first post ..

And the second kernel configuration is this:

http://pastebin.com/HVKcY2TH

The second kernel is not working, and that's the one I want ..

In the configuration of the second kernel (aka 3.2.9) the modules are compiled into the kernel <*> ..

----------

## lince_0011

Any idea?

----------

## zeronullity

Check your /etc/fstab and make sure it's correct. Also make sure you have your correct sata controller driver built into 

kernel and ***NOT*** installed as a module. Guess it wouldn't hurt to double check your boot loader config.

Also changing your bios sata controller settings i.e.  Where sata type can be changed from ide, raid,sata, native rom sata, 

intel rom sata, etc.. can mess up drive ordering. And a few other bios settings can also foobar drive ordering, try to always

use AHCI when possible. Any major bios changes to the sata controller may require for your /dev/sdx list to be reordered correctly

in fstab by changing drive letters. Make sure the correct boot drive gets updated from the boot loader if any changes are made to the drive

letters. And based on that msg I would say your drive letters changed in fstab either due to a bios change or because your using a different

SATA driver. Also not having a correct dvd rom etc.. driver installed might kick the drive down the list depending on which sata driver

version your using and if you have acpi/ahci enabled. Trying changing root drive letter in /etc/fstab i.e. /dev/sda1 /dev/sdb1 /dev/sdc1  or w/e it 

changed to.. and update boot loader if needed.

It's always important to use best available drivers based on lspci,lsusb,dmidecode info and lsmod-(which may NOT always have the best current driver loaded depending

which live version your using and the HW in question)

----------

