# Installing Gentoo 2004.3 for AMD64 with ASUS K8V-Deluxe MoBo

## magnesium

Newbie's Guide: How I installed Gentoo 2004.3 for AMD64 on my ASUS K8V-Deluxe motherboard system

this is an update from the 2004.2 guide

Overview

The purpose of this document is to track how I was successfully able to install Gentoo Linux release 2004.2 for AMD64 on my system. The thought is that what works for me will probably work for someone else too.

Documentation conventions

Lines that start with # mean Im typing the command in as root in the console

Indented lines means that Im typing in an application invoked with the previous #

 means a comment follows and should not be typed

Words in between [] mean hit that key

A + following a word between [] means hold down the key represented by the [] word and hit the following key (and of course release the keys being held down).

Assumptions

I assume that you have a vague understanding of unix style commands or are at least trusting that what I typed is correct. Ive used linux off and on for a bit, but this guide is written for newbie skill level.

I also assume that you will take shortcuts like hitting the [up arrow] to bring up previous commands, using [tab] to complete file names.

Another assumption is that you know to use [alt] + [F2] to switch the 2nd console window, and you can use [alt] + [F1] to get back to the 1st console window.

Hardware

Since the type of hardware you have and the way it is configured is so important to installing Linux, here is my setup.

System components:AMD Athlon 64 3200+

Asus K8V Deluxe Motherboard

ATI Radeon 9800 Pro video card

LG 32x16x10x CD-RW drive

IBM DVD drive

2x 40GB ATA 133 Maxtor hard drives 

20.5 GB ATA 100 Quantum Fireball hard drive

1GB PC400 CL3 RAM

Logitech Mx700 Mouse

Logitech wireless keyboard

Samsung s570tft LCD monitor

3.5 floppy driveSystem configuration:CD-RW is master on IDE bus 0

DVD drive is slave on IDE bus 0

20.5 GB drive is master on IDE bus 1

40 GB hard drives are in RAID0 array on Promise ATA raid controller

Mouse is connected to USB port

Keyboard is connected to PS/2 port

Monitor is connected by standard VGA cable (HD15)

Bios configuration:

Time and date is set to local time

SATA controller is disabled

Boot order is floppy, then DVD drive, then hard drive

Network configuration:

Internet connection is DSL

Linksys router handles PPPoE connection to internet and provides DHCP to Local area network. This device also acts as a firewall, forwarding only specified WAN traffic to computers on my LAN.

Goals:

I already have windows 2000 installed on my RAID drives. I want to be able to wean myself off of widows by getting more familiar with Linux, but have to have the ability to switch back and forth.

End design is to have Gentoo installed on the 20.5GB drive, configured to have working network and sound.

I want the most current, stable packages installed, so I will install everything from the network.

Apache web server to run with php 4 and SSL support

SSH daemon running for secure remote connectivity

Since ATI does not have AMD64 Linux drivers yet, Im going to disable X-Windows support. However, I have to retain the ability to install it in the future. Supposedly the AMD64 linux drivers are coming out in the December 2004 release from ATI. Once I get it working, Ill add a link to how in this guide.

Id like to get my mouse working in the console mode for things like cutting and pasting.

The end result should be as efficient as possible. I may have a lot of horse power, but I dont want to waste an ounce of it.

Base System Build Steps:

To start off, I downloaded a Gentoo 2004.3 minimal iso image from a Gentoo mirror site and burnt the ISO to a CD in windows.

I then rebooted the machine and configured BIOS so that hard drive to boot from is the 20.5GB drive, which is where I want to have my Gentoo install reside.

Inserted Gentoo live CD into my DVD drive and rebooted the computer

[enter] to load generic kernel

First things first, Ive got to have Linux recognize my network card and my hard drive.

```
# modprobe sk98lin onboard Gigabit Ethernet driver

# net-setup eth0

   2: Wired

   1: Use DHCP to auto-detect my network settings
```

Note that I do want to statically set an IP address for this computer once its built (because I need to set the router firewall to forward to this box for ssh and web access) but that happens later.

Its time to set up the hard drive partitions. Because my hard drive is the master drive on the second IDE bus, I have to use hdc.

```
# fdisk /dev/hdc

   m for help

   d to delete previous partitions (1 at a time)

   n for new partition

      p for primary partition

         1 for 1st partition

            +128M for 128 Meg boot partition

   n for new partition

      p for primary partition

         2 for 2nd partition

            +512M for 512 Meg swap partition

   n for new partition

      p for primary partition

         3 for 3rd partition

            [enter] for rest of drive

   a for mark bootable partition.

      1 to select the boot partition to be bootable

   t for changing a partition type

      2 to select the swap partition

         82 to change to Linux Swap type file system

   p to confirm partition is set how I want it

   w to save changes and quit
```

So the drives are partitioned but its still got whatever data was on the drive before. To fix that Ive got to format the drives with the file systems I want. I choose reiserfs because Im told that this version is faster.

```
# mkreiserfs /dev/hdc1 --format 3.6 format partition with Reiser FS

# mkreiserfs /dev/hdc3 --format 3.6 

# mkswap /dev/hdc2 format the swap partition

# swapon /dev/hdc2turn on the swap partition
```

Now its time to start using my hard drive. Ill make my partitions accessible and then move into the new root partition

```
# mount /dev/hdc3 /mnt/gentoo

# mkdir /mnt/gentoo/boot

# mount /dev/hdc1/boot

# cd /mnt/gentoo 'now my working directory is the hard drive root partition
```

Because I want this system totally customized for my system, I have to compile everything on it starting from step 1. Starting at step 1 means downloading the stage 1 tarball.

