Old Fashioned Gentoo Install

This document describes how to install Gentoo without the hand holding automation features that users have come to take for granted over the last 10 years.

Synopsis
Its possible to start with the offical stage3 files. This has only been tested on an amd64/no-multilib install.

As this document is aimed at users with at least one Gentoo install to their credit, it is not a keystroke by keystroke guide, unlike the Handbook. The handbook steps are not repeated here, there is just some general references to it from time to time.

Overview
The steps are:-
 * partition the target drive following the handbook
 * install the stage3 tarball
 * install the portage snapshot
 * set up package.mask to keep out unwanted junk
 * set up global USE flags to be consistant with package.mask
 * replace udev with sys-fs/static-dev
 * follow the handbook to install cron, a logger and a bootloader of your choice
 * Install a kernel
 * configure grub
 * review and edit configuaition settings
 * reboot to test

Introduction
This document describes how to install Gentoo with a static /dev using the packages from a stage3 tarball.

What You Get

A modern gentoo base system but without all the bells and whistles added in recent years. Olde Fashioned Gentooee is more about what you don't get. You dont get


 * udev - you get a static dev
 * systemd - why would you want it anyway
 * pulseaudio - I've not known this to actually add anything
 * hotplug support
 * auto mounting of any sort - use mount by label
 * auto module loading
 * device detection in Xorg

Separate /usr should just work as there is no udev to require that /usr is mounted before udev starts. If udev starts on your box you have done someting wrong. Separate /usr is not tested as I'm using lvm on top of raid5, so while my /usr is separate, bad habits have made me mount it in the initrd.

Access to the Gentoo Handbook is required as this guide makes frequent references to it, there is no point in repeating the handbook here.

Partitioning and Making Filesystems
Making Your Filesystem Tree

Follow the Gentoo Handbook up to and including making your filesystems and mounting all the bits at /mnt/gentoo.

I will be using Logical Volumes on top of raid5 because its easier to recyle the volumes than it is with real partitions and if the logical volumes are the wrong size, they can be resized. I happen to have lvm on raid5 space free. This means that I will also describe the initramfs to get the raid assembled and Logical Volumes active. Users installing to real partitions should not need the initramfs.

Making the chroot
Mount /proc and but not /dev inside the chroot. We will be using a static /dev, so we have to emerge dev-static. With /dev bind mounted in the normal way, our static dev would go into the parents devtmpfs which is in RAM. If you are very very lucky, the static /dev provided by the stage3 may be enough to get you started.

The stage3 tarball is provided with a static /dev that includes sda ... sdd inclusive. If you need more that that, use mknod to make the extra /dev entries. Likewise, there ale no md entries for raid or dm enteries for LVM.

Setting up package.mask
This is important. Enter the package atoms that you do not want to be installed ever.

Add in anything else you can think of they you really don't want. Always use -av with emerge and add more things as they come to mind. mdev might need to be there too.

Setting up package.use
This section is only required if you use raid, or lvm. You will need some packages built with the static USE flag.

Removing udev and Friends There is a bug in the static-dev ebuild (Bug 469620) that prevents it installing if /proc/mounts reports that a dynamic /dev manager is in use. Either patch static-dev in the overlay or unmount /proc from /mnt/gentoo/proc while static-dev is emerged.

emerge sys-fs/static-dev will report some file colisions. That is expected as some elements of a static /dev are provided by the stage3.

The last command should offer to remove


 * sys-apps/hwids
 * sys-fs/udev-init-scripts
 * sys-libs/libcap
 * dev-util/gperf
 * virtual/udev

Let it run, they all depend on udev, which is no longer installed.

Setting USE= in make.conf
Some of my USE flags are AMD specific. The flags that are set off here are for avoidance of optional support for packages we have already masked. Optional support being on would attempt to pull those packages in and emerge would complain about masked packages.

-zeroconfig is a special case. Zeroconfig wasn't around 10 years ago so really should be excluded here.

