Sunday, July 23, 2006

So here goes...

Time for another try.

Here are some docs I've been referencing:
  • Gentoo Linux Handbook (http://www.gentoo.org/doc/en/handbook/handbook-x86.xml)
Here are the steps I'm following:
  • Insert 2006.0 Gentoo Minimal Install CD and power on.
  • Type gentoo at the prompt and hit [enter]
    Things don't work correctly if I skip typing gentoo, even if gentoo is supposed to be the default kernel. No "gentoo", no networking.
  • Hit [enter] or stop paying attention long enough to accept the default keymap.
  • Hit [F2] to switch to verbose mode & make sure that it's detecting the onboard neworking.
  • Make sure networking was configured correctly: ifconfig eth0
  • Test networking some more: ping -c 3 www.google.com
  • Figure out a partitioning scheme
    • /dev/sda1: ext3, 32M, /boot
    • /dev/sda2: swap, 1024M, swap
    • /dev/sda3: ext3, 10240M, /
    • /dev/sda4: extended
    • /dev/sda5: ext3, 2048M, /var
    • /dev/sda6: ext3, remainder, /video
  • Partition the hard drive
    • Start fdisk: fdisk /dev/sda
    • Display current partition configuration: p
    • Remove all current partitions: d,
    • Verify all partitions are deleted: p
    • Create /boot partition
      • create new partition: n
      • primary partition: p
      • select first partition: 1
      • accept default first cylinder: [enter]
      • size: +32M
    • Make boot partition bootable
      • toggle a bootable flag: a
      • select the partition to toggle: 1
    • Verify boot partition: p
    • Create swap partition
      • create new partition: n
      • primary partition: p
      • select second partition: 2
      • accept default first cylinder: [enter]
      • size: +1024M
    • Set the swap partition's type
      • change partition type: t
      • select second partition: 2
      • select linux swap type: 82
    • Verify the swap partition: p
    • Create / partition
      • create new partition: n
      • select primary partition: p
      • select third partition: 3
      • accept default first cylinder: [enter]
      • size: +10240M
    • Create extended partition
      • create new partition: n
      • selected extended partition: e
      • selects partition 4 by default
      • accept default first cylinder: [enter]
      • accept default last cylinder: [enter]
    • Create /var partion
      • create new partition: n
      • accept default first cylinder: [enter]
      • size: +2048M
    • Create /video partition
      • create new partition: n
      • accept default first cylinder: [enter]
      • accept default last cylinder: [enter]
    • Save the filesystem layout: w
  • Create the filesystems
    • Make /boot ext3: mke2fs -j /dev/sda1
    • Make / ext3: mke2fs -j /dev/sda3
    • Make swap swap
      • mkswap /dev/sda2
      • swapon /dev/sda2
    • Make /var ext3: mke2fs -j /dev/sda5
    • Make /video ext3: mke2fs -j /dev/sda6
  • Mount the partitions
    • Mount / partition: mount /dev/sda3 /mnt/gentoo
    • Make mount directories for all the other partitions
      • mkdir /mnt/gentoo/boot
      • mkdir /mnt/gentoo/var
      • mkdir /mnt/gentoo/video
    • Mount /boot partition: mount /dev/sda1 /mnt/gentoo/boot
    • Mount /var partition: mount /dev/sda5 /mnt/gentoo/var
    • mount /video partition: mount /dev/sda6 /mnt/gentoo/video
  • Verify filesystems & mounts: df -h
  • Set system time
    • See www.timeanddate.com/worldclock to get UTC local time
    • date [month,2][day,2][hour, UTC,2][minute,2][year,4]
  • Get the stage tarball
    • Change to the gentoo mountpoint: cd /mnt/gentoo
    • Use links to open mirror listing for tarballs: links http://www.gentoo.org/main/en/mirrors.xml
    • Select mirror from list
    • Browse to /releases/x86/2006.0/stages/
    • Select a stage3 tarball (stage3-x86-2006.0.tar.bz) and press d to download
    • select the digests file and press d to download
    • Verify the integrity of the tarball: md5sum -c stage3-x86-2006.0.tar.bz2.DIGESTS
    • Unpack the tarball: tar xvjpf stage3-x86-2006.0.tar.bz2
  • Install a Portage snapshot:
    • Change directory: cd /mnt/gentoo
    • Open mirror listing: links http://www.gentoo.org/main/en/mirrors.xml
    • Select mirror from list
    • Browse to /snapshots
    • Download the latest portage snapshot and md5sum (portage-20060722.tar.bz2, portage-20060722.tar.bz2.md5sum)
    • Verify the integrity of the snapshot: md5sum -c portage-20060722.tar.bz2.md5sum
    • Extract the snapshot (case is important here): tar xvjf /mnt/gentoo/portage-.tar.bz2 -C /mnt/gentoo/usr
  • Configure compile options
    • Edit /mnt/gentoo/etc/make.conf
    • CFLAGS="-O2 -mtune=i686 -pipe"
    • CXXFLAGS="${CFLAGS}"
    • MAKEOPTS="-j2"
  • Select mirrors
    • mirrorselect -i -o >> /mnt/gentoo/etc/make.conf
    • select one or more mirrors by pressing [space] and press [enter]
  • Set the SYNC setting
    • mirrorselect -i -r -o >> /mnt/gentoo/etc/make.conf
    • select a mirror by pressing [space] and press [enter]
  • Copy the DNS info into the new environment: cp -L /etc/resolv.conf /mnt/gentoo/etc/resolv.conf
  • Mount the /proc fileystem to allow the install to use the kernel-provided information within the chrooted environment: mount -t proc none /mnt/gentoo/proc
  • Mount-bind the /dev filesystem: mount -o bind /dev /mnt/gentoo/dev
  • Chroot into the new environment
    • Change the root from / on the cd to /mnt/gentoo: chroot /mnt/gentoo /bin/bash
    • Create a new environment (create new environment variables): env-update
    • Load the environment variables into memory: source /etc/profile
    • export PS1="(chroot) $PS1"
  • Update the portage tree to the latest version
    • emerge --sync
    • If a new version is available, update portage: emerge portage
    • If config files need to be updated: find /etc -iname '._cfg*'
    • For help on updating config files: emerge --help --config
    • Merge the file differences if necessary, or just move the new files over the old ones
  • Verify the system profile
    • ls -FGg /etc/make.profile
    • Profile points to ../usr/portage/profiles/default-linux/x86/no-nptl, which isn't the preferred default
    • Check if the preferred default exists: ls -d /usr/portage/profiles/default-linux/x86/2006.0
    • Link to the preferred profile: ln -snf /usr/portage/profiles/default-linux/x86/2006.0 /etc/make.profile
    • Verify the profile was updated: ls -FGg /etc/make.profile
  • Set USE Flags
    • emerge ufed
    • back up /etc/make.conf: cp /etc/make.conf /etc/make.conf.good
    • run ufed & make selections: ufed
    • Ufed edits /etc/make.conf. My resulting flags are as follows: "audiofile bittorrent c++ cdr dvd dvdr dvdread emacs ethereal ftp gimp lirc mozilla mule mysql pdf php"
  • Activate the userlocales flag
    • mkdir -p /etc/portage
    • echo "sys-libs/glibc userlocales" >> /etc/portage/package.use
  • Specify the locales that should be supported
    • edit /etc/locales.build
    • comment out everything except for en_US/ISO-8859-1 and en_us.UTF-8/UTF-8
  • Specify the timezone
    • less /usr/share/zoneinfo
    • less /usr/share/zoneinfo/US
    • choose /usr/share/zoneinfo/US/Eastern: cp /usr/share/zoneinfo/US/Eastern /etc/localtime

No comments: