# Gentoo 2006.0 and manually compiled kernel

## anton123

Hello,

This is my first post. By the way, I am very new to Linux and also an idiot suffering from the Windows syndrome.

I installed the LiveCD for Gentoo 2006.0 but ALSA support is not built in the kernel and so I have to do something about it.

I did as root "emerge gentoo-sources". I read the "How to compile a kernel manually" but I can not make much sense of it even following the steps.

Even more, something is missing and there is also confusion. After running "make menuconfig", there is a section that says:

File system --->

Pseudo filesystems --->

[*]/proc file system support

[*]/dev file system support (OBSOLETE)

[*]Automatically mount at boot

"[*]/dev file system support (OBSOLETE)" is absent so I don't know what to do, I am an idiot.

Should "[*]Virtual memory file system support (former shm fs)" be included in kernel (default as given) or not at all? I do not get it, I am an idiot.

"[*]Automatically mount at boot" is absent or I am an idiot.

The chipset section. Here is what I get:

00:00.0 Host bridge: ATI Technologies Inc RS480 Host Bridge (rev 10)

00:02.0 PCI bridge: ATI Technologies Inc RS480 PCI-X Root Port

00:12.0 IDE interface: ATI Technologies Inc ATI 4379 Serial ATA Controller

00:13.0 USB Controller: ATI Technologies Inc IXP SB400 USB Host Controller

00:13.1 USB Controller: ATI Technologies Inc IXP SB400 USB Host Controller

00:13.2 USB Controller: ATI Technologies Inc IXP SB400 USB2 Host Controller

00:14.0 SMBus: ATI Technologies Inc IXP SB400 SMBus Controller (rev 11)

00:14.1 IDE interface: ATI Technologies Inc Standard Dual Channel PCI IDE Contro ller ATI

00:14.3 ISA bridge: ATI Technologies Inc IXP SB400 PCI-ISA Bridge

00:14.4 PCI bridge: ATI Technologies Inc IXP SB400 PCI-PCI Bridge

00:18.0 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] HyperTra nsport Technology Configuration

00:18.1 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Address Map

00:18.2 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] DRAM Con troller

00:18.3 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Miscella neous Control

01:00.0 VGA compatible controller: nVidia Corporation NV43 [GeForce 6600 GT] (re v a2)

02:05.0 FireWire (IEEE 1394): VIA Technologies, Inc. IEEE 1394 Host Controller ( rev 80)

02:09.0 Ethernet controller: Macronix, Inc. [MXIC] MX987x5 (rev 25)

