In this meeting we will be continuing the install of gentoo on the machine. We will learn more about configuration for the kernel and finalizing the system.
I believe we were up to the chroot command in the installation, so that is where I am going to pickup this lesson.
One issue I did not explain last session was the idea of keeping a log file while you work. So lets start off by discussing online documentation and how to create a log.
But before we start discussing documentation and log files, we need to talk about both virtual terminals and the gpm service.
How many of you remember the old days of Dos command line? Well Linux also supports a similiar look, but because Linux is a multi-user and multi-tasking system, it can support multiple terminals. Any one of these looks similiar to the old Dos windows. Linux though supports multiple terminals on the main display. By default there are 6 pre-defined. You can increase the number as high as you want.
The default method of switching between the 6 predefined virtual terminals is ALT-FN, where N is a number from 1 to 6.
For this install we are going to use the following pattern:
ALT-F1 will be the chroot terminal
ALT-F5 will be links http://www.gentoo.org for the manual.
ALT-F6 will be nano for a log file.
Another useful function that Linux supplies is the ability to copy and paste from one virtual terminal to another.
The service called gpm is most useful when you want to copy information from one virtual terminal to another, or into your log file.
Unfortunately, the command line web browser links, does not support the copy paste operation. I wish it did since it would make the setup easier.
The easy way to use the command is to highlight some text using the left mouse button. Move to where you want the highlighted text to appear, and click the mouse wheel.
One of the reasons for enabling the network at the very beginning is to allow us to read the install manual while we are working on the system. Since gentoo includes a command line web browser named links we can use this to read the documentation while performing the installation. Normally if you wanted to read documentation while performing an install, you would need another computer.
So we are going to change to virtual terminal 5 and enter the command
links http://www.gentoo.org. This will take us to the gentoo site where we can open Gentoo Linux x86 Handbook.
One interesting trick I have learned is to keep a log of what decisions I make during an installation. I don’t know about you, but often during an installation of an OS, I need to make decsions. Some of these don’t matter later, but some are important and can cause you grief later.
So let us stop and think about how the virtual terminals are mounted. We booted from a bootable CD, so the root file system is on the Ram disk used by the CD. We then mounted the new gentoo partition on /mnt/gentoo. After that we did a chroot to change the root on virtual terminal one to the new partition. This means that we will execute the commands in virtual terminal one. But it also means that the other terminals can see the files in the new partition by going to /mnt/gentoo/ and treating that as root.
For example, after the change root command,
chroot /mnt/gentoo /bin/bash, the directory /root holds the startup files for the root user. Now if we switch to virtual terminal 2 we can see the same files but they are at /mnt/gentoo/root instead of /root.
One of the first tasks in the new gentoo system is compiling a kernel. We are going todo it the easy way first and then the manual way second.
The gentoo system is fond of scripts, so it is no surprise that they have a script to automate the proess of compiling a new kernel.
For more information see Gentoo Linux Genkernel Guide.
For this install we will use the command
genkernel --splash --install --menuconfig --save-config all.
The other method of compiling the kernel is to issue the command yourself. Now lets be clear that manual is only slightly more complex than using genkernel. Here are the steps you need to perform. I will assume you already did an emerge gentoo-sources.
make && make modules_install
cp arch/i386/boot/bzImage /boot/kernel-2.6.31-gentoo-r6
Change the kernel version above to match your kernel.
OK that is about all I am going to write up this time. I recommend you spend some time going over the Gentoo documentation available at Gentoo Documentation Resources.
In the next advanced meeting we will dig down into the Gentoo system to see how it is constructed. What tools does it provide, where are the files located, and how the configuration files interact. This will be valuable when we start building the Linux System from Scratch.
Written by John F. Moore
Last Revised: Mon Jan 16 15:37:36 EST 2017