```
# links2 http://www.gentoo.org/main/en/mirrors.xml

   [enter] gets rid of popup

   [down arrow] until I find a server that looks physically close

   [right arrow]  to go to selected link

      [down arrow] to select releases

      [right arrow] to go there

         [down arrow] to select amd64

         [right arrow] to go there

            [down arrow] to select 2004.3

            [right arrow] to go there

               [down arrow] to select stages

               [right arrow] to go there

                  [down arrow] to select stage1-*.bz2

                  d to download it

                     [enter] to start downloading

                     q to quit

                        [enter] to confirm
```

Lets get that file we downloaded unzipped.

```
# tar -xjpvf stage1-*.bz2 the file name doesnt actually contain a *, but this shortcut works for my documentation purposes and works in the console
```

To specify that I only have one CPU to compile with, I edit the make.conf file.

```
# nano etc/make.conf edit make.conf file

   modify the CFLAGS to make compiled programs more efficient

   CFLAGS=-march=athlon64 -O2 -pipe

   type on a line on its own at bottom of file

   MAKEOPTS="-j2" set up for single CPU compiling

   [ctrl] + x exit

   y  yes to save changes

   [enter] same file name
```

Now its time use mirrorselect to grab a list of close mirror servers that I can download from. We grab only the lines returned by mirrorselect that contain the text GENTOO_MIRRORS= and append our make.conf file with the results. 

```
# mirrorselect a s4 o | grep 'GENTOO_MIRRORS=' >> etc/make.conf 
```

Note: if you have trouble downloading packages to emerge, you may want to comment out the GENTOO_MIRRORS= line in your /etc/make.conf file.

Its just about time to stop using the CD and start using the hard drive. Before we can do that we have to copy to the hard drive where we resolve our DNS searches, and also the list of devices that we have active.

```
# cp L /etc/resolv.conf etc/resolv.conf

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

Slip into the hard drives operating system context. Note that some commands are still run from the CD, but we dont see it anymore

```
# chroot /mnt/gentoo /bin/bash

# env-update

# source /etc/profile

# emerge sync get newest list of portage files
```

Ignore the message saying that a newer version of portage is available. It gets upgraded later.

By default some options are configured that you may not want to compile. Since its my box, I want complete control over what gets compiled into packages. This meets the objective of having an efficient system.

```
# emerge info check out what cumulative compilation options are set. Since make.conf file does not yet contain any USE flags, this tells you what default USE flags are set.
```

For every setting thats specified by default, I check out what it does by running

```
# more /usr/portage/profiles/use.desc
```

Now we set our preferred USE flags, overriding the default flags. The [minus] before a use flag means that we are removing support for that option, and flags are separated by a space. Because ATI sucks and does not yet have AMD64 linux drivers, I remove all X-Windows supported flags. If they eventually get around to making them, I will remove the [minus] flags for the options I want enabled.

```
# nano /etc/make.conf

   USE="-f77 -fortran doc ssl alsa oss dvd cdr sockets"

# emerge info confirm that USE flags are what they should be. Some left at default are desired.
```

Now is time to really start the installation.

```
# cd /usr/portage

# scripts/bootstrap.sh This part takes a while. If your screen goes blank, you can hit the [shift] key to see where its at.
```

Now we get the basic tools we need. Before actually compiling the package, we should view what will be compiled. Its considered good practice to run emerge with the -pv option before emerging anything to verify your USE flags are good for the package. -p means pretend, -v means verbose

```
# emerge -pv system view what will be installed based on what options. 

# emerge system Actually emerges it. This also takes a while.
```

My system warned me that 1 config file in /etc needs updating. Portage warns me because I would have to explicitly approve any files in the important /etc folder to be overwritten. This time the following command contains a [single quote], and it is not a comment. Maybe I made a bad choice for my comment indicator, but Im sticking with it for now.

```
# find /etc -iname '._cfg*'
```

This just let me know that portage wants my DIR_COLORS file to be overwritten. I dont want to be bothered with this again and its not important enough to change, so I delete the pending change.

```
# rm /etc/._cfg* deletes all the ._cfg files in the etc direcectory. In this case 1 file.
```

 Im a paranoid kind of person so I want to verify that any file that asks to be updated actually needs to be. If I found that the files needed to be updated, Id run the script etc-update to update those files. etc-update automatically updates trivial files, and I have no idea what it considers trivial, so I make sure to check first.

Because the BIOS time is set to local time, Ive got to let Linux in on that info. I set the timezone by creating a link from the localtime file to the zoneinfo file.

```
# ln -sf /usr/share/zoneinfo/UTC /etc/localtime
```

Get the latest AMD64 kernel

```
# emerge gentoo-dev-sources

# cd /usr/src/linux
```

Time to configure the kernel. This step is very important to get right, because its a fine line between an efficient system and a system that doesnt fully work.

```
# emerge udev hotplug
```

 if you want to use udev fs instead of the devfs that is becoming obsolete

```
# make menuconfig creates an ncurses gui to do kernel configuration
```

Note: how to move around the menu

[up arrow] to go up a menu selection

[down arrow] to go down a menu selection

[enter] steps into a menu selection and sometimes selects a choice

[Esc] twice goes back a level in the menu

y sets an option to yes

n sets an option to no

m sets an option to module

? for help

The options that should be set or unset are as follows. Note that the version of the linux kernel that this is written for is kernel-2.6.9-r1. If a section or choices are skipped over, that means leave it at its default setting. Vital choices are included so I cant screw it up too bad. Ive also included choices for my particular video card and file system, which you may need to change if your system is different then mine.

```

   Code maturity level options --->

      Prompt for development and/or incomplete code/drivers

   General setup --->

      Support for paging of anonymous memory (swap)

      System V IPC

      POSIX message Queues

      BSD Process Accounting

      Sysctl support

      (18) Kernel log buffer size (16 => 64kb, 17 => 128KB)

      Support for hot-pluggable devices

      Kernel .config support

      *REMOVE* Enable access to .config through /proc/config.gz

   Loadable module support --->

      Enable loadable module support

        Module unloading

          *REMOVE* Force module unloading

      Automatic kernel module

   Processor type and features --->

      Processor Family (something) --->

         AMD-Opteron/Athlon64

      /dev/cpu/*/msr - Model-specific register support

      /dev/cpu/*/cupid - CPU information support

      MTRR (Memory Type Range Register) support

      *REMOVE ALL OTHERS*

   Power management options --->

      Power Management support

      *REMOVE* Software Suspend (EXPERIMENTAL)

      ACPI (Advanced Configuration and Power Interface) Support --->

         *REMOVE* Sleep States (experimental)

         *REMOVE* AC Adapter

         *REMOVE* Battery

         *REMOVE Laptop Extras options*

         *REMOVE* Debug Statements

   Bus options (PCI etc.) --->

      PCI device name database

      *REMOVE ALL ELSE*

   Executable file formats / Emulations --->

      Kernel support for ELF binaries

      *MODULE* Kernel support for MISC binaries

      IA32 Emulation

        IA32 a.out support

   Device Drivers --->

      Block Devices --->

         Normal floppy disk support

         *REMOVE ALL ELSE*

      ATA/ATAPI/MFM/RLL support --->

         ATA/ATAPI/MFM/RLL support

           Enhanced IDE/MFM/RLL disk/cdrom/tape/floppy support

             Include IDE/ATA-2 DISK support

            *REMOVE* Use multi-mode by default

             Include IDE/ATAPI CDROM support

             generic/default IDE chipset support

               PCI IDE Chipset Support

                 Generic PCI bus-master DMA support

            Use PCI DMA by default when available

            *REMOVE* AMD and nVidia IDE support

            *REMOVE* Intel PIIXn chipsets support

            VIA82CXXX chipset support

      SCSI device support --->

         *REMOVE ALL AND IN SUBTREES*

      Fusion MTP device support --->

         *REMOVE*

      Networking Support --->

         Networking Support

         Network device support

           Ethernet (10 or 100Mbit) --->

            *REMOVE*

           Ethernet (1000Mbit) --->

            *MODULE* Marvell Yukon chipset / SysKonnect SK-98

            *REMOVE ALL OTHERS*

         *REMOVE* Network console logging support

      Input device support --->

         AT keyboard support

         Mice

           *MODULE* PS/2 mouse

         Misc

           *MODULE* PC Speaker support

      Character devices --->

         /dev/agpgart (AGP Support) (NEW)

            AMD Opteron/Athlon64 on-CPU GART support

         *REMOVE* RAW driver (/dev/raw/rawN) (OBSOLETE)

      I2C support --->

         *MODULE* I2C device interface

         I2C Hardware Bus support --->

            *MODULE* ISA Bus support

            *MODULE* VIA 82C596/82C686/823x

         Hardware Sensors Chip support  --->

            *MODULE* National Semiconductor LM75 and                   *MODULE* Winbond W83627HF, W83627THF, 

         Other I2C Chip support --->

            *MODULE*  EEPROM reader

      Graphics support  --->

         Support for frame buffer devices

         ATI Radeon display support

            DDC/I2C for ATI Radeon support

         Console display driver support --->

               Video mode selection support

            Framebuffer Console support

         Logo configuration --->

            *SELECT ALL*

         Support for the framebuffer splash

      Sound --->

         Sound card support

         Advanced Linux Sound Architecture --->

            *MODULE* Advanced Linux Sound Architecture

            *MODULE* OSS Mixer API (NEW)

            *MODULE* OSS PCM (digital audio) API (NEW)

            *MODULE* Emulation for 32-bit applications

            *MODULE* RTC Timer support

            PCI devices --->

               *MODULE* VIA 826C686A/B, 8233 South Bridge

         Open Sound System --->

            *REMOVE ALL*

      USB support --->

         *MODULE* Support for Host-side USB

           USB device filesystem

           *MODULE* EHCI HCD (USB 2.0) support

           *MODULE* UHCI HCD (amd and VIA) support

           *MODULE* USB Human Interface Device (full HID) support

           HID input layer support

   File systems --->

      ReiserFS support

         ReiserFS extended attributes

      Dnotify support

      *REMOVE OTHERS*

      CD-ROM/DVD Filesystems --->

         ISO 9660 CDROM file system support

         UDF file system support

      DOS/FAT/NT Filesystems --->

         *MODULE* MSDOS fs support

         *MODULE* VFAT (Windows-95) fs support

      Pseudo filesystems --->

         /proc file system support

         /dev file system support (OBSOLETE)

           Automatically mount at boot

         Virtual memory file system support (former shm fs)

      Network File Systems --->

         *MODULE* CIFS support (advanced network filesystem ...)

      Native Language Support --->

         Base native language support

         (iso8859-1) Default NLS Option (NEW)

         NLS UTF8

   Profiling support --->

      *REMOVE* OProfile system profiling (Experimental)

   Cryptographic options --->

      Cryptographic API

        HMAC support (NEW)

        MD5 digest algorithm (NEW)

        SHA1 digest algorithm (NEW)

        DES and Triple DES EDE cipher algorithms (NEW)

        AES cipher algorithms (NEW)

```

Done configuring, now compile it.

```
# make && make modules_install
```

Copy the kernel to where it will be used, and back up your kernel .config file there for backup purposes

```
# cp arch/x86_64/boot/bzImage /boot/kernel-2.6.9-gentoo

# cp .config /boot/config-2.6.9-gentoo
```

Lets identify what modules to automatically load when this system boots up

```
# nano /etc/modules.autoload.d/kernel-2.6

   sk98lin add this line to bottom of file for network support

   usbhid for usb devices

   ehci-hcd for usb 2.0 support

   uhci-hcd for usb 1.1 support

