# Easy way to identify modules needed for motherboard [solved]

## Unclethommy

Hi there, 

I run an AMD 1900+ XP with a manually configured kernel. Everything is running smoothly but now has come the time to move to a better system. I have managed to get hold of a spare P4 HT on an Asus P4C800 motherbaord. The system is currently running redhat EL4 (and so I know there must be drivers around for all the hardware). 

What I am intending to do is move my file system to the new machine. My CFLAGS have been set to a generic i686 setup so I think the compiled programs should be fine to run on the P4 rather than the AMD. What I believe I need to change is the kernel which is currently set to AMD specific parameters. What I usually do to configure the kernel is to use lspci to find the hardware on the new machine and try to find the matching driver in the kernel list. I've been doing this for most machines and I was wondering if this is the only way to do things or if there is a faster way to find what modules are needed for the hardware I have rather than doing it by trial and error. e.g. is there a way of booting a liveCD on the hardware and querying what modules are being used in the generic kernel for that hardware?

 I ask this as I can't find the right options for a few drivers for the new hardware (but I am guessing they should exist as my kernel version isn't TOO old, linux-2.6.19-gentoo-r5, which should be newer than the kernel running on the redhat machine at the moment).

I had an unfortunate problem last time I tried migrating from an AMD to P4 when I forgot to compile the right IDE controller driver for the chipset on the new board and it completely corrupted all the data on the drive it was trying to access. 

the lspci of the machine is:

```
 00:00.0 Host bridge: Intel Corporation 82875P/E7210 Memory Controller Hub (rev 02)

00:01.0 PCI bridge: Intel Corporation 82875P Processor to AGP Controller (rev 02)

00:1d.0 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB UHCI Controller #1 (rev 02)

00:1d.1 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB UHCI Controller #2 (rev 02)

00:1d.2 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB UHCI Controller #3 (rev 02)

00:1d.3 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB UHCI Controller #4 (rev 02)

00:1d.7 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB2 EHCI Controller (rev 02)

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

00:1f.0 ISA bridge: Intel Corporation 82801EB/ER (ICH5/ICH5R) LPC Interface Bridge (rev 02)

00:1f.1 IDE interface: Intel Corporation 82801EB/ER (ICH5/ICH5R) IDE Controller (rev 02)

00:1f.2 IDE interface: Intel Corporation 82801EB (ICH5) SATA Controller (rev 02)

00:1f.3 SMBus: Intel Corporation 82801EB/ER (ICH5/ICH5R) SMBus Controller (rev 02)

01:00.0 VGA compatible controller: ATI Technologies Inc Rage 128 Pro Ultra TF

02:0c.0 PCI bridge: Adaptec (formerly DPT) PCI Bridge (rev 02)

02:0c.1 I2O: Adaptec (formerly DPT) SmartRAID V Controller (rev 02)

02:0d.0 Ethernet controller: Intel Corporation 82557/8/9 [Ethernet Pro 100] (rev 0c)
```

I can't find any driver which mentions the intel 82801 chipset or the intel 82557.... does anyone have an idea on how I can get the right kernel configured for this machine? Do people have tips on how they find the right drivers or is it a case of matching the names in lspci to the options in the kernel config?Last edited by Unclethommy on Wed Dec 26, 2007 12:46 pm; edited 1 time in total

----------

## didymos

Ignore the 82801.  It's the ICH5 bit that's relevant for the kernel config.  You'll want to enable "Intel PIIXn chipsets support" if you're going with "ATA/ATAPI/MFM/RLL support", and if you're planning on using the newer libata stuff under "Serial ATA (prod) and Parallel ATA (experimental) drivers", then you'd pick "Intel PIIX/ICH SATA support" which despite the name, does include PATA support.  On 2.6.19, I'd just stick with the old-school IDE drivers.  The only place 82801 shows up is under I2C support, so obviously, pick that if you want to do hardware monitoring and whatnot.  The other stuff, like the memory controller, you don't have to worry about.  As to the 82557, again, ignore that.  What matters there is "Ethernet Pro 100", and the driver for it appears as "Intel(R) PRO/100+ support":

```

Device Drivers  ---> 

   Network device support  --->

      Ethernet (10 or 100Mbit)  --->

         [*] EISA, VLB, PCI and on board controllers

            < >   Intel(R) PRO/100+ support

```

There's also "EtherExpressPro/100 support" which is an older driver for roughly similar hardware, but you don't want that.

The SmartRAID V is easy:

```

Device Drivers  --->

   SCSI device support --->

      SCSI low-level drivers ---> 

         < > Adaptec I2O RAID support

```

Other than that, you just enable UHCI and EHCI USB, and the graphics card, plus whatever input drivers you need.

----------

## NeddySeagoon

Unclethommy,

The USB needs UHCI (for usb 1.1) and EHCI (for usb 2). You do not need OHCI at all.

The IDE setup is the same as for the ICH 4 in this post for linux-2.6.19-gentoo-r5 anyway. Later kernels are different.

The SATA needs SCSI, SCSI disk support and the Intel PATA/SATA driver near the top of the ATA menu.

Its unlikely the using the wrong IDE driver trashed any data. The generic IDE driver provides PIO modes on any IDE chipset, so its safe but slow. Other extras allow the kernel to use DMA on specific chip sets.

Your network driver is either eepro or e100 one has been dropped now.

For framebuffer, use vesa-tng in the kernel as that will not get in the way of any xorg drivers. In xorg, you need the ati driver.

I don't know what the 

```
02:0c.1 I2O: Adaptec (formerly DPT) SmartRAID V Controller (rev 02)
```

needs but google will tell you if you search on the  PCI vendor and device IDs you get from lspci -n, on the line starting 02:0c.1

----------

## Unclethommy

Wow, thanks to both didymos and NeddySeagoon. I take it your recommendations are based on experience and doing this kind of thing lots of time and with lots of different hardware? 

I will try this out when I get the system ready. 

I just tried to compile the new kernel on the old machine and created a copy of the bzimage called "gentoo-p4" in my /boot directory. When my old system rebooted, using my standard amd kernel "gentoo-amd", half the modules didnt load, plus mouse and keyboard didn't work. I had to boot into a livecd and then recompile my amd kernel. I guess what happened here was the system started compiling all the modules for a p4 rather than my amd and stored it somewhere. So when the system rebooted, it looked for the amd modules associated with the amd kernel and found modules for the p4... all is well again now after compiling back to amd. I guess it's more complicated than simply compiling using a new config file specific to the p4 hardware and then booting into that bzimage... it seems as though it creates modules else where which are then p4 specific , which would not work on the current amd hardware.

I guess I will have to wait till I get the new p4 machine, connect the current hardrive to it. chroot into it, and then compile for all the new p4 and hardware settings. And then I will be able to boot with the p4 kernel...

Thanks a lot for helping me so promptly. It will be a while before I can test it on the machine but I will report back and close the case if it all works  :Smile: 

----------

## NeddySeagoon

Unclethommy,

Most of my experience has been gained fixing other peoples problems, which includes issues similar to yours.

Well, it saves me breaking my own installs.

Your modules issue comes from the fact that you built the same kernel twice and both sets of modules (with the same module names) were installed into /lib/modules/`uname -r`/ Thats both a statement of your problem and a hint to the solution.

Build your kernel for amd, so you can actually use it and test it. Now make a copy of the entire kernel tree to be used as a basis for the P4.

Go into the the P4 copy and edit the Makefike   At the top, find 

```
VERSION = 2

PATCHLEVEL = 6

SUBLEVEL = 24

EXTRAVERSION = -rc4

NAME = Arr Matey! A Hairy Bilge Rat!
```

Thats from my current 2.6.24-rc4 kernel. Change the

```
EXTRAVERSION = -rc4-p4
```

by adding something  like -p4, now configure and build your P4 kernel. As you have given it a new name, its `uname -r` has changed and its modules will not get mixed up with your amd kernel.

----------

## Unclethommy

Ah, ok, so I simple create a copy of the original source file which /usr/src/linux points to so there will now be two directories, something like /usr/src/linux-gentoo-2.6.19-r5 and now a new copy of that file called /usr/src/linux-gentoo-2.6.19-r5-P4.

Then I descend into that directory , edit the Makefile as you say... and change EXTRAVERSION to = -r5-P4. Then simply run make menuconfig in that directory and change the settings to pentium specific ones for the new hardware? So once I get the new machine, I simply change the /usr/src/linux pointer to the P4 source directory (for any further compiles of the kernel) and use the bzimage created for the P4? 

Is that right? Out of curiosity, if I have a kernel which is old like the 2.6.19-r5 one I have but it supports all the hardware I need, is it necessary to keep the version up-to-date? Will I gain any performance? Do people incorporate speedups as the kernel gets more mature?

----------

## NeddySeagoon

Unclethommy,

The name of the directory the new kernel is in does not matter. That allows you to identify them.

The EXTRAVERSION change tells the kernel and its modules its new name.

You probably want to start the build with 

```
make clean 
```

so you don't have any AMD binaries lying about.

Kernels get security patches and different/better/faster ways of doing the same things. You should update to get the security patches, unless the system has no internet access.

----------

## Unclethommy

Hi there, I've successfully created the two different falvors of kernel and upgraded to the latest kernel , but only problem is that my pretty highresolution framebuffer is now missing. I noticed that the option in the new kernel doesn't have 

      <*>   VESA VGA graphics support

               VESA driver type (vesafb-tng)  --->

Which I believe is needed to make it work, does anyone know how I can enable it?

Also another question, I have a pair of diskless servers which will need to have their kernel upgraded to the same version as my server. Now to avoid me having to compile the kernel twice, can I simple compile it on on one machine (or even in my server machine) and then copy the appropriate source directory and the /lib/modules directory for the new kernel to work on both diskless machines (assuming I have the right device drivers etc enabled)? Will I need to change any more settings/folders?

----------

## Xake

vesafb-tng is depricated in favor for uvesafb. It requires toying with v86d thu, and I have yet to make it work. But does not the fb-driver for ati work? I thought it only was nvidiafb that was the devil....

----------

## NeddySeagoon

Unclethommy,

Since the machines are diskless, their kernels will need support for root over NFS.

You can compile the kernel anywhere that has the right gcc and produces code that will run on the diskless nodes.

You can also use distcc, which allows several machines to contribute to the compile of the same package.

----------

## Unclethommy

hi there, thats good news. I have not yet managed to get distcc working for kernel compiles although it works great with portage compiles. My only question is if i were to compile it on another computer, what folders will i need to copy to the diskless clients other than the bzimage? would i need the appropriate /lib/modules directory?

Xake, that sucks because i quite liked my higher resolution booting screen with splash  :Sad: 

p.s. I have an nvidia card if that helps

----------

## Xake

 *Unclethommy wrote:*   

> Xake, that sucks because i quite liked my higher resolution booting screen with splash 
> 
> p.s. I have an nvidia card if that helps

 

I also have a nvidia card, and currently I use vesafb without problem. I think it is only if you run something other then plain x86 vesafb can give problems. On the other hand: if you like to try out uvesafb it is not THAT hard. for me the biggest problem is that when I compiled it in-kernel it could not parse my bios, if I ran it as module it worked fine but gave strange messages with nouveau. But that may have been a problem with v86d and I think it has been updated since then.

----------

## NeddySeagoon

Unclethommy,

How do you copy files to diskless nodes ?

I was under the impression you were using tftp to fetch a kernel from a server and mounting root over nfs.

Booting of the diskless nodes being accomplished by a boot rom of some sort, like the Linux Terminal Server Project.

You need the bzImage file from arch/<your_arch>/boot/bzImage and the .ko files from the build tree.

If you do not use make modules_install, you will need to run the script to create the dependancy file too.

I forget it name but its in /sbin

----------

## Unclethommy

NeddySeagoon, sorry, when I meant copying I meant I would simply mount the correct folders under NFS so that it is accessible to the diskless servers as well as the server machine. That way I'd only need one copy of the folders. All machines will be P4 at that point and it would make the management of kernels easier. When I create a new kernel, I run make && make modules_install. Would all the modules (and .ko files) I need simply be in /lib/modules/<mykernelversion>? So I can simply mount this via nfs for the diskless nodes so that they can then boot the same kernel without having their own copies in their own diskless node root structure?

----------

## NeddySeagoon

Unclethommy,

You can certainly share some filesystem structures between the diskless nodes. The kernel sounds safe, along with its modules.

----------

## Unclethommy

okay, so I experimentd by simply comipiling the diskless kernel on my server and then placing it in the right directory and copying over the apprpriate kernel directory in /lib/modules and everything seems to boot up fine. I will report back if there are any errors but it's good to know it can be done.

----------

