HOWTO Install Gentoo with Reiser4 enabled using Lxnay's Gentoo RR4 LiveCD
From Gentoo Linux Wiki
| Installation • Kernel & Hardware • Networks • Portage • Software • System • X Server • Gaming • Non-x86 • Emulators • Misc |
[edit] Introduction
This document is different than other installation guides for several reasons:
- There are a lot of great guides out there. I have read most and I wanted to pull my favorite parts into one concise guide.
- This Guide recommends the use of lxnay's Gentoo RR4 CD
- You will be able to install Gentoo Linux to your hard drive with graphical tools like Gparted and Aegis Virus Scanner
- You will also be able to view this document with Mozilla Firefox during your installation
- All of the necessary directions and commands you need to type will be highlighted in green
- All of the optional commands available to you will be highlighted in yellow
- Edited Files will be highlighted in pink
- You need not read this entire document if you just want to follow the color coded commands below.
[edit] Please Note
Current LiveCD's which support Reiser4
- SystemRescueCD - Gentoo-based LiveCD
Until I have time to write a full how-to please visit the following links:
Get the Live CD that this Howto will be based on here: (WARNING: The reiser4progs version on lxnay's CD is very old, they are unmaintained, backwards compatibility is broken and newer kernels will not work. A few alternative reiser4 media would be lxnay's rr4 DVD, or the conrad CD. I've heard of RIP cd.
- Reiser4 Enabled LiveCD - Use Lxnay's Gentoo RR4 LiveCD, alternatively the minimal Conrad LiveCD will do just fine too.
Reiser4 resources:
- Howto Create a Reiser4 Partition
- Installing Packages with Reiser4 - Solve problems emerging packages on a Reiser4 partitioned filesystem.
- Reiser4 Technical Information
- HOWTO Update Reiser4 Partitions
Installation resources:
Special thanks to the authors of the documents above. You keep my 1.53 GHz Athlon still feeling zippy to me.
[edit] Preparing our installation environment
Boot to lxnays Gentoo RR4 Live CD. At the grub menu choose the Gnome option to keep you chatting on Gaim and Xchat while bootstrapping.I had to add irc.freenode.net/6667 to the server list of xchat and joined channel gentoo for help. root password is tecnico. I logged in as root at the login screen, if you leave it the cd will autologin as tecnico...
| Code: passwd tecnico |
Changing password for tecnico (current) UNIX password: New UNIX password: Retype new UNIX password: passwd: password updated successfully |
(Repeat as root user)
hdparm -d1c1u1m16 /dev/hda hdparm -d1c1u1 /dev/cdroms/cdrom0
[edit] Partition and Formatting Your Hard Drives
Gparted is available on the LiveCD. I recommend cfdisk for command line installations.
Gparted HOWTO
- /dev/hda1 will be our /boot partition at 100 MB
- /dev/hda2 will be our swap partition at 1024 MB
- /dev/hda3 will be our / (root) partition at 10240 MB or 10 Gigs
- /dev/hda4 will be our /home partition using the rest of the available space
[edit] Formatting our filesystems
The /boot and /home partitions do not need the speed of reiser4, stability is the goal here. Not that Reiser4 isn't stable I just want to give it some more time until Linus says it's stable.
mkfs.ext3 /dev/hda1 mkfs.ext3 /dev/hda4 mkfs.reiser4 /dev/hda3 mkswap /dev/hda2
And lets go ahead and turn swap on, while we're at it.
swapon /dev/hda2
[edit] Mounting our new partitions
mkdir /mnt/gentoo/{boot,home}
mount /dev/hda3 /mnt/gentoo
mount /dev/hda1 /mnt/gentoo/boot
mount /dev/hda4 /mnt/gentoo/home
[edit] Downloading and extracting Stage1 and Portage Snapshot Tarball
A list of portage mirrors can be found here. Choose a mirror near you. The $MIRROR variable in the code below is the root of the mirror that you have chosen. The second step is important, but left off most installation Howto's. To avoid killing rsync servers or getting stuck on a slow one we are going to download a recent snapshot of the portage tree first. We will sync it later. Change the $DATE variable to the date 48 hours ago in the YYYYMMDD format.
export MIRROR="http://mirror.xxx.net/gentoo/" export DATE="20041218"
cd /mnt/gentoo/ wget $MIRROR/releases/x86/2005.0/stages/x86/stage1-x86-2005.0.tar.bz2 wget $MIRROR/snapshots/portage-$DATE.tar.bz2
Or download them typing the full URL
tar xjpvf stage1*.bz2 cd /mnt/gentoo/usr tar xjvf /mnt/gentoo/portage-*.tar.bz2
You might want to keep the tarballs you just downloaded for a few days. If something goes wrong with the installation you won't have to download them again.
[edit] Editing make.conf and Build Options
Open your /etc/make.conf. The gedit editor is available to use regardless of the desktop environment you selected when you logged in.
gedit /mnt/gentoo/etc/make.conf
[edit] Editing USE Variables
The USE variable allows you to customize applications with certain features and support from other applications. For more information on USE flags go here. For and indepth discussion on USE flags go to the Gentoo Handbook.
[edit] Editing CFLAGS
The CFLAGS variable will set your cpu optimizations. A list of cpu types and safe optimization flags for your processor is here. If you are unsure, you can find out your processor info with cat /proc/cpuinfo
| File: /etc/make.conf |
|
...
CFLAGS="-march=i686 -O2 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CXXFLAGS="${CFLAGS}"
... |
[edit] Now choose rsync mirrors close to you.
I live in the US, other locales are available see the /mnt/gentoo/etc/make.conf.example file to view them.
| File: /etc/make.conf |
|
... SYNC="rsync://rsync.gentoo.org/gentoo-portage" |
[edit] Choosing download mirrors
Note if you are on a dialup connection I suggest editing the make.conf file manually to select mirrors that are geographically close to yourself, instead of running the following comand
mirrorselect -a -s3 -o | grep 'GENTOO_MIRRORS=' >> /mnt/gentoo/etc/make.conf
[edit] Sample make.conf
Your make.conf should look like something below. YMMV, but this is a nice way to start for a basic system with the Gnome desktop environment.
| File: /mnt/gentoo/etc/make.conf |
CFLAGS="-march=i686 -O2 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CXXFLAGS="${CFLAGS}"
MAKEOPTS="-j2"
USE="acpi fbcon nptl nptlonly -arts -kde -qt"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
#run portage at highest runlevel for the install
#PORTAGE_NICENESS="19"
ALSA_CARDS="cs46xx"
GENTOO_MIRRORS="http://mirror.datapipe.net/gentoo \
http://mirrorservice.org/sites/www.ibiblio.org/gentoo \
ftp://gentoo.ccccom.com \
ftp://ftp.gtlib.cc.gatech.edu/pub/gentoo"
|
[edit] More info on some settings
[edit] Setting Locales
Specify support for the languages we use. The locales avaiable are listed in /mnt/gentoo/usr/share/locale/. Locales.
| File: /mnt/gentoo/etc/locales.build |
en_US/ISO-8859-1 en_US.UTF-8/UTF-8 |
Now we have to tell portage to build glibc with only the locales we selected.
echo "sys-libs/glibc userlocales" >> /mnt/gentoo/etc/portage/package.use
[edit] Entering the installation environment.
[edit] Mount the virtual filesystems
mount -t proc none /mnt/gentoo/proc mount -o bind /dev /mnt/gentoo/dev
[edit] Copy DNS information and Chroot
cp /etc/resolv.conf /mnt/gentoo/etc/resolv.conf chroot /mnt/gentoo /bin/bash env-update && source /etc/profile
[edit] Beginning Installation
[edit] Pre-install Check
Double check the date make sure it is accurate
| Code: date |
Sat Dec 18 18:34:27 GMT 2004 |
The message "Sat May 14 16:21:36 Local time zone must be set--see zic manual page 2005" can be ignored, local time zone settings will be taken care of below.
If you have to change the date, the syntax is: date MMDDhhmmYYYY
date 061213052005
emerge --sync
ignore the portage update message.
[edit] Installing
/usr/portage/scripts/bootstrap.sh emerge -e system
If you fear a internet-connection crash, use the -f argument as well for fetching the files first and afterwards installing them. Now go and do something else for a few hours. Get a friend and play monopoly or risk. Or watch half of the first season of 24. This really will be a while.
Emerge your window manager or desktop of choice:
emerge gnome
And a logger + cron
emerge metalog vixie-cron rc-update add vixie-cron default rc-update add metalog default
And other tools we'll be needing
emerge slocate reiser4progs dhcpcd net-tools rc-update add domainname default
Configure Daemons
Edit logger config - TIP System Logging with syslog-ng
[edit] The Kernel
[edit] Patch yourself
Grab kernel sources for 2.6 and reiser4 patch, (grab the right reiser4 patch for your kernel version )
wget http://www.kernel.org/pub/linux/kernel/v2.6/testing/linux-2.6.12-rc2.tar.bz2 wget http://kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.12-rc2/2.6.12-rc2-mm2/2.6.12-rc2-mm2.bz2
I was unable to get the all inclusive patches to work as I was also using LVM on root, so I downloaded the broken-out patches and only installed the reiser4 patches.
cd /usr/src tar jxf linux-2.6.12-rc2.tar.bz2 cp -rl linux-2.6.12-rc2 linux-2.6.12-rc2-mm2 cd linux-2.6.12-rc2-mm2 bzip2 -dc ../2.6.12-rc2-mm2.bz2 | patch -p1 ln -s linux-2.6.12-rc2-mm2 linux
| Code: make menuconfig |
disable kernel hacking-> 4kb stack option enable filesystems -> reiser4 (make oldconfig if you have an old .config file to start from) |
[edit] Prepatched (Nitro)
You don't have to patch a kernel, the reiser4 support is already inside the following one! Here's the deal: The package is called sys-kernel/nitro-sources. It should be noted that nitro sources can be a bit unstable at times, so if using an experimental filesystem is enough, then this might not be for you.
First have to get the ebuild, so let's do this
echo "PORTDIR_OVERLAY=/usr/local/portage" >> /etc/make.conf
Check out http://forums.gentoo.org/viewtopic-t-360178.html to get the latest sources. The newest at the moment is [1]
mkdir -p /usr/local/portage/sys-kernel/nitro-sources/ cd /usr/local/portage/sys-kernel/nitro-sources/ wget http://nitro.b3cks.com/2.6.12-nitro5/nitro-sources-2.6.12-r5.ebuild ebuild nitro-sources-2.6.12-r5.ebuild digest echo "sys-kernel/nitro-sources ~x86" >> /etc/portage/package.keywords emerge nitro-sources ln -s /usr/src/linux-2.6.12-nitro5 /usr/src/linux
There we go now
Now:
cd /usr/src/linux-2.6.12-nitro5 make menuconfig make && make modules_install
[edit] System Time
[edit] Localtime
We're gonna set our local time. This is done by /etc/init.d/clock and /etc/conf.d/clock. Default is UTC, I use local- because of dual-boot, it needs to agree with M$.
If /etc/localtime exists, remove it, then
cd /etc ln -s ../usr/share/zoneinfo/(Your_Desired_Timezone) localtime
[edit] NTP
Edit NTP configs - HOWTO NTP and pool.ntp.org
- /etc/conf.d/ntp-client
- /etc/conf.d/ntpd
- /etc/ntp.conf
rc-update add ntp-client default && rc-update add ntpd default && ntpdate -b -u pool.ntp.org ntpd
[edit] Finishing up
[edit] Normal User
First, create a user
useradd your_user -m -G users,wheel,audio -s /bin/bash passwd your_user
[edit] Networking
Set the system hostname
echo mymachine > /etc/hostname
Set the system domainname
echo mydomain.com > /etc/dnsdomainname
Set the hostsfile, ex:"127.0.0.1 localhost mymachine"
| File: /etc/hosts |
127.0.0.1 localhost mymachine |
Setup networking; dhcp-users should set iface_eth0="dhcp"
nano -w /etc/conf.d/net
Modules to be loaded at startup
nano -w /etc/modules.autoload.d/kernel-2.6
If you have multiple network interfaces, create the extra symlinks.
ln -s /etc/init.d/net.eth0 /etc/init.d/net.ethX
- Automatically start at boot if no PCMCIA)
rc-update add net.eth0 default
PCMCIA only: verify /etc/conf.d/pcmcia and load PCMCIA at boot)
rc-update add pcmcia default
[edit] Grub
cp /proc/mounts /etc/mtab emerge grub grub
| Code: grub |
grub> root (hd0,0) grub> setup (hd0) grub> quit |
Now edit /boot/grub/grub.conf
| File: /boot/grub/grub.conf |
default 0 timeout 15 splashimage=(hd0,0)/grub/splash.xpm.gz title=Gentoo Linux root (hd0,0) # genkernel users: kernel /kernel-<kernel version> root=/dev/ram0 init=/linuxrc real_root=/dev/hda3 ramdisk=8192 initrd /initrd-<kernel version> # non-genkernel users: kernel /kernel-<kernel version> root=/dev/hda3 |
Configure basic system settings: TODO Edit /etc/rc.conf.