# modules-update
```

Lets now tell the system how to mount file systems, and when

```
# nano /etc/fstab

   /dev/hdc1      /boot      reiserfs      noauto,notail      1 2

   /dev/hdc2      none      swap      sw         0 0

   /dev/hdc3      /      reiserfs      notail         0 1

   /dev/cdroms/cdrom0 /mnt/cdrom   iso9660   noauto,user      0 0

   /dev/cdroms/cdrom1 /mnt/dvd   iso9660   noauto,user,ro      0 0

   /dev/fd0      /mnt/floppy   auto      noauto,user      0 0

   none         /proc      proc      defaults      0 0

   none         /dev/shm   tmpfs      defaults      0 0

```

And now create the dvd directory for mounting the dvd drive

```
# mkdir /mnt/dvd
```

And now I name my baby. I use a dynamic DNS redirector service and the full name of my dns record is dabox.drivel.org

```
# echo dabox > /etc/hostname

# echo drivel.org > /etc/dnsdomainname

# rc-update add domainname default
```

Because I want to have dabox.drivel.org point to this box, I need to specify a static IP for this computer. Ill later configure my router to forward services supported to this box.

```
# nano /etc/conf.d/net

   iface_eth0="192.168.1.5 broadcast 192.168.1.255 netmask 255.255.255.0"

   gateway="eth0/192.168.1.1"

# rc-update add net.eth0 default
```

This box should have a shortcut to resolve its own IP address based on its name. This is an addition to the localhost record that is already in the hosts file.

```
# nano /etc/hosts

   192.168.1.5 dabox.drivel.org dabox
```

Set the root password so I can log in once I reboot or log off this computer. Also, Im going to create another user account that Ill be able to log in with

```
# passwd

   <set root password>

   <confirm root password>

# useradd max -m -G users,wheel,tty,audio -s /bin/bash

# passwd max

   <set max password>

   <confirm max password>
```

All systems should have a system logger and a way of scheduling jobs, so lets add them now.

```
# emerge metalog

# rc-update add metalog default

# emerge vixie-cron

# rc-update add vixie-cron default
```

Very important if I want to be able to boot from my system, install a boot manager. Because there is no AMD64 compatible code, I compile it statically to use the x86 version.

```
# emerge --usepkg grub-static

# cp -Rpv /usr/share/grub/i386-pc/* /boot/grub
```

And now I configure the gurb boot loader to boot from hard drive hdc. Because hdc is my first hard drive in the system, and grub starts counting at 0, I have to call hdc1 (hd0,0). Ive got a couple of different boot options for the same kernel so that I can run at different video modes. The first mode is plain vanilla and the others are for my video card, so it may need some slight modifications for you.

```
# nano /boot/grub/grub.conf

   default 0   first option is the one I want autoselected

   timeout 10   if I dont hit enter in 10 seconds, assume I want to boot from default

   splashimage=(hd0,0)/grub/splash.xpm.gz   pretty background that comes with grub

   title=Gentoo Linux 2.6.9 caption for grub menu

   root (hd0,0) the /boot partition

   kernel /kernel-2.6.9-gentoo root=/dev/hdc3 the kernel file located on /boot and the partition to load for starting up (in linux device speak)

title=Gentoo linux 2.6.9 w/ framebuffer

root (hd0,0)

kernel /kernel-2.6.9-gentoo root=/dev/hdc3 vga=0x317

title=Gentoo linux 2.6.9 w/ radeon framebuffer

root (hd0,0)

kernel /kernel-2.6.9-gentoo root=/dev/hdc3 video=radeonfb:ywrap,pmipal,1024x768-32@60 splash=silent,theme:emergence

initrd /boot/fbsplash-emergence-1024x768 
```

Copy over the drives that I have mounted now to the mtab file. If you dont do this, grub-install wont work.

```
# cp /proc/mounts /etc/mtab
```

Invoke the grub boot loader installer, copying my configuration info to the boot sector of the hard drive.

```
# grub-install --root-directory=/boot /dev/hdc
```

Finally we can test out our install and really boot from system. Seems like a lot of work to finally get to this step, but we have to have faith that we did everything right and the system will boot.

```
# exit

# cd ..

# umount /mnt/gentoo/boot /mnt/gentoo/proc /mnt/gentoo

# reboot
```

Note: Dont forget to eject the CD

Hardware Compatibility Steps:

Oh my god! It worked! It actually worked! (Results may very based on how well I typed this up and how well you can follow directions). Cool. Now that the base system is installed, lets get all the harware specific stuff up and running.

First lets get the hardware sensors working. These are the sensors that monitor things like heat and power consumption of your components. Note that some of the probes can take quite a bit of time; Dont panic.

```
# emerge lm-sensors

# sensors-detect

   just keep hitting the [enter] key at each prompt until the program asks about ISA/smbus?

   smbus chose smbus rather then ISA bus. This uses the modules we compiled into the kernel.

   yes this writes out the /etc/conf.d/lm_sensors file.

# nano /etc/modules.conf

   alias char-major-89    i2c-dev uncomment this line for i2c and lm_sensors
```

Now check that it works by typing in the following command 

```
# sensors
```

If everything seems cool, add lm_sensors to start automatically. 

```
# rc-update add lm_sensors default
```

Lets make those widows keys functional. Seems simple enough.

```
# nano /etc/rc.conf

   SET_WINDOWKEYS="yes"