Adding to /dev
static-dev is a good start but its not moved on in a very long time. Add some of the newer entries required. See /usr/src/linux/Documentation/devices.txt for a list


 * mknod all of the /dev/sd* entries you need
 * mknod any /dev/md* kernel multipe device entries required
 * mknod any /dev/dm-X device mapper entries required
 * mknod any /dev/srX devices for your optical drive(s)
 * mknod any other /dev nodes you might want. They can be added at any time

Don't forget nodes for removable storage devices.

DRI users, that's almost everone except those who use nvidia-drivers for Xorg will need to make /dev/dri/*. What is needed here is driver dependent.

Populating /etc/conf.d/modules
Only you know what you need here. When you reboot, its a good idea to have keyboard support and udev isn't going to load it for you any more.

Setting Up Your Own Static Overlay
A number of packages that are required for a modern Gentoo system require udev. In some the dependency can be avoided by careful use of USE flags. Others like lvm2 and Xorg have udev included in IUSE. Make a local overlay called static_dev, copy these ebuilds there and remove all references to udev.

Making the Kernel
Follow the instructions at http://www.kernel-seeds.org which is mirrored at http://kernel-seeds.grytpype-thynne.org with the following changes

We can leave off the hair shirts. Unix98PTY support does work but the permissions on /dev/ptmx need to be set correctly and /dev/ptmx needs to be mounted crw-rw 1 root tty 5, 2 Mar 18 21:47 /dev/ptmx

Genkernel users are on their own here.

Provided your kernel can boot unaided, no initrd is required

Preparing for usr/gen_init_cpio
To make everything robust and independent of what filesystem gets attached to which/ dev node, we will use the filesystem UUIDs everywhere.

There are several ways to make an initramfs, we will use the kernel provided usr/gen_init_cpio script.

The script needs two things, a list of files to include in the initramfs and an init sctipt to execute. The use of usr/gen_init_cpio is well documented in the kernel.

Make a directory to hold the two files. I like /root/initrd. The two files that follow go there.

I'm sure there is a sh one liner to feed to busybox mknod as a part of the init script, so I don't need the huge list of nod statements but I don't know it.

If you use files systems other than extX on /usr and / or /var, which the initrd checks and mounts, you need your filesystem tools listed here. Feel free to add other things you find useful when booting fails too.

Now to feed the /root/initrd/initramfs_list file to usr/gen_init_cpio. Make sure /boot is mounted

This what the kernel build system does if you choose to build the initramfs into the kernel binary but if you don't get it right first time, you can fix your kernel without rebuilding your initramfs and vice versa.

Populating /etc/fstab
Run blkid to discover the UUIDs of all your block devices. Paste the output into /etc/fstab, so its easy to refer to in the future. Delete lines that provide the UUIDS of block devices that are not filesystesms, e.g. lvm members, md devices. Comment out the other entries, so they can stay in the file.

Populating /etc/fstab as normal, but use UUIDs as in

As there is no auto mounting, don't forget entries for optical drives.

Floppy disk users need to remember /dev/fdX and friends. Users who have not formatted a floppy with a static /dev are in for a treat.

Configuring your System
Follow Gentoo Handbook Chapter 8.

Installing Necessary System Tools
Follow Gentoo Handbook Chapter 9.

Setting up the Boot Loader
The Grand Unifided Bootloader, grub, has already been installed to /boot

Follow Gentoo Handbook Chapter 10 . to install grub to the Master Boot Record and create a /boot/grub/grub.conf file

xorg.conf
You need a whole xorg.conf, just like in the good/bad old days. evdev depends on udev auto detecting devices, so thats out.

GNOME or KDE
Gnome is not an option. I suspect that KDE is out too.

Xfce 4
Xfce almost works out of the box. You need a patched mesa ebuild to build without udev.

The gentoo-static Overlay
hwids works but the ebuild needs to be patched to remove the dependency on udev

mesa

I need to get round to publishing the overlay.

Acknowledgements
We would like to thank the following authors and editors for their contributions to this guide:


 * neddyseagoon@gentoo.org