Sunday, July 23, 2006

And some more... Genkernel!

  • Install the kernel source: USE="-doc symlink" emerge gentoo-sources
    • USE="-doc" allows avoiding xorg-x11 or other dependencies
    • USE="symlink" is not necessary for a new install, but ensures proper creation of the /usr/src/linux symlink
  • Check the symlink and take note of where it points (linux-2.6.16-gentoo-r13): ls -l /usr/src/linux
At this point, I could either compile the kernel manually, or use genkernel to help me do it. I've tried this both ways already, mostly recently compiling manually. This time I'm going to try genkernel again, being careful to disable most of the stuff that I don't need. Genkernel is supposed to produce an environment similar to that of the installation cd. I like that, because the installation cd works. Specifically, it's good at detecting my hardware.
  • Emerge the genkernel ebuild: emerge genkernel
  • Copy over the kernel configuration used by the installation cd to the location where genkernel looks for the default configuration: zcat /proc/config.gz > /usr/share/genkernel/x86/kernel-config-2.6
  • Compile kernel sources, using menuconfig: genkernel --menuconfig all
    • The menuconfig option causes an interactive, menu-based kernel configuration utility to be invoked before building the kernel
    • The all option causes the initrd, kernel image, and modules to be built
  • Disable & Enable configuration options in menuconfig
    • Bus options ->PCCARD (PCMCIA/CardBus) support -> < > PCCard (PCMCIA/CardBus) support
    • Networking -> < > Bluetooth subsystem support
    • Multi-device support (RAID and LVM) -> [ ] Multiple devices driver support (RAID and LVM)
    • IEEE 1394 (FireWire) support -> [ ] IEEE 1394 (FireWire) support
    • Network device support -> Wireless LAN (non-hamradio) -> [ ] Wireless LAN drivers (non-hamradio) & Wireless Extensions
    • Network device support -> Token Ring devices -> [ ] Token Ring driver support
    • File systems -> < > Reiserfs support
    • File systems -> < > JFS filesystem support
    • File systems -> < > XFS filesystem support
  • Exit & save new kernel configuration
  • Save the names of the kernel & initrd that werer created: ls /boot/kernel* /boot/initramfs*
    • /boot/initramfs-genkernel-x86-2.6.16-gentoo-r13
    • /boot/kernel-genkernel-x86-2.6.16-gentoo-r13
  • Emerge & enable coldplug to detect non-boot-necessary hardware
    • emerge coldplug
    • rc-update add coldplug boot
  • Configure the modules that should be autoloaded
    • View all available modules: find /lib/modules// -type f -iname '*.o' -or -iname '*.ko'
    • Edit /etc/modules.autoload.d/kernel-2.6 and add the names of any modules that should be loaded
    • Not sure what to put here, so I didn't add anything for now.
  • Create fstab
    • Edit /etc/fstab
    • Update to include the following settings
      • /boot: /dev/sda1 /boot ext3 defaults,noatime 1 2
      • swap: /dev/sda2 none swap sw 0 0
      • /: /dev/sda3 / ext3 noatime 0 1
      • /var: /dev/sda5 /var ext3 noatime 0 0
      • /video: /dev/sda6 /video ext3 noatime 0 0
      • /proc: proc /proc proc defaults 0 0
      • tmpfs: shm /dev/shm tmpfs nodev,nosuid,noexec 0 0
      • cdrom: /dev/cdroms/cdrom0 /mnt/cdrom auto noauto,user 0 0
      • floppy: /dev/fd0 /mnt/floppy auto noauto 0 0
  • Set the hostname
    • Edit /etc/conf.d/hostname
    • HOSTNAME="hostname"
  • Set the domainname
    • Edit /etc/conf.d/domainname
    • DNSDOMAIN="homenetwork"
  • Configure networking to use dhcp
    • Edit /etc/conf.d/net
    • config_eth0=( "dhcp" )
    • dhcp_eth0="nodns nontp nonis"
  • Configure networking to start at boot: rc-update add net.eth0 default
  • Configure hostname resolution for local network:
    • Edit /etc/hosts
    • 127.0.0.1 localhost hostname
  • Set the root password: passwd
  • Update system configuration
    • Edit /etc/rc.conf
    • DISPLAYMANAGER="kdm"
    • EDITOR="/bin/nano"
  • Configure keyboard
    • Edit /etc/conf.d/keymaps
    • KEYMAP="us"
    • SET_WINDOWKEYS="yes"
    • //!!! come back here as a possible cause of weird buffer problems //!!!
  • Configure clock
    • Edit /etc/conf.d/clock
    • Set CLOCK="UTC" because system clock is set to UTC
  • Install system logger
    • emerge syslog-ng
    • rc-update add syslog-ng default
  • Install cron
    • emerge vixie-cron
    • rc-update add vixie-cron default
  • Install logrotate: emerge logrotate
  • Configure logrotate: Edit /etc/logrotate.conf
    # see "man logrotate" for details
    # rotate log files weekly
    weekly

    # keep 4 weeks worth of backlogs
    rotate 4

    # create new (empty) log files after rotating old ones
    create

    # uncomment this if you want your log files compressed
    #compress

    # RPM packages drop log rotation information into this directory
    include /etc/logrotate.d

    notifempty
    nomail
    noolddir

    # no packages own lastlog or wtmp -- we'll rotate them here
    /var/log/wtmp {
    monthly
    create 0664 root utmp
    rotate 1
    }

    /var/log/lastlog {
    monthly
    rotate 1
    }

    # system-specific logs may be configured here
  • Install file indexing: emerge sys-apps/slocate
  • Install DHCP client: emerge dhcpcd

No comments: