Archive for the 'General' Category

Kernel Config

Tuesday, March 15th, 2005

I’ll put some relevant parts of my kernel config here (some irrelevant parts too):

Device Drivers  --->
  ATA/ATAPI/MFM/RLL support  --->
    <*>   Enhanced IDE/MFM/RLL disk/cdrom/tape/floppy support
    <*>     Include IDE/ATA-2 DISK support
    <*>     Include IDE/ATAPI CDROM support
    ---     IDE chipset support/bugfixes
    <*>     generic/default IDE chipset support
    [*]     PCI IDE chipset support
    [*]       Generic PCI bus-master DMA support
    [*]         Use PCI DMA by default when available
    <M>         AMD and nVidia IDE support
  SCSI device support  --->
    [*]   legacy /proc/scsi/ support
    ---   SCSI support type (disk, tape, CD-ROM)
    <*>   SCSI disk support
    SCSI low-level drivers  --->
    [*] Serial ATA (SATA) support
    <*>   Promise SATA TX2/TX4 support
    <*>   VIA SATA support
  Multi-device support (RAID and LVM)  --->
    [*] Multiple devices driver support (RAID and LVM)
    <*>   Device mapper support
  Networking support  --->
    [*] Networking support
    [*] Network device support
    Ethernet (10 or 100Mbit)  --->
      [*] Ethernet (10 or 100Mbit)
      <*>   Generic Media Independent Interface device support
      [*] EISA, VLB, PCI and on board controllers
      <M>   VIA Velocity support
  I2C support  --->
    <M> I2C support
    <M>   I2C device interface
          I2C Algorithms  --->
          <M> I2C bit-banging interfaces
          I2C Hardware Bus support  --->
          <M> ISA Bus support
          <M> VIA 82C596/82C686/823x
  Multimedia devices  --->
    <M> Video For Linux
  Sound  --->
    <*> Sound card support
        Advanced Linux Sound Architecture  --->
        <M> Advanced Linux Sound Architecture
          <M> OSS Mixer API
          <M> OSS PCM (digital audio) API
          <M> Emulation for 32-bit applications
          <M> RTC Timer support
              PCI devices  --->
                <M> VIA 82C686A/B, 8233 South Bridge
File systems  --->
  <*> Second extended fs support
  [*]   Ext2 extended attributes
  [*]     Ext2 POSIX Access Control Lists
  <*> Ext3 journalling file system support
  [*]   Ext3 extended attributes
  [*]     Ext3 POSIX Access Control Lists
  <M> JFS filesystem support
  [*] Dnotify support
  <*> Kernel automounter version 4 support (also supports v3)
      Pseudo filesystems  --->
      [*] /proc file system support
      [*] /dev file system support (OBSOLETE)
      [*]   Automatically mount at boot
      [*] Virtual memory file system support (former shm fs)
      [*] HugeTLB file system support
      Network File Systems  --->
      <*> NFS file system support
      [*]   Provide NFSv3 client support
      <*> NFS server support
      [*]   Provide NFSv3 server support
      [*]   Provide NFS server over TCP support
      <*> SMB file system support (to mount Windows shares etc.)

Doing things right, before your eyes

Tuesday, January 18th, 2005

Ok, I’ve changed some of the things I’m going to do, so I’m starting from scratch (again)

First, boot off of the livecd. Use the “gentoo” kernel.

gentoo

Next, load in the module for the sata hard drive and the network card.

# modprobe sata_via
# modprove via-velocity

Get an IP, and check to see that we can ping the outside world

# dhcpcd eth0
# ping www.google.ca

Everything working as expected so far.

Here’s where I diverge from the previous attempt - I’ve decided to use LVM to handle most of the system’s filesystems. This way I can get away with leaving them undersized a bit, and expanding them as need arises. I’ve decided to go with two logical volumes, in hopes that I can get away with keeping most of my system on one drive, and only using physical volume spanning when I add another hard drive for the myth recordings. This changes my partition structure as follows:

/dev/sda1 -> /boot - 100Megs
/dev/sda2 -> swap - 2Gigs
/dev/sda3 -> / - 5 Gigs
/dev/sda4 -> Extended
/dev/sda5 -> vg1: /var /usr /home /tmp - 30 Gigs
/dev/sda6 -> vg2: reserved for myth recordings - The rest ~ 163Gigs

I set the type of sda5 and sda6 to Linux LVM (8e)

set up swap:

# mkswap /dev/sda2
# swapon /dev/sda2