02:0a.0 Multimedia audio controller: Creative Labs SB Live! EMU10k1 (rev 0 :Cool: 

02:0a.1 Input device controller: Creative Labs SB Live! Game Port (rev 0 :Cool: 

My IDE chipset is "ATI Technologies Inc IXP SB400", right?

For audio it is "Creative Labs SB Live! EMU10k1 (rev 0 :Cool: ", driver emu10k1.

For networking it is "Macronix, Inc. [MXIC] MX987x5 (rev 25)", driver tulip.

Am I right in the above?

For networking, in "Ethernet (10 or 100Mbit)" I can see "Tulip" but not my card model, so what should I select after all?

Then, I follow the instructions to compile the kernel, to copy it to "/boot/2.6.16-gentoo-r7" from ".../arch/i386/boot/bzImage" and to copy the "System.map" and ".config" files also to /boot.

I the edit the "grub.conf" file to point to the new kernel. Here it is:

default 0

timeout 30

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

title=Gentoo Linux 2006.0 (2.6.15-gentoo-r5)

root (hd0,2)

kernel /boot/kernel-genkernel-x86-2.6.15-gentoo-r5 root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/sda3 noapic nolapic

initrd /boot/initramfs-genkernel-x86-2.6.15-gentoo-r5

title=Gentoo Linux 2006.0 (2.6.16-gentoo-r7)

root (hd0,2)

kernel /boot/2.6.16-gentoo-r7 root=/dev/sda3

title=Microsoft Windows XP Professional

root (hd0,0)

chainloader +1

I added the "Gentoo Linux 2006.0 (2.6.16-gentoo-r7)" and "title=Microsoft Windows XP Professional" entries. Next, I boot the computer and I get a kernel panic:

"VFS: Cannot open root device "sda3" 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)

"sda3" is correct since it was already created by the original Gentoo installation. "root (hd0,2)" is also correct. Did I write something wrong in grub.conf?

Yes, I know this topic has been discussed over and over again, I have researched the Gentoo forums but still, I can not make much sense of what my situation is.

See, I am an idiot and I need someone to guide me for I am about to explode like a hydrogen bomb. Is there a cure? Please. Thank you.

----------

## pigeon768

I'll help you as best I can. =]

/dev file system is obsolute, and has been replaced by udev which is not in the kernel at all. I'm afraid the installation guide may be a little out of date. Don't worry about it, but make sure you have the udev package installed. (the automatically mount at boot is a suboption of /dev- it's been removed along with it)

The 'tulip' driver supports the DECchip 21140 or something like that, and variations on the tulip driver support all the variations on that chip. The DECchip drivers a multitude of different drivers from a multitude of manufacturers. If the livecd used the tulip driver, just use the same one and it will work; the base tulip driver is enabled by the 'DECchip Tulip (2114x) option. If that doesn't work, just make modules out of all of them. The kernel will load the right module.

The System.map and .config files don't need to be in your /boot directory.

Remove the section about gentoo-r5. That seems to have been put in there by genkernel, which you didn't use.

How are your partitions laid out? Do you have a seperate /boot partition? I can't get a good idea for what your root and kernel line should look like without knowing how your partitions are set up.

----------

## anton123

Thank you for the help.

"Remove the section about gentoo-r5. That seems to have been put in there by genkernel, which you didn't use."

Actually, I was using that kernel image to log in to Gentoo and during that session I was building the latest gentoo-sources kernel. If I remove it, I can not enter Gentoo with the new kernel.

"How are your partitions laid out? Do you have a seperate /boot partition? I can't get a good idea for what your root and kernel line should look like without knowing how your partitions are set up."

sda1 is the partition for Windows XP in NTFS format

sda2 is the partition for keeping backups (programs, music, movies, e-books) in FAT32 format

sda3 is the partition for Gentoo 2006.0 in ext3 format

sda4 is the partition for linux swap

I do not have a /boot partition. What about the udev package? What steps should I follow?

----------

## NeddySeagoon

anton123,

There is some hints on a manual kernel build here

----------

## anton123

Hello,

Yes, the hints are familiar but I still have the problem descriebed. If all I did was right, what about "udev"? "whereis udev" states that it already exists. Maybe I do not have the development packages? What do I have to do since I heard that the tutorial is a bit out of date?

Doing an "emerge --search udev" returns:

*  sys-fs/udev

      Latest version available: 087

      Latest version installed: 079-r1

      Size of downloaded files: 556 kB

      Homepage:    http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html

      Description: Linux dynamic and persistent device naming support (aka userspace devfs)

      License:     GPL-2

"The System.map and .config files don't need to be in your /boot directory."

Do I keep these two files in /usr/src/linux-2.6.16-gentoo-r7 or do I just delete them if they are no longer required?

----------

## troymc

 *anton123 wrote:*   

> 
> 
> Yes, the hints are familiar but I still have the problem descriebed. 
> 
> 

 

Are you sure you followed/understood those hints? Specifically:

 *Quote:*   

> 
> 
> 1. Your root filesystem driver. If root (/) is on an ext3 fs then the kernel needs to be able to read ext3 to load any modules. Your SATA / SCSI or IDE chipset driver for the chipset controlling the drive where the root filesystem lives. 
> 
> 

 

Because the error you are reporting is typically caused by not having your SATA drivers built/loaded.

 *anton123 wrote:*   

> 
> 
> "The System.map and .config files don't need to be in your /boot directory."
> 
> Do I keep these two files in /usr/src/linux-2.6.16-gentoo-r7 or do I just delete them if they are no longer required?
> ...

 

Leave them in /boot. In fact, the best way to install a new kernel is to run make install and allow it to copy everything in place and update all the symlinks for you.

troymc

----------

## anton123

"Your root filesystem driver. If root (/) is on an ext3 fs then the kernel needs to be able to read ext3 to load any modules. Your SATA / SCSI or IDE chipset driver for the chipset controlling the drive where the root filesystem lives...Because the error you are reporting is typically caused by not having your SATA drivers built/loaded."

Running "make menuconfig", I am looking at the following.

Under "File systems", I see "<*> Ext3 journalling file system support" and that is right because my Gentoo install has root partition in the ext3 format. The module is built in the kernel and not independent. I left the selection as it was.

Under "Device Drivers  ---> ", I select "ATA/ATAPI/MFM/RLL support  --->", I see "[ ]     Support for SATA (deprecated; conflicts with libata SATA driver)" not selected because it says it is deprecated. Should I select support for it? Logically it means a "yes" but because I see "deprecated" I don't know what to do. Is that really the source of the problem I have?

"Do I keep these two files in /usr/src/linux-2.6.16-gentoo-r7 or do I just delete them if they are no longer required?...Leave them in /boot."

What do these files do? Are they necessary at all after the kernel has been built and put into the /boot path?

----------

## troymc

 *anton123 wrote:*   

> 
> 
> Under "File systems", I see "<*> Ext3 journalling file system support" and that is right because my Gentoo install has root partition in the ext3 format. The module is built in the kernel and not independent. I left the selection as it was.
> 
> Under "Device Drivers  ---> ", I select "ATA/ATAPI/MFM/RLL support  --->", I see "[ ]     Support for SATA (deprecated; conflicts with libata SATA driver)" not selected because it says it is deprecated. Should I select support for it? Logically it means a "yes" but because I see "deprecated" I don't know what to do. Is that really the source of the problem I have?
> ...

 

Look for the SATA drivers under SCSI devices.

 *anton123 wrote:*   

> 
> 
> "Do I keep these two files in /usr/src/linux-2.6.16-gentoo-r7 or do I just delete them if they are no longer required?...Leave them in /boot."
> 
> What do these files do? Are they necessary at all after the kernel has been built and put into the /boot path?
> ...

 

Very simply, the System.map is a table of all kernel variable names and their addresses. The System.map is used by lots of programs including ps, depmod and klogd. Most of these programs search several directories for it, and with /boot not generally mounted on gentoo systems, the /boot copy is really a backup. Read this for a really good description of the System.map and its uses.

The .config file is never really used by the system, but it's very good practice to keep a copy. This way, if you every screw up or delete the copy in your kernel source directory, you have a backup. (Note: this is becoming less important now that you can enable the kernel to contain it's own config. check /proc/config.gz)

But, both of these files are tiny. Unless you're building a very restricted system, use make install and let it maintain these files for you in /boot.

troymc

----------

## anton123

I see "SCSI device support" under "Device Drivers" but nothing about SATA.

 < > RAID Transport Class (NEW)                                                                                                                  │ │

  │ │ --- SCSI device support                                                                                                                         │ │

  │ │ [*]   legacy /proc/scsi/ support                                                                                                                │ │

  │ │ ---   SCSI support type (disk, tape, CD-ROM)                                                                                                    │ │

  │ │ <*>   SCSI disk support                                                                                                                         │ │

  │ │ < >   SCSI tape support                                                                                                                         │ │

  │ │ < >   SCSI OnStream SC-x0 tape support                                                                                                          │ │

  │ │ < >   SCSI CDROM support                                                                                                                        │ │

  │ │ <*>   SCSI generic support                                                                                                                      │ │

  │ │ < >   SCSI media changer support (NEW)                                                                                                          │ │

  │ │ ---   Some SCSI devices (e.g. CD jukebox) support multiple LUNs                                                                                 │ │

  │ │ [ ]   Probe all LUNs on each SCSI device                                                                                                        │ │

  │ │ [ ]   Verbose SCSI error reporting (kernel size +=12K)                                                                                          │ │

  │ │ [ ]   SCSI logging facility                                                                                                                     │ │

  │ │       SCSI Transport Attributes  --->                                                                                                           │ │

  │ │       SCSI low-level drivers  --->

----------

## troymc

 *anton123 wrote:*   

> I see "SCSI device support" under "Device Drivers" but nothing about SATA.
> 
>  < > RAID Transport Class (NEW)                                                                                                                  │ │
> 
>   │ │ --- SCSI device support                                                                                                                         │ │
> ...

 

low-level drivers.

troymc

----------

## anton123

Interestingly enough, there is support already provided but I most likely have to select the right chipset support I believe. Here is the default as it appears.

<*> Serial ATA (SATA) support                                                                                                                   │ │

  │ │ < >   AHCI SATA support (NEW)                                                                                                                   │ │

  │ │ < >   ServerWorks Frodo / Apple K2 SATA support                                                                                                 │ │

  │ │ <*>   Intel PIIX/ICH SATA support                                                                                                               │ │

  │ │ < >   Marvell SATA support (HIGHLY EXPERIMENTAL) (NEW)                                                                                          │ │

  │ │ < >   NVIDIA SATA support (NEW)                                                                                                                 │ │

  │ │ < >   Pacific Digital ADMA support (NEW)                                                                                                        │ │

  │ │ < >   Pacific Digital SATA QStor support (NEW)                                                                                                  │ │

  │ │ < >   Promise SATA TX2/TX4 support                                                                                                              │ │

  │ │ <M>   Promise SATA SX4 support                                                                                                                  │ │

  │ │ < >   Silicon Image SATA support                                                                                                                │ │

  │ │ < >   Silicon Image 3124/3132 SATA support (NEW)                                                                                                │ │

  │ │ <M>   SiS 964/180 SATA support                                                                                                                  │ │

  │ │ < >   ULi Electronics SATA support (NEW)                                                                                                        │ │

  │ │ < >   VIA SATA support                                                                                                                          │ │

  │ │ < >   VITESSE VSC-7174 SATA support

lspci provides the following:

00:00.0 Host bridge: ATI Technologies Inc RS480 Host Bridge (rev 10)

00:02.0 PCI bridge: ATI Technologies Inc RS480 PCI-X Root Port

00:12.0 IDE interface: ATI Technologies Inc ATI 4379 Serial ATA Controller

00:13.0 USB Controller: ATI Technologies Inc IXP SB400 USB Host Controller

00:13.1 USB Controller: ATI Technologies Inc IXP SB400 USB Host Controller

00:13.2 USB Controller: ATI Technologies Inc IXP SB400 USB2 Host Controller

00:14.0 SMBus: ATI Technologies Inc IXP SB400 SMBus Controller (rev 11)

00:14.1 IDE interface: ATI Technologies Inc Standard Dual Channel PCI IDE Controller ATI

00:14.3 ISA bridge: ATI Technologies Inc IXP SB400 PCI-ISA Bridge

00:14.4 PCI bridge: ATI Technologies Inc IXP SB400 PCI-PCI Bridge

00:18.0 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] HyperTransport Technology Configuration

00:18.1 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Address Map

00:18.2 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] DRAM Controller

00:18.3 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Miscellaneous Control

01:00.0 VGA compatible controller: nVidia Corporation NV43 [GeForce 6600 GT] (rev a2)

02:05.0 FireWire (IEEE 1394): VIA Technologies, Inc. IEEE 1394 Host Controller (rev 80)

02:09.0 Ethernet controller: Macronix, Inc. [MXIC] MX987x5 (rev 25)

02:0a.0 Multimedia audio controller: Creative Labs SB Live! EMU10k1 (rev 0 :Cool: 

02:0a.1 Input device controller: Creative Labs SB Live! Game Port (rev 0 :Cool: 

To make sure, is my chipset ATI Technologies Inc IXP SB400?

Which of the options for SATA might closely resemble to my chipset?

Might it be < >   Promise SATA TX2/TX4              or                 < >   VIA SATA support ?

----------

## NeddySeagoon

anton123,

Your 

```
00:12.0 IDE interface: ATI Technologies Inc ATI 4379 Serial ATA Controller 
```

appears to be SIL 3112 compatible. Therefore you need to choose  

```
< > Silicon Image SATA support │ │ 
```

as built it. A module cannot work. The other settings you have in that section are not for you anc can be cleared.

----------

## anton123

Hello,

Thank you NeddySeagoon.

It seems that it was a SATA driver integration problem. Now I can boot into the new kernel but another problem came up; my network card is not working.

It is a " Macronix, Inc. [MXIC] MX987x5 (rev25)" as detected by lspci. It uses "tulip" driver. I know that from past experiences with Knoppix (lsmod) and using the GTK+ installer for Gentoo 2006.0 also shows "tulip" to be available in the loaded modules.

When I rebuilt the kernel, I have selected under "Device Drivers", "Networking support", "Ethernet 10 or 100" from the "Tulip family of network cards" the support to be included in the kernel and not as a module. Should I have selected "M" instead of "Y" for this problem to go away? Normally, my network card should work because the support is built in the kernel.

Now, the mixer displays the slider and I no longer get the "device not found" message because I included ALSA in the kernel with "Y". There is an X still (as in muted). Should I get "emerge alsa-utils"? I included sound for my card "emu10k1" again in the kernel and not as a module. Is that a good way of doing it just as I did with the network card? All the default options were built in the kernel and what I chose as options also decided to build them in the kernel.

One more thing. "lsmod" returns empty. I am logged in as root. Is that because I have no loadable modules (I mean, no modules were loaded)? There is an option in "make menuconfig" that states "Autoload modules" and it is already selected with "Y". I left it untouched.

----------

## anton123

Here is the output from lspci:

00:00.0 Host bridge: ATI Technologies Inc RS480 Host Bridge (rev 10)

00:02.0 PCI bridge: ATI Technologies Inc RS480 PCI-X Root Port

00:12.0 IDE interface: ATI Technologies Inc ATI 4379 Serial ATA Controller

00:13.0 USB Controller: ATI Technologies Inc IXP SB400 USB Host Controller

00:13.1 USB Controller: ATI Technologies Inc IXP SB400 USB Host Controller

00:13.2 USB Controller: ATI Technologies Inc IXP SB400 USB2 Host Controller

00:14.0 SMBus: ATI Technologies Inc IXP SB400 SMBus Controller (rev 11)

00:14.1 IDE interface: ATI Technologies Inc Standard Dual Channel PCI IDE Contro ller ATI

00:14.3 ISA bridge: ATI Technologies Inc IXP SB400 PCI-ISA Bridge

00:14.4 PCI bridge: ATI Technologies Inc IXP SB400 PCI-PCI Bridge

00:18.0 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] HyperTra nsport Technology Configuration

00:18.1 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Address Map

00:18.2 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] DRAM Con troller