```

How about a working mouse for cutting and pasting in the console? That would be nice. Weve already compiled the necessary pieces into the kernel and set the USB modules needed for my mouse to be loaded at boot time, so all that is needed is to get the software and configure it.

Check if you need to download the software

```
# emerge -pv gpm
```

If the gpm results displays something like "ebuild  R", that means the gpm package was already installed and you dont need to emerge it again. This seems to be the case with my system, but Im not sure if I played around too much or if its now included in part of the emerge system or bootstrap. FYI, and ebuild  N means new emerge (you dont have it installed), and the same thing but with a U means upgrade the package (you see that most often when you do an emerge -pvu <package>).

To test out the mouse, type in

```
# gpm -m /dev/input/mice -t imps2
```

You shold now be able to move the mouse and see the cursor moving around. If you dont, check the forums for someone whos had the same issue before.

You can stop gpm by issuing the command 

```
# gpm -k
```

Make sure that gpm is in your use flags. You can use the following command to quickly see:

```
# emerge info | grep 'gpm'
```

If you see a USE= line returned, then you can find the gpm in that line. If you dont, then add it to your make.conf

I get tired of typing the gpm command line each time I log in, and a way of getting it to start up on boot exists, so lets configure that.

```
# nano /etc/conf.d/gpm 

   MOUSE=imps2 uncomment this line 

   MOUSEDEV=/dev/input/mice and uncomment as well

   APPEND="-l \"a-zA-Z0-9_.:~/\300-\326\300-\366\370-\377\"" uncomment also

# rc-update add gpm boot
```

To make sure that this works (without actually rebooting) run 

```
# /etc/init.d/gpm start
```

Move the mouse and watch the cursor around. Fun!

For those that dont know gpm, its a great way for cutting and pasting text from the console. The left mouse button held down will highlighted text as the mouse is dragged, which copies the highlighted text into a buffer. Middle clicking pastes that buffer into the active console. Theres also the left click at the beginning of the desired text to copy and then right click the end the selection, then middle clicking to paste. This is the way people post their error messages into the forums for help.

How can they enter the information into the forums? We dont have links2 ever since we chrooted into out image. Lets install that text based web browser, which incidentally accepts input from the mouse if you have the gpm USE flag. Slick how were bringing it up just now, no?

```
# emerge links
```

Now we test by starting up links

```
# links
```

Now Im going to teach you a couple of neat tricks with links because I think that its a great browser. The best text one Ive seen so far. If you hit the [esc] key, you bring up the menu. If you then navigate through the menu to Setup, like by clicking on it, and then to Terminal options, you can actually allow color. Note that if youre navigating by keyboard through the options you have to hit the [space bar] key to select options. Ok out of the options to make your change. Then bring up the menu again, go to setup again, and select Save options. This will make it so that the next time you use links the color is set. Note that links saves the settings only for the current user, so you need to do this for every user that you want this set for.

Hit the g key on your keyboard to go to your favorite website, type in https://forums.gentoo.org and hit the [enter] key.

Hit the s key to bring up the Bookmark manager, and select the add option to add this site to your bookmarks.

Hit the q key to quit

Enough web browsing fun. Its time to get sound to work. Install the backwards compatibility and alsa utilities like so

```
# emerge alsa-oss alsa-utils
```

Let the alsa utilities know what driver to use and allow backwards compatibility for OSS apps. These are uncommented lines and the via line is modified.

```
# nano /etc/modules.d/alsa

   alias snd-card-0 snd-via82xx kernel driver

   alias sound-slot-0 snd-card-0 backwards compatibility

# modules-update
```

Now we need to load the drivers (i.e. the kernel module we created way back then) and the best way to do this, because were going to test the setup anyways, is to start alsasound

```
# /etc/init.d/alsasound start
```

You should see a message saying that mixer levels are not yet set, so lets fix this. We have to set the volume levels and unmute the audio channels for the sound support to work.

```
# amixer set Master 100 unmute master volume level

# amixer set PCM 100 unmute the headphone jack on the sound card, I think
```

Now its time to test her out. You should probably download a wav file and an mp3 file to make sure that your sound card actually plays the files correctly. Feel free to use links2 to download a file, or using ftp or wget.

Lets get an mp3 player on this box. Ive personally had better experiences with mp3blaster then mpg123, and also like the way mp3blaster is laid out better.

```
# emerge mp3blaster
```

You can use mp3blaster to play wav files as well as mp3s. Also, you can use aplay that comes with alsa-utils to test out a .wav file, but dont be shocked if you see an error message like cant play not PCM-coded WAVE-files. It means its encoded with something like Windows media player, and I dont know how to decode that yet.

If all is good, you can set alsasound to start on boot

```
# rc-update add alsasound boot
```

Server Application Setup Steps:

If you remember, there was some key applications that I wanted to set up.

Lets start with getting an ssh server installed, and creating the main encryption keys

```
# emerge openssh

# ssh-keygen -b 2048 -f /etc/ssh/ssh_host_dsa_key -t dsa

   [enter] no passphrase

   [enter] confirm no passphrase

# ssh-keygen -b 2048 -f /etc/ssh/ssh_host_rsa_key -t rsa

   [enter] no passphrase

   [enter] confirm no passphrase
```

Lets confirm that the ssh server that we installed actually works

```
# sshd start the ssh daemon (server)

# ssh localhost try ssh-ing to this box

   yes accept risk of connecting

   <root password> login

# exit exit the secure shell connection now that we know it works.
```

Weve confirmed that sshd works, so it should load every time the system boots

```
# rc-update add sshd default
```

Its not a good practice to let people ssh to your box and try to guess the root password, so were going to limit the ability to log in as root remotely. This means youll need to ssh to a regular user account that is part of the wheel group and su to root for remote administration of the box.

```
 # nano /etc/ssh/sshd_config

   PermitRootLogin no
```

And then restart ssh. Because I started the ssh daemon with sshd and not using the init.d script, Ive got to kill the sshd process.

```
# killall sshd terminates all sshd processes running

# /etc/init.d/sshd start
```

Next lets install the mysql database, and set it up to start upon boot as well.

```
# emerge mysql

# /usr/bin/mysql_install_db

# /etc/init.d/mysql start

# mysql

   SET PASSWORD FOR root@localhost=PASSWORD('<new_password>');

   exit

# rc-update add mysql default
```

Since mysql is installed, we should allow other applications to use it. Lets add it to our USE flags

```
# nano /etc/make.conf

    add mysql to use flags
