Kernel (Pete's notes)

EmperorLinux kernels on gazelle

Kernel config parameters are in /usr/src/linux/.config

Kernel support for IPv6 and multicast

2003-05-29
EmperorLinux built me a special kernel that has support for IPv6 and for multicast.

If the kernel supports IPv6, the following should work. Also, see my IPv6 page.

	  gazelle$ grep -i v6 /usr/src/linux/.config
	  CONFIG_IPV6=m
	  #   IPv6: Netfilter Configuration
	  # CONFIG_IP6_NF_MATCH_IPV6HEADER is not set
	  CONFIG_USB_STV680=m
	  gazelle$ 
    
If the kernel supports multicast, the following should work. Also, see my multicast page:
	  gazelle$ grep -i cast /usr/src/linux/.config
	  CONFIG_IP_MULTICAST=y
	  # CONFIG_NET_IPGRE_BROADCAST is not set
	  gazelle$ netstat -g
	  IPv6/IPv4 Group Memberships
	  Interface       RefCnt Group
	  --------------- ------ ---------------------
	  lo              1      ALL-SYSTEMS.MCAST.NET
	  eth0            1      ALL-SYSTEMS.MCAST.NET
	  lo              1      ip6-allnodes
	  eth0            1      ff02::1:ff5e:6694%3221213472
	  eth0            1      ip6-allnodes
	  gazelle$
    

Upgrading an EmperorLinux kernel

NOTE: upgrading your kernel will break VMware and the Cisco VPN client.

After the reboot, to fix the VPN client, do

cd /usr/src/vpnclient-linux-3.7.2.Rel-k9
./vpn_install
After the reboot, to fix VMware, do
vmware-config.pl
To upgrade an EmperorLinux kernel, get the 4 RPMs from EmperorLinux. Then, as it says at http://www.emperorlinux.com/support/kernels/readme.txt
rpm -Uvh empkernel*
This will do all the magic, including editing the /etc/grub.conf file, so all you have to do is reboot.

Rebuilding EmperorLinux from source

According to Lincoln at EmperorLinux, rebuilding the kernel from sources is probably more pain than it's worth.

I thought I might have to, in order to have the kernel sources available when building the KeySpan drivers. Following the directions in the EmperorLinux book section 2.8, I did the following:

rpm -Uvh /usr/src/kern-2.4.src.rpm
This unpacks the kernel sources into /usr/src/redhat/SOURCES. Then I stopped. More later.

General experiences with Red Hat kernels

The new Red-Hat way to get new kernel sources:

Getting Red Hat sources

rpm -Fvhbinutils-2.11.92.0.12-9.i386.rpm
rpm -i kernel-source-2.4.17-0.6.i386.rpm compat-gcc-7.2-2.96.101.9.i386.rpm
This creates /usr/src/linux-2.4.17-0.6 and /usr/src/linux-2.4, a link to it.

Configuring Red Hat

cd /usr/src/linux-2.4
make xconfig
Laptop "make xconfig" for Linux 2.4.5 I made on 6/18/2001...
Code maturity level options
  "y" Prompt for development and/or incomplete code/drivers (so we can
enable Maestro3 sound support)
Processor type and features
  "y" MTRR (Memory Type Range Register) support
  "n" Symmetric multi-processing support
General setup
  "y" PCI support (note that my laptop has an internal PCI bus)
  "y" BSD process accounting
  PCMCIA/Cardbus support
    "y" PCMCIA/Cardbus support
  "y" Advanced Power Management BIOS support
    "y" Enable PM at boot time
    "y" Make CPU idle calls when idle
Parallel port support
  "m" Parallel port support
  "m" PC-style hardware
Plug and Play configuration
  "n" Plug and Play support
Networking Options
  "y" Socket Filtering  (needed by dhclient, the DHCP client) 
SCSI support
  "n" SCSI support
Network device support
  Ethernet (10 or 100Mbit)
    "y" 3COM cards
      "m" 3COM590/3c900 series "Vortex/Boomerang" support
  "y" PPP (point-to-point protocol) support
    "y" PPP support for async serial ports
  Wireless LAN (non-hamradio)
    "y" Wireless LAN (non-hamradio)
  PCMCIA network device support
    "n" PCMCIA ntwork device support
  "y" PPP (point-to-point) support
Character devices
  "y" Enhanced Real Time Clock Support (to avoid "modprobe: can't find
      char-major-10-135" errors at Linux boot, and to avoid Vmware
      warnings about RTC at Vmware/W2k boot)
File systems
  "y" Ext3 journaling filesystem support (EXPERIMENTAL)
  "y" DOS FAT fs support (IMPORTANT: must be "y", not "m" for Windows 2000 bootloader )
    "y" MDDOS fs support (IMPORTANT: must be "y", not "m" for Windows 2000 bootloader )
    "y" UMSDOS: Unix-like filesystem on top of standard MSDOS filesystem
    "y" VFAT (Windows-95) fs support (IMPORTANT: must be "y", not "m" for Windows 2000 bootloader )
  Native Language Support
    "m" Codepage 437 (United States, Canada)
Sound
  "y" ESS Maestro3/Allegro driwer (EXPERIMENTAL)
Save and exit
    

Building Red Hat

cd /usr/src/linux-2.4
make depend clean bzImage modules
make modules_install
cp arch/i386/boot/bzImage /boot/vmlinuz-2.4.17-0.6
cp System.map /boot/System.map-2.4.17-0.6
rm -f /boot/System.map
ln -s /boot/System.map-2.4.17-0.6 /boot/System.map

To set up grub, see my grub page.

Obsolete Red Hat notes


!!!!!!!!!!!!!!!! WHAT FOLLOWS IS THE OLD, OBSOLETE WAY
Although these notes describe building a kernel under SuSE, they follow directions in the RedHat Linux Secrets Book on pages 106-126.

Get the kernel sources

cd /usr/src
ftp gate.ucar.edu
anonymous@ftp.us.kernel.org
siemsen@ucar.edu
cd pub/linux/kernel/v2.4
binary
get linux-2.4.5.tar.gz
quit
gunzip linux-2.4.5.tar.gz
DO NOT UNTAR YET! check that "linux" is a link to the old source tree
rm linux
tar xf linux-2.4.5.tar (this creates a new "linux")
rm linux-2.4.5.tar
mv linux linux-2.4.5
ln -s linux-2.4.5 linux
cd linux

The Red Hat book uses make config to configure the kernel. I used make xconfig because it seems more helpful. Both programs modify the .config file.

(home system)

    Network device support
      Ethernet (10 or 100Mbit)
        "y" Ethernet (10 or 100Mbit)
          "y" Western Digital/SMC cards
            "y" SMC Ultra support
      PPP (point-to-point) support
    Networking options
      "y" Network firewalls
      "y" IP: advanced router
      "y" IP: firewalling
      "y" IP: masquerading
      "y" IP: ICMP masquerading
    Sound
      "m" Sound card support (note: must be "m", not "y")
        "m" OSS sound modules (note: must be "m", not "y")
	  "m" 100% Sound Blaster compatibles support (note: must be "m", not "y")
	  "m" SoftOSS software wave table engine
          "m" FM synthesizer (YM3812/OPL-3) support
          "m" Loopback MIDI device support
    Save and Exit
	

To protect myself from typos and other dumbness, I wrote two bash scripts that do the build. They are buildkernel, and mvlilo. The buildkernel script contains this:

#!/bin/bash
cd /usr/src/linux
make depend clean bzImage modules
rm -rf 2.4.5.old
mv /lib/modules/2.4.5 2.4.5.old
make modules_install
cp /usr/src/linux/arch/i386/boot/bzImage /boot/bzImage.new
cp /usr/src/linux/System.map /boot/System.map-2.4.5
rm -f /boot/System.map
ln -s /boot/System.map-2.4.5 /boot/System.map

Edit buildkernel to change the version numbers. Then execute it.

To make lilo offer you the new and the old kernel, there are three files in /boot:

bzImage.new
bzImage
bzImage.old

The bzImage file is the kernel that's booted by default. The other two are versions that are old or new. All three files must exist in order to configure lilo. Usually, bzImage is a copy of bzImage.old or bzImage.new.

If you want to change the options offered by lilo, edit the /etc/lilo.conf file. After you edit the file, you have to tell Linux about it and tell Windows 2000 about it. To hide the details, I put these steps in a script named /usr/src/mvlilo, which contains this:

#!/bin/bash
/sbin/lilo
mount /dev/hda1 /w2000
/bin/dd if=/dev/hda5 bs=512 count=1 of=/w2000/bootsect.lnx

Whenever you build a new kernel, you have to rebuild the PCMCIA modules. Follow the directions in the PCMCIA page.

Then reboot to use your new kernel. When you're satisfied that the new kernel works, do this:

cp /boot/bzImage /boot/bzImage.old
cp /boot/bzImage.new /boot/bzImage

Automatic module loading

To build a kernel with support for automatically loading modules, you have to turn on "Loadable module support" in xconfig as shown above. When you do this, and select "Kernel module loader", you're enabling kmod. Kmod is a replacement for the older kerneld way of handling modules, as described in /usr/src/linux/Documentation/kmod.txt..\

When you build kmod into the kernel, it makes no sense to also run kerneld. If you do, as SuSE 7.0 does by default, you'll see a message during boot that says something like "You almost certainly don't want to be running kerneld". To stop running kerneld, do this:

rm /etc/rc1.d/K99kerneld rm /etc/rc1.d/S01kerneld rm /etc/rc2.d/K99kerneld rm /etc/rc2.d/S01kerneld rm /etc/rc3.d/K99kerneld rm /etc/rc3.d/S01kerneld

Address comments or questions about this Web page to the Network Engineering & Technology Section at nets-www@ncar.ucar.edu. The NETS is part of the Scientific Computing Division of the National Center for Atmospheric Research, which is part of the University Corporation for Atmospheric Research.
Last modified: Thu Jul 10 16:36:09 MDT 2003