00:18.3 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Miscella neous Control

01:00.0 VGA compatible controller: nVidia Corporation NV43 [GeForce 6600 GT] (re v a2)

02:05.0 FireWire (IEEE 1394): VIA Technologies, Inc. IEEE 1394 Host Controller ( rev 80)

02:09.0 Ethernet controller: Macronix, Inc. [MXIC] MX987x5 (rev 25)

02:0a.0 Multimedia audio controller: Creative Labs SB Live! EMU10k1 (rev 0 :Cool: 

02:0a.1 Input device controller: Creative Labs SB Live! Game Port (rev 0 :Cool: 

What is my chipset? Is it ATI Technologies Inc IXP SB400?

For networking, the device, a PCI card, uses the "tulip" driver.

My PCI sound card uses "emu10k1" driver.

I want to build the kernel manually. I tried "genkernel", it works but, it puts too much stuff that is not needed for my hardware apart from the required stuff. Thus, I am not happy.

I want to put in the kernel only that which is needed for my machine.

There are many options in the kernel configuration that I am not sure what to select/deselect and for building sound/networking/etc... should that be built as modules with M or into the kernel with Y?

I included support for the "tulip" driver with "Y", but neither of the cards is the "Macronix, Inc. [MXIC] MX" model and I am left guessing what next. My network card is not detected/does not work.

Can somebody please, tell me for Christ's sake what I must do step by step for the kernel configuration (make menuconfig)? This is extremely frustrating and it is also my very first attempts at building a Linux kernel from scratch.

Thank you.

----------

## anton123

Should I compile the "tulip" driver as a module or into the kernel? Should I compile "emu10k1" driver as a module or into the kernel? Will the hardware work for sure if compiled into the kernel? My network card does not work either way. Should I do a "mkinitrd /boot/xxxxx.img /lib/modules/xxxxx"? If there are no loadable modules as in "make modules modules_inastall" it complains. Guys, this is simple but why am I getting errors?

----------

## anton123

I used "genkernel" but I am not happy, I want to manually compile the kernel. Why is my network card not detected? As a module, or part of the kernel. What do i have to do?

----------

## NeddySeagoon

anton123,

There is an excellent alsa guidewhich you should follow with the exception of the alsa-drivers and alsa-oss steps. You should use the ALSA provided in the kernel for your sound card.

It normally makes no difference if ALSA or network drivers are in the kernel or made as seperate modules.

However, when there are problems, using modules makes the diagnosis and fix much simpler.

Its not worth a kernel complile just to swap from built in to modules unless there are problems.

Do make sure your kernel supports module unloading.

In summary, leave ALSA as it is in the kernel and make tulip modular.

----------

## anton123

I have used "genkernel --gconfig" to tweak only some general options such as CPU model, multi-symmetrical support and exclude SATA drivers I do not need. I am afraid I can not touch something else for it seems when I make a modification another one pops up without even noticing it. I think I am dealing with witchcraft here and I seriously believe in magic, God, demons and angels so can someone explain to me what kind of witchcraft is needed to tweak the kernel for a specific machine? No one seems to be able to master that answer hence, I got no statisfactory reply still. When I boot into the new kernel, the "eth1" interface is not detected and it says something about "netmount" not being part of the startup services. I could not read the message completely. How do I pause the screen or where is there the log for the boot sequence?

----------

## NeddySeagoon

anton123,

There is no witchcraft in computers and software - not at all. You need to break your problem doen into small pieces.

Gentoo will not normally load your network module automatically for you. You must add its name to 

```
/etc/modules.autoload.d/kernel-2.6
```

on a line on its own.

If you can type  *Quote:*   

> modprobe tulip

 and see your ethernet in

```
ifconfig -a
```

then the module has loaded and found your ethernet.

You can start it by hand with 

```
/etc/init.d/net.etX restart
```

Put a number in for X.

For a manually compiled kernel, there is no substitute for doing it this wayThe best time to start is when you get a new kernel with 

```
emerge --sync

emerge world -uD
```

then the system will keep your oild and new kernels seperate, because they have different names. You are then under no pressure to get it right first time, since you can still use your old kernel.

----------