```

Time to install the apache web server with support for php. The version that I installed at the time of this writing (apache-2.0.52-r1) has what I would consider bugs and so Ive denoted certain sections with *BUGFIX* which can hopefully be taken out of this doc once they fix the bugs.

```
# emerge apache mod_php
```

Let apache know that it has to support SSL as well as PHP4 (or replace PHP4 with PHP5 if that was installed). this is an uncomment and addition to a line already in the apache2 conf.d file.

```
#  nano /etc/conf.d/apache2

   APACHE2_OPTS="-D SSL -D PHP4"
```

Apache sometimes will complain if its manually started and doesnt know its own hostname so lets uncomment the localhost name in the apache2.conf file

```
# nano /etc/apache2/conf/apache2.conf

   ServerName localhost uncomment this line
```

Now make sure that apache2 knows what to do with php code. This is an addition to an existing file. Try adding it to the sensible place in the commonapache2.conf file

```
# nano /etc/apache2/conf/commonapache2.conf

   AddType application/x-httpd-php .php .phtml

   AddType application/x-httpd-php-source .phps
```

*BUGFIX* create the directories that the ebuild was supposed to but didnt. 

```
#mkdir /var/log/apache2 /var/cache/apache2 /etc/apache2/conf/ssl
```

*BUGFIX* No default SSL key and certificate were created, so we have to do that as well.

```
# mkdir /root/CA && chmod 0700 /root/CA && cd /root/CA

# openssl genrsa -des3 -out my-ca.key 2048

   <enter a passphrase> should be an actual phrase, like from your favorite book

   <confirm passphrase> this passphrase is for the root CA we are creating.

# openssl req new -x509 -days 3650 -key my-ca.key -out my-ca.crt

   <enter the my-ca.key passphrase>

   <2 letter country code>

   <state or province>

   <city>

   <organization name> like www.mywebsite.com or something

   <organizational unit name> enter Certificate Authority

   <common name>  like www.mywebsite.com CA

   <email address>

# openssl x509 -in my-ca.crt -text -noout test out the root CA cert

# openssl genrsa -des3 -out server.key 1024

   <enter a different passphrase> this passphrase is for the web server

   <confirm the passphrase>

# openssl req -new -key server.key -out server.csr

   <enter the server.key passphrase>

   <2 letter country code>

   <state or province>

   <city>

   <organization name> like www.mywebsite.com or something

   <organizational unit name> enter Web Service

   <common name>  enter FQDN for server. In my case its dabox.drivel.org

   <email address>

   <challenge password> hit [enter] to leave blank. Its a web server, so unneeded

   <optional company name> hit [enter] to leave blank

# openssl x509 -req -in server.csr -out server.crt -sha1 -CA my-ca.crt -CAkey my-ca.key -CAcreateserial -days 365

   <enter the my-ca.key passphrase>

# openssl x509 -in server.crt -text -noout test out the web server cert

# chmod 0400 *.key

# cp server.crt /etc/apache2/conf/ssl/ && cp server.key /etc/apache2/conf/ssl/
```

*OPTIONAL BUGFIX*This certificate that we just created will ask for the passphrase every time you start apache. If you are like the rest of the world and want apache to start on bootup when you are perhaps not around to enter the passphrase, and youre not totally concerned with the security implications, then you can do the following.

```
# cd /etc/apache2/conf/ssl

# cp server.key server.key.org

# openssl rsa -in server.key.org -out server.key

   <enter the server.key.org passphrase (old server.key passphrase)>

# chmod 0400 server.key
```

Test out that apache2 start ok

```
# /etc/init.d/apache2 start
```

Configure apache2 to start on boot.

```
# rc-update add apache2 default
```

Since Apache2 is installed, we should allow other applications to use it. Lets add it to our USE flags

```
# nano /etc/make.conf

    add apache2 to use flags
```

Note: Any user can add a public_html directory under their home folder and it will immediately be accessable to apache. For instance my user max has a public_html directory in his home directory and I can get to it by browsing to http://dabox.drivel.org/~max/

Thats it for me. I hope this helps you too.

References

Base installation of gentoo for AMD64 CPUs

GenSplash quick installation guide

Alsa installation guide

MySQL installation info

Apache and php installation

lm_sensor installation info

Gentoo security guide

Creating Apache TSL/SSL certificates Mini-HOWTOLast edited by magnesium on Tue Nov 16, 2004 4:36 pm; edited 4 times in total

----------

## magnesium

Forgot to mention that if you want to get a mouse working in the console (for cutting and pasting), you can install gpm

*SNIP*

this has now been included in the newbie guide aboveLast edited by magnesium on Tue Nov 16, 2004 4:38 pm; edited 1 time in total

----------

## G3n2

thx , gpm rules  :Very Happy: 

----------

## TopKnot

Thank you for the guide, I was able to install without a hitch, ..... untill, yep I typed in the wrong name for the kernel in grub and  now get the file not found error. 

EDIT: Found out how to edit grub from the splash screen, all is well now.

Again great info, I could not have done it as easily without it.

----------

## subterrific

I got my K8V Deluxe when they first came out, and the BIOS was very picky about RAM. I had to manually lower the timings for my RAM in the BIOS for it to be stable. Since then ASUS has released a few BIOS upgrades, all of which have worked great for me. However, I'm sure some people are buying boards now that don't have the latest BIOS and they really should upgrade. I found instructions for making a freedos boot cd under linux and I was able to copy the bios upgrade files to the iso before burning the cd. I followed the instructions here: http://www.nenie.org/misc/flashbootcd.html BIOS Upgrades: http://usa.asus.com/prog/spec.asp?m=K8V%20Deluxe&amp;langs=09 (follow the download link on the left).

----------

## BlinkEye

very nice howto. i would have appreciated it when i set up a very similar system some time ago. just for the record - you are able to get X up and running with vesafb (i do have an ati 9800). video performance is very bad but X works flawlessly. 

now my question:

 *magnesium wrote:*   

> For me to run gpm for my Logitech MX700 mouse attached to my usb port, I would run the following command as root
> 
> ```
> # gpm -m /dev/mouse -t imps2
> ```
> ...

 

how do you do that? if i use the usb connection of my MX700-set i'm not able to use the keyboard or the mouse. i MUST use the ps/2 adapter which i don't like because i can't push my tower back to the wall as far as i used to.

----------

## magnesium

I am aware that X works in this type of scenario for 2D under the XOrg system (XFree86 is depricated under AMD64 architecture) with a generic driver, but figure that since I can't get use of my Video Card in Accelerated 3D, I won't bother. I understand that My post may have seemed like it was impossible and thank you for bringing to light that it is, just performs very poorly.

In answer to your question, let me first state that I do not have a USB keyboard so I am not sure if you are experiencing any type of conflict through that method. What worked for me was compiling into the kernel the following

PS/2 mouse support

Support for host-side USB

USB HID (Human Interface Device)

USB EHCI (for USB 2.0 (may not be necessary))

USB UHCI (for via chipset usb 1.1 support)

USB device filesystem

HID input layer support

because I compiled the USB HID, EHCI, and UHCI I modprobe them (or add them to the /etc/modules.autoload.d/kernel-2.6 and then modules-update)

I have a links from my /dev/usbmouse to /dev/input/mice so you may want to try /dev/usbmouse in your gpm string. For some reason I can use both /dev/mouse and /dev/usbmouse and am not sure if I am supposed to.

----------

## BlinkEye

stupid me. i enabled OHCI support instead of UHCI. obviously the mouse and keyboard are an USB-1 device which i didn't notice and that's why it didn't work. i was never suspicious because my USB-2 hd worked...

thanks a lot, you pointed me into the right direction!

----------

## Cr0t

what about lm-sensors support?

after emerging and compiling all the kernel stuff just load

```
eeprom