Load the LVM module and follow the instructions from the Gentoo LVM2 howto:

#modprobe dm-mod

mkdir -p /etc/lvm
# echo ‘devices { filter=[”r/cdrom/”] }’ >/etc/lvm/lvm.conf
# vgscan

Create the physical volumes:

# pvcreate /dev/sda5 /dev/sda6

Create the volume groups (creatively named vg1 and vg2):

# vgcreate vg1 /dev/sda5
# vgcreate vg2 /dev/sda6

Create the logical volumes:

# lvcreate -L10G -nusr vg1
# lvcreate -L5G -nvar vg1
# lvcreate -L2G -ntmp vg1
# lvcreate -L10G -nhome vg1

If you do the math up there, it doesn’t quite add up to the 30G that I allocated in fdisk. I couldn’t allocate the full 13G for /home, and I assume that’s because of the way space is calculated (1000 vs. 1024) but I’m not positive. I actually increased it with:

# lvextend -L+500M /dev/vg1/home

and so on, until it arrived at 10.95GB, which is all that would fit.

Now I make the filesystems:

# mke2fs -j /dev/sda1
# mke2fs -j /dev/vg1/usr
# mke2fs -j /dev/vg1/var
# mke2fs -j /dev/vg1/tmp
# mke2fs -j /dev/vg1/home

Next we mount the filesystems:

# mount /dev/sda3 /mnt/gentoo
# mkdir /mnt/gentoo/boot
# mkdir /mnt/gentoo/usr
# mkdir /mnt/gentoo/var
# mkdir /mnt/gentoo/tmp
# mkdir /mnt/gentoo/home

# mount /dev/sda1 /mnt/gentoo/boot
# mount /dev/vg1/usr /mnt/gentoo/usr
# mount /dev/vg1/var /mnt/gentoo/var
# mount /dev/vg1/tmp /mnt/gentoo/tmp
# mount /dev/vg1/home /mnt/gentoo/home

# chmod 1777 /mnt/gentoo/tmp

I made sure the time and date were correct, and set to GMT - we’re GMT-6 here, and I’ll set the timezone stuff up later.

Extract the stage 1 tarball from the liveCD:

# tar -xvjpf /mnt/cdrom/stages/stage1-amd64-2004.3.tar.bz2

Unpack the portage snapshot from the liveCD:

# tar -xvjf /mnt/cdrom/snapshots/portage-20041022.tar.bz2 -C /mnt/gentoo/usr

Add in the use flags that I want:

# nano -w /mnt/gentoo/etc/make.conf

I made the following changes to that file:

CFLAGS=”-march=athlon64 -O2 -pipe”
MAKEOPTS=”-j2″

Next comes the painful mirrorselction bit (only painful because it’s slow, and I should have kept the selected mirrors that I found last time…)

# mirrorselect -a -s4 -o |grep ‘GENTOO_MIRRORS=’ >> /mnt/gentoo/etc/make.conf

While that’s running, I might as well copy over the DNS resolution information to it’s new home:

# cp -L /etc/resolv.conf /mnt/gentoo/etc/resolv.conf
# mount -t proc none /mnt/gentoo/proc

Now comes the chroot to the new environment:

# chroot /mnt/gentoo /bin/bash
# env-update
# source /etc/profile

Update the portage tree:

# emerge –sync

(Note that’s a double dash before sync, but this blog software autoconverts it to an em-dash)

Based on what I’ve read about MythTV, here’s what I set up for additional use variables (in /etc/make.conf):

“USE=X gtk gtk2 kde mysql apache2 dvd lirc dvdr encode imap php samba xine xvid xvidinfo”

A couple of those aren’t required for Myth, but this box will also be doing other stuff for me, so I added them in. Also worth noting is that those are just the ones that I didn’t spot in the default list. Once I get the system up and running to the point where I can post to this blog with it, I’ll post the output of “emerge info” that lists all the use flags that are set for the system.

Next I set up the system to only activate the locales I care about:

# echo “sys-libs/glibc userlocales” >> /etc/portage/package.use

and then specify the system to only use the following locales:

en_US/ISO-8859-1
en_US.UTF-8/UTF-8

by commenting out all the other lines.

Now I’m ready to bootstrap the installation. I want to see approximately how long it takes to do the compilation, so I download the files first:

# cd /usr/portage
# scripts/bootstrap.sh -f

then once the download is done, I run:

# scripts/bootstrap.sh



