Kernel Howto door Piethein Strengholt

Deze howto legt je uit hoe je de nieuwste kernel kan compilen op je systeem. Ik doe het met kernel 2.4.19 in dit voorbeeld. De kernel is zoals de naam al doet raden de kern van het system. Bij Linux is het systeem modulair opgebouwd. Dit wil zeggen dat je zelf kan bepalen welke 'lego-blokjes' je gebruikt. Je zit dus niet vast zoals onder 'Windows' aan een totaal pakket. Bij het opbouwen van je 'lego-blokjes' kan je kiezen uit drie keuze mogelijkheden. Built-in, module of niks. Als wordt gekozen voor built-in dan zit het lego-blokje in het systeem. Pci ondersteuning wil je bv bij het booten ondersteund hebben. Terwijl bij ondersteuning voor NAT je zou kunnen kiezen voor een module. Dit zou je later willen toevoegen. FireWire heb je helemaal niet in je systeem, dus dat zou je kunnen uitvinken. In het laatste geval wordt het niet eens gecompiled. Enige kennis van Linux is

Login als root

- Download of move de 'kernel source file' (bv.. linux-2.4.19.tar.gz) naar de /usr/src directory.

cd /usr/src
rm linux
(verwijder de symbolische link)
tar xzf linux-2.4.21.tar.gz

maak nu een nieuwe symbolische link aan (verwijder een eventueel oude link):

ln -s linux-2.4.21 linux

cd linux

Onder X:
make xconfig

Onder console:
make menuconfig

Verder staat er in de directory /boot een kopie van je oude cfg. Bij mij heette die config-ide-2.4.20 maar dat zal op ieder systeem verschillend zijn.
In /lib/modules/kernelversie/ staan alle modules die als module zijn gecompileerd met de kernel. Tevens wordt er elke keer als je een kernel compiled een .config bestand aangemaakt in /usr/src/linux/configs directory, die je kan kopieren naar de src van je nieuwe kernel, om alle opties aan te zetten die ook in de huidige kernel aangezet waren. Loop de configuratie door, sluit af en sla alles op. Voer nu de volgende stappen uit:

make dep
make clean
make bzImage
make modules
make modules_install

Sneller is om het volgende in te tikken:

make dep && make clean && make bzImage && make modules && make modules_install

Daarna moet de bootfile worden overgebracht:

cd arch/i386/boot/
mv bzImage /boot/vmlinuz-2.4.21
( naam afhankelijk van gebruikte kernel )

Nu moet lilo nog worden aangepast

pico /etc/lilo.conf

------------------------------

image=/boot/vmlinuz-2.4.21
label=newlinux
read-only
root=/dev/hda1

------------------------------

boot = /dev/hda
message = /boot/boot_message.txt
prompt
timeout = 10
vga = normal
default = linux
image = /boot/vmlinuz-2.4.21
root = /dev/hda1
label = linux
read-only
append = "ide=nodma apm=off acpi=off noapic"

------------------------------


Zoals boven.. Dit kan er worden neergezet.. Standaard is 'linux'. Verder staat er bij mij /hda1. Je moet even overnemen wat er startdaard bij 'linux' staat in jouw configuratie.

lilo updaten met:

lilo

Om alle wijzigingen door te voeren moet het systeem gerestart worden met:

shutdown -r now

Met 'modprobe -c' zie je na het starten een overzicht van alle modules die je tot je beschikking hebt. Met het commando modprobe laadt je een module. 'lsmod' showt je alle modules.

In het bestand /etc/modules.conf kun je modules opnemen. Hier een voorbeeld van mijn netwerkkaart een realtek 8139 die ik aan eth0 heb gehangen.

alias eth0 8139too

--------------------------------------------------------

Additional Boot OptionsThis appendix discusses additional boot and kernel boot options available for the Red Hat Linux installation program.

To use any of the boot options presented here, type the command you wish to invoke at the installation boot: prompt.

For example:

boot: text

Boot Time Command Arguments

askmethod
This command asks you to select the installation method you would like to use when booting from the Red Hat Linux CD-ROM.

apic
This command works around a bug commonly encountered in the Intel 440GX chipset BIOS and should only be executed with the installation program kernel.

apm=allow_ints
This command changes how the suspend service is handled (and may be necessary for some laptops).

apm=off
This command disables APM (Advanced Power Management). This is useful because some BIOSes have buggy power management (APM) and tend to crash.

apm=power_off
This command will make Red Hat Linux shutdown (power off) the system by default. This is useful for SMP systems that do not shutdown by default.

apm=realmode_power_off
Some BIOSes crash when trying to shutdown (power off) the machine. This command changes the method of how this is done from the Windows NT way to the Windows 95 way.

dd
This command will prompt you to use a driver disk during the installation of Red Hat Linux.

display=IP:0
This command allows remote display forwarding. In this command, IP should be replaced with the IP address of the system you want the display to appear on.

On the system you want the display to appear on, you must execute the command xhost +remotehostname, where remotehostname is the name of the host you are running the original display from. Using the command xhost +remotehostname limits access to the remote display terminal and does not allow access from anyone or any system not specifically authorized for remote access.

driverdisk
This command performs the same function as the dd command and will also prompt you to use a driver disk during the installation of Red Hat Linux.

expert
This command will turn on the following special features:


allows partitioning of removable media

prompts for driver disk


ide=nodma
This command disables DMA on all IDE devices and may be useful when having IDE-related problems.

isa
This command prompts you for ISA device configuration.

lowres
This command forces the graphical (GUI) installation program to run at a lower resolution (640x480).

mediacheck
This command gives you the option of testing the integrity of install source (if an ISO-based method). Verifying that the ISO images are intact before you attempt an installation will help to avoid problems that are often encountered during an installation.

mem=xxxM
This command allows you to override the amount of memory the kernel detects for the machine. This may be needed for some older systems where the only 16 MB is detected and for some new machines where the video card shares the video memory with the main memory. When executing this command, xxx should be replaced with the amount of memory in megabytes.

nmi_watchdog=1
This command enables the built-in kernel deadlock detector. This command can be used to debug hard kernel lockups. By executing periodic NMI (Non Maskable Interrupt) interrupts, the kernel can monitor whether any CPU has locked up, and print out debugging messages as needed.

noapic
This command tells the kernel to not use the APIC chip. This command may be helpful for some motherboards with a bad APIC (such as the Abit BP6) or with a buggy BIOS.

noht
This command disables hyperthreading (when available in SMP systems).

nomce
This command disables self-diagnosis checks performed on the CPU. The kernel enables self-diagnosis on the CPU by default (called Machine Check Exception). On some older Compaq machines, this check is run too often and may need to be disabled.

nomount
This command disables automatic mounting of any installed Linux partitions in rescue mode.

nopass
This command disables the passing of keyboard and mouse information to stage 2 of the installation program. This is good for testing keyboard and mouse configuration screens during stage 2 of the installation program when performing a network installation.

nopcmcia
This command ignores any PCMCIA controllers in system.

noprobe
This command disables hardware detection and instead prompts the user for hardware information.

noshell
This command disables shell access on virtual console 2 during an installation.

nousb
This command disables the loading of USB support during the installation. If the installation program tends to hang early in the process, this command may be helpful.

nousbstorage
This command disables the loading of the usbstorage module in the installation program's loader. It may help with device ordering on SCSI systems.

reboot=b
This command changes the way the kernel tries to reboot the machine. If a kernel hang is experienced while the system is shutting down, this command will allow the system to reboot.

rescue
This command will run rescue mode. Refer to the Official Red Hat Linux Customization Guide for more information about rescue mode.

resolution=
Tells the installation program which video mode to run. It accepts any standard resolution, such as 640x480, 800x600, 1024x768, and so on.

serial
This command turns on serial console support.

skipddc
This command skips the ddc monitor probe which causes problems on some systems.

text
This command disables the graphical installation program and forces the installation program to run in text mode.

updates
This command will prompt you to insert a floppy diskette containing updates (bug fixes). This is not needed if you are performing a network installation and have already placed the updates image contents in RHupdates/ on the server.