lm75

i2c-sensor

i2c-isa

i2c-viapro

i2c-dev

w83627hf
```

----------

## ballyn

No need for

```
find /etc -iname '._cfg*'
```

That's what etc-update is for...

----------

## magnesium

the point is for determining what files are going to be updated by etc-update, so that you have control over the system. At the time of writing, etc-update did not show you a diff between the non-trivial files that it was updating I plan on updating the document completely when the 2004.3 reslease is made, and will carefully consider implementing Cr0t's suggestions.

Cr0t: If you know of a console method of poling the lm-sensors I'd be very interested in hearing it.

I've just noticed that my apache installation information is wrong, so I'll edit that now, but that's it until 2004.3

----------

## Thardin

Thank you very much!   :Cool: 

----------

## Cr0t

Did you guys play with gcc 3.4 yet?

----------

## tsk1979

 *Cr0t wrote:*   

> what about lm-sensors support?
> 
> after emerging and compiling all the kernel stuff just load
> 
> ```
> ...

 

Yes, they are suipported very well. Am using it on K8VX. When you do sensors detect there is a portion when it asks for ISA/smbus. Choose smbus. somehow ISA is not working

----------

## magnesium

Crot: Do you know of a console method of polling the sensors?

Also, I've rocked the gcc version 3.4 and greater. check out my post at https://forums.gentoo.org/viewtopic.php?t=227942

----------

## Cr0t

 *magnesium wrote:*   

> Crot: Do you know of a console method of polling the sensors?
> 
> Also, I've rocked the gcc version 3.4 and greater. check out my post at https://forums.gentoo.org/viewtopic.php?t=227942

 

```
10:34:42^cr0t@HQ:~ > sensors 

w83697hf-isa-0290

Adapter: ISA adapter

VCore:     +1.49 V  (min =  +3.46 V, max =  +1.54 V)              

+3.3V:     +3.22 V  (min =  +1.98 V, max =  +1.38 V)              

+5V:       +5.05 V  (min =  +2.63 V, max =  +6.69 V)              

+12V:     +10.82 V  (min =  +9.73 V, max = +13.80 V)              

-12V:      -0.11 V  (min =  -7.01 V, max =  -7.67 V)              

-5V:       +5.10 V  (min =  +2.19 V, max =  +1.53 V)              

V5SB:      +5.40 V  (min =  +1.77 V, max =  +5.21 V)              

VBat:      +0.59 V  (min =  +1.04 V, max =  +0.02 V)              

fan1:     2896 RPM  (min = 2860 RPM, div = 2)                     

fan2:     3443 RPM  (min = 168750 RPM, div = 2)                     

temp1:       +27 C  (high =   +16 C, hyst =   -49 C)   sensor = thermistor           

temp2:     +34.5 C  (high =   +80 C, hyst =   +75 C)   sensor = thermistor           

alarms:   Chassis intrusion detection                      ALARM

beep_enable:

          Sound alarm disabled

eeprom-i2c-1-51

Adapter: SMBus Via Pro adapter at 0400

Memory type:            DDR SDRAM DIMM

Memory size (MB):       512

eeprom-i2c-1-50

Adapter: SMBus Via Pro adapter at 0400

Memory type:            DDR SDRAM DIMM

Memory size (MB):       512
```

----------

## Justin-Time

Hi I have the same motherboard and installed it almost like this. I only don't understand why you would compile your soundcard and your ethernet card as module? Just compile it in the kernel so you don't have to worry about the modules.

I also had huge problems with the memory... I had a 512MB infinion bank which only could run stable on 333..... When I used memtest86 on 400mhz it was just full of errors.... Can this really be the board that's so picky?

----------

## Cr0t

 *Justin-Time wrote:*   

> Hi I have the same motherboard and installed it almost like this. I only don't understand why you would compile your soundcard and your ethernet card as module? Just compile it in the kernel so you don't have to worry about the modules.
> 
> I also had huge problems with the memory... I had a 512MB infinion bank which only could run stable on 333..... When I used memtest86 on 400mhz it was just full of errors.... Can this really be the board that's so picky?

 