It only took about an hour and a half to two hours. Not so bad.

Next, I need to get the core system source:

# emerge –fetchonly system

It kept timing out, so I hit Ctrl-c and commented out the GENTOO_MIRRORS=”….” line in /etc/make.conf and ran it again.

After a much better download, I did the real deal:

# emerge system

It took a while, but I didn’t think to time it.

Next step is to get the kernel source installed:

# emerge gentoo-dev-sources

Next I did a manual configuration of the kernel:

# cd /usr/src/linux
# make menuconfig

I’ll post my kernel config here later, when I can copy/paste from the menuconfig into the web.

After all that configuring, compiling the kernel and modules with:

# make && make modules_install

took only a couple of minutes to complete - I guess this machine is a lot faster than my old P200 (I compiled my OpenBSD kernel on it once. Once.)

So that’s where I sit. I haven’t configured the modules yet, and I haven’t set up the system for a reboot, but I’m well on my way to a fully functional Gentoo system.

Uh Oh…

Monday, December 27th, 2004

So, I ran into some troubles with the running of bootstrap.sh. I keep getting Oops’s and kernel panics all the time. I searched the Gentoo forums, and found recommendations to check the ram.

I hope against hope, keep reading to try and find another explanation (all the while knowing in my gut that it’s actually the RAM that’s at fault) and eventually give up and run MEMTEST86. 45000+ errors in a single pass. Not good.

I emailed NCIX to request an RMA, and they obliged. I guess I’ll have to wait a little bit before continuing my Gentoo fun.

Success

Wednesday, December 22nd, 2004

Flashed the bios - everything went swimmingly.

Next step - install Gentoo. Or die trying.

I popped in the Gentoo CD that I’d created earlier and booted it up. Unfortunately flashing the bios reset the boot options that I’d set up so it booted off of the hard drive instead of the CD. I rebooted, set the option in the bios to boot off of the CDRom first, and rebooted again. This time, everything seemed to come up properly.

At the “boot:” prompt, this time I typed:

# gentoo doscsi

because I read somewhere that the gentoo installer treats sata like scsi or something. Well, that didn’t work, it hung up when scanning for the sata_sis module or something. Reboot and try again. This looks like it is going to be a lot of work.

# gentoo

this time. Doesn’t look like it picked up the SATA hard drive. More drastic measures are required.

#modprobe sata_via

There - now I can see my hard drive (/dev/sda)

Next step is the networking. Apparently the network card wasn’t installed. Several places suggested that the via-rhine module would work, but it didn’t. Eventually I did:

#modprobe via-velocity

and had network - woo hoo! Almost. Still have to get an ip:

#dhcpcd eth0

Now we’re cooking. I can ping www.google.ca.

Now I have to fdisk my hard drive to set up the partitions. I’ll document my decisions here - keep in mind that I’m dealing with a 200 Gb drive, so I’ve deliberately oversized all the partitions (sometimes ridiculously)

/dev/sda1 -> /boot - 100Megs
/dev/sda2 -> swap - 2Gigs
/dev/sda3 -> /home - 20 Gigs
/dev/sda4 -> Extended
/dev/sda5 -> /var - 5 Gigs
/dev/sda6 -> /usr - 10 Gigs
/dev/sda7 -> / - 5 Gigs
/dev/sda8 -> Future home of MythTV recordings

Now I have to make the filesystems:

#mke2fs -j /dev/sda1
#mke2fs -j /dev/sda3
#mke2fs -j /dev/sda5
#mke2fs -j /dev/sda6
#mke2fs -j /dev/sda7
#mkfs.jfs /dev/sda8

do the swap partition next -

#mkswap /dev/sda2
#swapon /dev/sda2

Now make the mountpoints and mount the filesystems:

#mount /dev/sda7 /mnt/gentoo
#mkdir /mnt/gentoo/boot
#mkdir /mnt/gentoo/home
#mkdir /mnt/gentoo/var
#mkdir /mnt/gentoo/usr

#mount /dev/sda1 /mnt/gentoo/boot
#mount /dev/sda3 /mnt/gentoo/home
#mount /dev/sda5 /mnt/gentoo/var
#mount /dev/sda6 /mnt/gentoo/usr

Now I have to unpack the stage 1 tarball:

#tar -xvjpf /mnt/cdrom/stages/stage1-amd64-2004.3.tar.bz2

Then the portage snapshot:

#tar -xvjf /mnt/cdrom/snapshots/portage-20041022.tar.bz2 -C /mnt/gentoo/usr

