Linux kernel 2.4.16
The first build

On 11 December 2001, I installed the source code for the SuSE kernel from the CD, but couldn't find it on the harddrive, as it's not in /usr/src/linux. I decided to build a new experimental kernel from scratch, primarily to obtain firewire support, but also to get a slimmer and more precisely customized kernel.

For the second build, see here.

For a third build, consider the following:

  1. The power-off problem may stem from the ACPI / APIC confusion -- clear it up and use ARM?
  2. Remove ip v.6? See "hosts" for a list of hosts -- not sure exactly where (etc?)
  3. The scsi problem -- not sure what's going on there.
  4. Kompare the 2.4.10 and 2.4.16 configuration files
  5. Update SuSE's kernel when it moves to 2.4.18?
  6. Look out for the gigadrive chip in the kernel (so you won't have to patch)

Because SuSE relies on a huge number of modules, the actual kernel is not that big. You could consider using it, in an updated form of course, provided the gigadrive can be supported.

Guides

You find the configuration of the running kernel via less /proc/config.gz. It's beautiful to watch the kernel components -- about 90% of the items listed I don't need on this particular configuration. So it's tempting to make a second kernel that is identical to the current one, but radically slimmed down.

Software

Kernel configuration

Determine the kernel version that is running on your system with the command

uname -r

You can use the command

rpm -qf `awk -F= '/image/{print $2}' < /etc/lilo.conf`

to find the name of the kernel RPM package that is installed on your system.

to either remove the existing kernel package from your system using the command

rpm -e `rpm -qf /boot/vmlinuz`

If you download a new kernel rpm package from SuSE, you can install it with the command

rpm -Uhv --nodeps --force

The mide-December kernel build

I picked up 2.4.16 from ftp://ftp.chpc.lkams.kernel.org/pub/linux/kernel/ instead of http://www.kernel.org and instructions at http://www.linuxdoc.org/HOWTO/Kernel-HOWTO-4.html (actually, go to page 4). I saved the new kernel source in /usr/src and then bravely entered:

tar zxpvf linux-2.4.16.tar.gz

The new kernel unpacked beautifully; I opened the README file, and found that I should domake

menuconfig

Exciting stuff! I had nothing in /usr/src/linux before, so this will be interesting -- hopefully, it won't mess up SuSE! I used

less /proc/config.gz

to compare the current kernel with the new one, using the help system (press ?) and doing my best:

Processor
* My processor 300a is a Mendocino core and I chose Pentium Pro/Celeron/Pentium II (SuSE had M586)
? X86 -- nine options that appear in SuSE that I didn't see
* Intel IA32 (includes Celeron) microcode support (module in SuSE)
* Model-specific register support (module in SuSE)
* CPU ID (module in SuSE)
n High memory is off (4GB on in SuSE) -- help menu says off if less than 1GB RAM
PCI and PCMCIA
* PCI access mode is Bios (SuSE had any)
n PCMCIA card bus (module and yes in SuSE)
n PCI hotplug (SuSE has on)
Power management
n Power management support -- because the processor gets a hlt command anyway if nothing happens,
and hdparm is needed to make the harddrive stop spinning (see hard drives)
Firewire and scsi
* config blk dev ide scsi -- you need this for the CDRW: add hdx=scsi as a boot parameter!!
* enabled Firewire support, with OHCI
Networking
n config net fastroute -- I leave it off, but this could be tried
n I turned of net scheduling, on in SuSE
* natsemi -- and no other network cards!
n PPP -- left it out. It would be for faxing, but I never fax and can do it from the office
n serial port (don't use it)
* CONFIG_VIDEO_CPIA_USB: should give my Ezcam support! -- see http://webcam.sourceforge.net/
File systems
* SMB fs -- Windows printer and file sharing. For connecting Linux to Windows and Macs see http://www.eats.com/linux_mac_win.html
Advanced n etworking

n CONFIG_NFS_FS -- accessing Unix files through TCP/IP -- cf. http://www.linuxdoc.org/docs.html#guide>
* CONFIG_NCP_FS. NCP (NetWare Core Protocol) is a protocol that runs over IPX and is used by Novell NetWare clients to talk to file servers. It is to IPX what NFS is to TCP/IP, if that helps. Saying Y here allows you to mount NetWare file server volumes and to access them just like any other Unix directory. For details, please read the file Documentation/filesystems/ncpfs.txt in the kernel source and the IPX-HOWTO from http://www.linuxdoc.org/docs.html#howto.

NumLock (not sure where this is)

KBD_DEFLEDS should be defined to (1 << VC_NUMLOCK) when compiling drivers/char/keyboard.c to enable numlock on at bootup. Alternatively, use the setleds program (part of the KDB package), for example (in /etc/rc.local or one of the /etc/rc.d/* files): for t in 1 2 3 4 5 6 7 8 do setleds +num < /dev/tty$t > /dev/null done

Configuring the kernel was an interesting experience -- I customized it to my machine, which was an uncommon pleasure. It should be much smaller than SuSE's kernel, which is 901,244 long -- or 900KB, just below one MB. From the new one, when the compiling was done, I got:

Root device is (3, 8)
Boot sector 512 bytes.
Setup is 2508 bytes.
System is 850 kB

So that's just marginally smaller than SuSE! However, I have all the components included; there are no modules. I then copied the file /usr/src/linux/arch/i386/boot/bzImage to /boot and called it vmlinuz.2.4.16. I also discovered vmlinuz.config, which is SuSE's configuration file, which I could have used to start out with. Well, this wasn't very hard and so far no problems -- of course, it may not work. I incorporated it into Lilo as a third Linux system, calling it linus. Now here we go -- this shouldn't really be too hard!

Bad news: kernel panic. It seemed to be caused by the CONFIG_VIDEO_CPIA_USB, the web cam driver. I could remove it and see what happens. I removed the driver for this device and recompiled the kernel. Wow -- I'm swimming! It worked! I got lots of error messages, but it works fine! So I made my own kernel.... Here are some messages:

Linux version 2.4.16
CPU: L1 I cache: 16K, L1 D cache: 16K CPU: L2 cache: 128K
isapnp: Card 'SupraExpress 56i Sp V.90'
Real Time Clock Driver v1.10e
NIC
eth0: NatSemi DP8381[56] at 0xd8800000, 00:a0:cc:a2:be:83, IRQ 10.
eth0: Transceiver status 0x7869 advertising 05e1.
AGP
Linux video capture interface: v1.00 Linux agpgart interface v0.99 (c) Jeff Hartmann
agpgart: Maximum main memory to use for agp memory: 322M
agpgart: Detected Intel 440BX chipset
agpgart: AGP aperture is 64M @ 0xd0000000
Firewire
ohci1394: v0.51 08/08/01 Ben Collins <bcollins@debian.org>
ohci1394_0: OHCI-1394 1.0 (PCI): IRQ=[11] MMIO=[db004000-db004800] Max Packet=[2048]
raw1394: /dev/raw1394 device initialized
ieee1394: Local host added: node 0:1023, GUID 00308d010001a64c
IEEE 802.2 LLC for Linux 2.1 (c) 1996 Tim Alpaerts
Audio
Creative EMU10K1 PCI Audio Driver, version 0.16, 02:36:07 Dec 13 2001
emu10k1: EMU10K1 rev 5 model 0x20 found, IO at 0xe400-0xe41f, IRQ 7
ac97_codec: AC97 codec, id: 0x5452:0x4123 (TriTech TR A5)
USB
usb.c: registered new driver hub
uhci.c: USB Universal Host Controller Interface driver v1.1
hub.c: USB hub found
hub.c: 7 ports detected
Scanner
scanner.c: 0.4.6:USB Scanner Driver
Printer
printer.c: v0.8:USB Printer Device Class driver
printer.c: usblp0: USB Bidirectional printer dev 5 if 0 alt 0

Pretty sensational stuff. It looks like Linux found my devices and installed them, just like that -- no configuration necessary! Of course, I don't know if this will work, but keyboard, monitor, mouse, NIC all work perfectly. Silence in church:

Gscanbus shows the videocamera working !!!!

For the rest of the story, see dvgrab.

Boot configuration

To make the kernel boot, you need to add it to /etc/lilo.conf -- pointing to the bzImage that you copied to /boot under a name such as vmlinuz.2.4.16.

Each kernel may need different boot files; I don't yet know how to manage this -- and it's a bummer to have to spend time learning SuSE rather than Linux. As long as you use SuSE, follow SuSE's kernel help.

  1. Copy the kernel image /usr/src/linux/arch/i386/boot/bzImage to /boot and call it vmlinuz.2.4.xx.

  2. A SuSE support person says in some e-mail to copy the system map to the boot directory -- it's in /usr/src/linux/system.map (look into this before you do it)

Speculations on factors involved in integrating the new kernel into SuSE's setup:

  1. Initrd -- the initial RAM disk. This is used when you want to mount modules; cf. http://www.linuxhq.com/kernel/v2.0/doc/initrd.txt.html. If you don't define modules, leave this line out of /etc/lilo.conf

This illuminating explanation is found in /sbin/init.d.README:

The scripts for controlling the system are placed in /etc/init.d/ (they have been moved accordingly to the Linux Standard Base (LSB) specification). These scripts are executed directly or indirectly by /sbin/init, the father of all processes. The configuration of /sbin/init is given by the file /etc/inittab (see inittab(5)).

At boot time, the boot level master script /etc/init.d/boot is called to initialise the system (e.g. file system check, ...). It also executes some hardware init scripts linked into /etc/init.d/boot.d/. Then it calls /etc/init.d/boot.local, which executes the local commands.

After system startup, /sbin/init will normally switch on the default run level given in /etc/inittab. It calls the run level master script /etc/init.d/rc to start or stop services provided by the other scripts under /etc/init.d/.

[It then goes on to explain how run levels are defined.]

/etc/init.d/skeleton -- This script is a model for writing your own. You can use insserv(8) to include your own script into a run level.

For now, I'll try just leaving out the initrd from lilo.conf and see if that stops the module calls, which produce silly errors on the new kernel:

modprobe: Can't open dependencies file /lib/modules/2.4.16/modules.dep (No such file or directory)

Indeed there is not -- somehow, the SuSE config files is making it think there is a module there, but I don't know what.

Here is SuSE's own recipe for replacing a kernel -- http://www.securityfocus.com/advisories/3637. Note that this involves ftp'ing an rpm package containing the kernel.

When I tried to make a new initrd file
November 2001

First, some comments on the configuration files -- I was just discovering them at this time.

In Yast2, go to system administration and change configuration file -- I don't recall now which file this changes, but it's a key file in /etc.

Among other things, you can define whether you want KDM to load at boot. If you say no, but KDM remains your default X11 application, you start the KDE desktop by typing startx. I had trouble with startx -- if I started X11 in root, I couldn't also start it in steen. Obviously a configuration issue, but here again I'm out of my depth.

When you've made configuration changes outside of Yast or Yast2, make sure you run

/sbin/SuSEconfig

I doubt this is a very secure way of maintaining coherence, but not running it is worse.

/etc/rc.config seems to load the modules -- I could never figure this out.

/etc./rc.config.d -- a directory full of rc files:

apmd.rc.config -- battery power conservation
apmd.rc.config.old
apmd.rc.config_pre7.3
autofs.rc.config --
backup.rc.config
dhcpcd.rc.config
hotplug.rc.config
hotplug.rc.config.old
i4l.rc.config -- telephone/ISDN
i4l_hardware.rc.config -- ISDN
i4l_unknown
lang.rc.config - language settings
security.rc.config
sendmail.rc.config -- configure sendmail

/etc/rc.d contains lots of files -- the README file says "The scripts for controlling the system are placed in /etc/init.d/"

"These scripts are executed directly or indirectly by /sbin/init, the father of all processes. The configuration of /sbin/init is given by the file /etc/inittab (see inittab(5))."

Now, /etc/inittab "is the main configuration file of /etc/init, which is executed by the kernel on startup. It describes what scripts are used for the different run-levels" (from the etc/inittab file).

So this seems to be the key to the boot process. /etc/inittab has an entry for /etc/init.d/boot, the first script that starts at bootup.

It starts . /etc/rc.status and . /etc/rc.config

One of the first things done by /etc/init.d/boot is to load kerneld, which is the daemon that relentless attempts to load modules. I recklessly commented those lines away on 17 December 2001.

/etc/init.d/boot includes a call to /etc/init.d/boot.local -- this is where you can put your own commands. E.g.?

All the error messages I never see are written to /var/log/boot.msg

So I made changes to /etc/init.d/boot and saved them.

To follow up, I need to remake initrd, the inital RAM disk. The command is mk_initrd and takes -h for help. I gave it:

mk_initrd -k vmlinuz.2.4.16 -i initrd.2.4.16

and it responded:

using "/dev/hda8" as root device (mounted on "/" as "reiserfs") creating initrd "//boot/initrd.2.4.16" for kernel "//boot/vmlinuz.2.4.16" (2.4.16). no version "2.4.16" modules found. If you're using lilo as bootmanager, you may want to run 'lilo' now.

Now, no file was created. This likely is what made my Linux system unbootable. As SuSE puts it,

"The modules that will be packed into this initial ramdisk (initrd) must be listed in the variable INITRD_MODULES in the file /etc/rc.config . This ramdisk, called "initrd", must be generated using the command

mk_initrd

If the driver for the device containing your root device is not compiled directly into the kernel, then your system will most likely not boot any more."

Note that somewhere along the line the whole system stopped working -- this is not the way to proceed.

 

 

 

 

top

 

Home
Contacts
Teaching
Future
LA
Research

CogWeb