All the AMD64 boards are a bitch if it's about RAM!

----------

## magnesium

Justin-Time: The point is to be efficient and isolate potential error areas. That is why I use module; it cuts down on boot image size and gives me a troubleshooting buffer.

I also remember reading some articles on Toms Hardware a while ago about CL2 ram having major issues at different clockings on different motherboards. The lesson is really stick with what your motherboard manufacturer has tested and posted as RAM models that works at what speed.

Crot: Thanks dude. you rock!

All: I'm going to update this guide for the 2004.3 image shortly. Do you think that I should create a new guide or modify this one? Also, what features would you like to see added / removed? I'll definitely add the lm-sensor stuff.

----------

## tatsmae

 *magnesium wrote:*   

> All: I'm going to update this guide for the 2004.3 image shortly. Do you think that I should create a new guide or modify this one? Also, what features would you like to see added / removed? I'll definitely add the lm-sensor stuff.

 

Maybe setting up basic graphics might be good. Or should it be other things to worry about?  :Shocked: 

Cheers for giving superb guide.  :Surprised: 

----------

## Cr0t

 *tatsmae wrote:*   

>  *magnesium wrote:*   All: I'm going to update this guide for the 2004.3 image shortly. Do you think that I should create a new guide or modify this one? Also, what features would you like to see added / removed? I'll definitely add the lm-sensor stuff. 
> 
> Maybe setting up basic graphics might be good. Or should it be other things to worry about? 
> 
> Cheers for giving superb guide. 

 

Basic graphics?

----------

## Cr0t

ey dude... maybe you wana add SATA support?

I mean if you wana do this do it right =)

```
[*] Serial ATA (SATA) support                                           

<*>   Promise SATA TX2/TX4 support                                                       

<*>   VIA SATA support
```

*UpDate*And what about firewire... dude update your shiznet =)

----------

## magnesium

I'd be happy to add all requested hardware options to the installation. Just Private Message me and I'll let you know where to mail the hardware to.  :Very Happy: 

I'll work on a new doc shortly, just after I finish some home repairs first. Think 1.5 week timeframe. I'm going to work on making the document more modular, where if you want to install Xorg: go see such and such, if you want to use gcc-3.2 then do so and so.

----------

## Cr0t

 *magnesium wrote:*   

> I'd be happy to add all requested hardware options to the installation. Just Private Message me and I'll let you know where to mail the hardware to. 
> 
> I'll work on a new doc shortly, just after I finish some home repairs first. Think 1.5 week timeframe. I'm going to work on making the document more modular, where if you want to install Xorg: go see such and such, if you want to use gcc-3.2 then do so and so.

 

hahaha... bro, I would be happy to help you out. I am using all the feature, which that board offers. Except the SoundCard I disabled the soundcard on day one and threw my SoundBlaster Live! Gold in.

So let's throw your brain, my brain and all the other people who gave some input in the 2004.3 release?!

2004.3 should include FireWire, USB1+2, SATA, ... and so on.

----------

## jdevers

Not to pick nits, but Xorg actually supports the 9800 pro very nicely in 2D.  Not through the Vesa driver, but the radeon driver.  It is obviously 2D only, but is very fast...actually, I use it in 32 bit mode because I have no need for 3D/Tvout etc and it seems faster than the ati-drivers.

----------

## benxor

You're using my avatar! You!-- oh. I see you are a Guru.

....

*pads softly away*

----------

## Donny

 *Cr0t wrote:*   

> ey dude... maybe you wana add SATA support?
> 
> I mean if you wana do this do it right =)
> 
> ```
> ...

 

Thanks for the tip   :Smile: 

I needed also to activate 

```
<M> SCSI disk support
```

to see my raid again

----------

## Cr0t

 *Donny wrote:*   

>  *Cr0t wrote:*   ey dude... maybe you wana add SATA support?
> 
> I mean if you wana do this do it right =)
> 
> ```
> ...

 I sent the dude who started this an update, but he never updated anything. If he is ever going to update the install you will get firewire, sata and some other stuff =)

----------

## Donny

Yes I saw that option too and activated it as module.

Tomorrow i get my firewire cable so i can connect my dv cam and see if it works.

----------

## Donny

If you want to use your e.g. dvcam then enable this too:

```
IEEE 1394 (FireWire) support --->

   <M> IEEE 1394 (FireWire) support

   ---    Device Drivers

   <M> OHCI-1394 support

   ---    Protocol Drivers

   <M> OHCI-1394 Video support

   <M> OHCI-DV I/O support

   <M> Raw IEEE1394 I/O support
```

----------

## robet

Nice job on the update... looks good!

----------

## snutte

Followed the guide and it worked well. Good job.  :Smile: 

----------

## tcbounce

Um guys,

Just letting you know that lm-sensors has been misdetecting our motherboards winbond chip that's responsible for checking temperatures.

According to a popular windows I2C application with many many motherboards (and a bunch of MCSE's on mailing lists chatting about it we have Winbond 83697hf chips (I could open the board and check..)

I've seen this brought up on the mailing lists for lm_sensors, because some people like myself can only detect 1 fan. There is more than one winbond chip as well. So lm-sensors is doing a misdetect and needs a patch in the future. I'll let you all know when I solve the problem and get support for all the fans.

Cheers,

LUke

----------

## magnesium

Thanks for letting us know that. I know that a lot of people have talked about the need to properly calibrate their sensors, so hopefully that's all that is required from yours and not that your motherboard is in some way deficient. I personally only have 1 case fan and 1 CPU fan, so I can't comment on the multiple fan scenario.

BTW, now that the ATI drivers have come out for linux x86_64, I'm planning on updating my guide. I'm also considering playing around with the 2005.0 image and updating this guide with the new procedures, but I need to find out how to back up my configs and stuff first.

In other words, check back for changes in a couple of weeks.

----------