That takes some time - Portage is really big.

I edit /mnt/gentoo/etc/make.conf to reflect these:

CFLAGS=”-march=athlon64 -pipe -O2″
MAKEOPTS=”-j2″

Run mirrorselect to set fast mirrors:

#mirrorselect -a -s4 -o |grep ‘GENTOO_MIRRORS=’ >> /mnt/gentoo/etc/make.conf

This takes a while too.

In the meanwhile, I switched to the second console (Ctrl+Alt+F2) and finished up some other stuff that needs to be done before I start compiling. Copy the DNS stuff over:

# cp -L /etc/resolv.conf /mnt/gentoo/etc/resolv.conf

Mount the proc filesystem:

# mount -t proc none /mnt/gentoo/proc

Now that the mirror list is done, I can chroot to /mnt/gentoo and rebuild the environment variables:

# chroot /mnt/gentoo /bin/bash
# env-update
# source /etc/profile

I think it’s getting a little late, and syncing portage will take a while, so I’m going to call it a night after issuing one last command :

#emerge –sync

So far it’s been fairly painless…

Flashing the motherboard’s bios

Wednesday, December 22nd, 2004

At this point, I have hit a brief roadblock. I want to flash the bios of my motherboard so that it supports my RAM in dual channel mode at it’s full speed - currently the motherboard recognizes it as DDR333, when in reality it’s DDR400. I successfully downloaded the bios flash utility from Soltek but it requires a boot floppy.

After I found a blank floppy, I realized that the laptop has no floppy drive, which kind of complicates things. Fortunately, I can boot from CD, so I found Bart’s boot CD methods, and am in the process of burning a bootable CD containing my bios update utility and updated bios.

Wish me luck!

The hardware arrives

Wednesday, December 22nd, 2004

Placeholder for the first night’s travails.

Selecting the Linux distribution

Wednesday, December 22nd, 2004

I started out wanting to use KnoppMyth, but the more I read about it, the more problems that I had with it.

First, I want to host this website on the server too, and KnoppMyth doesn’t seem to be that easy to keep secure. It’s intended to be run completely behind a firewall, isolated from most/all outside connections. I’m sure it would be fine, but I’d like a distro that’s easier to update.

Eventually, I decided to check out Gentoo Linux because it seems to be one of the more BSD-like distros out there. I also really like the idea of Portage, which is very comfortable to me (coming from running this server on OpenBSD for a while now)

There are also lots of howtos for Gentoo, and everything seems pretty simple to do. Overall, Gentoo looks like it’ll be a lot of fun to set up, and easy to configure. It doesn’t hurt that they’ve got AMD64 support fairly well advanced either.

Selecting the hardware

Wednesday, December 22nd, 2004

Initially, I was going to just use KnoppMyth, which has a lot of really good information on their Wiki. They have suggested hardware, so I went to NCIX and built/ordered a PC based on their recommendations.

Two things happened though. First, my credit card payment was rejected because we’d recently moved, and hadn’t changed our address with the CC company, so the billing address I’d given them didn’t match up. At the same time, I saw an article speculating that the Athlon XP is nearing the end of the road. I decided that I’d actually do a little more research and see what kind of system I could build, that wouldn’t already be obsolete.

Here’s what I wound up with:

Antec Sonata case - quiet with a good 380W power supply

SOLTEK K8TPRO-939 motherboard - onboard audio (S/PDIF in and out) lots of expandability for extra drives

AMD Athlon 64 - 3200+ - lots of power for what I need, and at a good price point.

ASUS V9520-X/TD GEFORCE FX 5200 video card. Decent price, heatsink cooled (no noisy fan) and plenty fast enough for my needs. Also good driver support for Linux.

200Gb Seagate Barracuda SATA - I wanted a native SATA drive(ie not an IDE drive with a SATA controller board on it,) and this fit the bill.

2×512Mb Samsung PC3200 RAM. I debated myself on spending more on RAM, but supposedly this RAM works, and Samsung isn’t exactly a small player in the RAM business.

Hauppauge PVR-250 purchased gently used from a friend.

MyBlaster Serial to control the satellite receiver

Welcome to my new site

Wednesday, December 22nd, 2004

I plan to track how I got my AMD64 Gentoo MythTV system created - all the obstacles I ran into and how I overcame them. I will also link to any resources that I come across along the way. Hopefully it’ll help me out, and maybe someone else will find this site and find it useful.