Wednesday, June 16, 2004

Gentoo Install 5 (Manual Kernel Configuration)

(previous post - building the kernel)

Note: This is for a VIA EPIA ME6000 motherboard being used as a headless server. All of the multimedia and graphic options are disabled. (See my previous install.) If this is your first install, you should probably use the "genkernel" method rather then manual configuration. The Gentoo docs explain configuring the kernel. They recommend being familiar with the "cat /proc/pci" and "lsmod" commands which is something I missed on my previous install.
# cd /usr/src/linux
# make menuconfig

Anywhere in the following list where I say "turn ON" means to use the "Y" key to turn an option on as built-in, I'll specifically say MODULE if I loaded the option as a module.

Linux Kernel v2.6.6 Configuration
(C)ode maturity level options
(G)eneral setup
--> (C)onfigure standard kernel features for small systems (turn ON)
--> --> (O)ptimize for size (turn ON)
(L)oadable module support
(P)rocessor type and features
--> (P)rocessor family (changed to "CyrixIII/VIA-C3")
--> (S)ymetric multi-processing support (turned this one OFF)
--> M(a)chine Check Exception (turned this OFF)
(P)ower management options (ACPI, APM)
(B)us options (PCI, PCMCIA, EISA< MCA, ISA)
(E)xecutable file formats
(D)evice drivers
--> (P)arallel port support (turned OFF)
--> (A)TA/ATAPI/MFM/RLL support (turned ON the VIA82CXXX chipset support as BUILT-IN)
--> M(u)lti-device support (turn it ON)
--> --> (R)AID support (turn it ON as BUILT-IN)
--> --> --> (R)AID-1 mirroring mode (turn it ON as BUILT-IN)
--> --> (D)evice mapper support (set to MODULE, per section 13 of LVM2 guide)
--> N(e)tworking support
--> --> N(e)twork device support, (E)thernet 10/100Mbit
--> --> --> (R)ealTek RTL-8139 PCI (turn OFF)
--> --> --> (V)IA Rhine (turn ON as BUILT-IN)
--> --> --> --> (U)se MMIO instead of PIO (turn ON)
--> (C)haracter Devices
--> --> (I)ntel/AMD/VIA HW Random Number Generator (turn ON as BUILT-IN)
--> --> /(d)ev/agpgart AGP Support
--> --> --> (I)ntel 440LX/BX/GX I8xx E7x05 (turn OFF)
--> --> --> (V)IA chipset support (turn ON as BUILT-IN)
--> (I)2C support (turn ON, heavily reliant on building an MP3 server for these options)
--> --> (I)2C device interface (turned ON as BUILT-IN, epiawiki says "on", MP3 server article says "off")
--> --> (I)2C Algorithms
--> --> --> (I)2C bit-banging interface (turn ON as BUILT-IN)
--> --> (I)2C Hardware Bus support
--> --> --> (V)IA 82C586B support (turn on as BUILT-IN)
--> --> (I)2C Hardware Sensors Chip
--> --> --> (V)IA686A (turn on as BUILT-IN)
--> (S)ound
--> --> (S)ound card support (turn OFF)
(F)ile systems
--> (P)seudo filesystems
--> --> /(d)ev file system support OBSOLETE (turn ON)
--> --> --> (A)utomatically mount at boot (turn ON)
(P)rofiling support
(K)ernel hacking
(S)ecurity options
(C)ryptographic options
--> (C)ryptographic API (turn ON)
--> --> (H)MAC support (turn ON)
--> --> (turn ON the others as MODULE)
(L)ibrary routines

Exit and save your configuration. Then build the kernel (the following is for 2.6 kernels). Expect the compile to take about an hour.
make && make modules_install

Now you need to install your kernel into the boot partition. Change the "2.6.6-gentoo" portion of the filenames to whatever you want.
# cp arch/i386/boot/bzImage /boot/kernel-2.6.6-gentoo
# cp System.map /boot/System.map-2.6.6-gentoo
# cp .config /boot/config-2.6.6-gentoo

Next is 7.e. Installing Separate Kernel Modules, which is where we specify which modules from above that we configured as "MODULE" instead of "BUILT-IN" get loaded at bootup. Use the command "nano -w /etc/modules.autoload.d/kernel-2.6" to edit your config file. Here is what mine looked like (yours will probably be different).
# autoloads the following modules at boot time
#LVM2 (logical volume manager)
dm-mod

#ethernet
#mii (not needed?)
#via-rhine (compiled as built-in)

I also need to emerge in LVM2 support as well as the "raidtools" package (per Gentoo x86 Installation Tips & Tricks).
# modules-update
# emerge lvm2
# emerge raidtools

Time to edit the "/etc/fstab" table (see 8.a. Filesystem Information and also refer back to my mount commands from earlier). Here's my "/etc/fstab" file:
/dev/md0 /boot ext2 noauto,noatime 1 2
/dev/md2 / ext3 natime 0 1
/dev/md1 none swap sw 0 0
/dev/cdroms/cdrom0 /mnt/cdrom auto noauto,user 0 0

/dev/vgmirror/opt /opt ext3 noatime 0 3
/dev/vgmirror/usr /usr ext3 noatime 0 3
/dev/vgmirror/var /var ext3 noatime 0 3
/dev/vgmirror/home /home ext3 noatime 0 0
/dev/vgmirror/tmp /tmp ext2 noatime 0 3
/dev/vgmirror/vartmp /var/tmp ext2 noatime 0 3

none /proc proc defaults 0 0
none /dev/shm tmpfs defaults 0 0

Change your hostname, domainname, and the default run level.
# echo yourhostname > /etc/hostname
# echo yourdnsname > /etc/dnsdomainname
# rc-update add domainname default
# nano -w /etc/conf.d/net
(either use iface_eth0="dhcp" or configure your IP and gateway)
# rc-update add net.eth0 default
# cat /etc/resolv.conf
(verify your DNS servers if you specified a static IP)
# nano -w /etc/rc.conf
(change CLOCK="UTC" to CLOCK="local")

Onward to chapter 9, configuring the bootloader. Here's where I ran into trouble; "emerge grub" or "emerge lilo" failed with "cannot automatically mount your /boot partition".
# emerge grub


(continued in my next post)

No comments: