Share This:

If you like my work show support on my Patreon
In my past two post I have been writing about installing Gentoo Linux on your PC. Below is an overview of what we have done so far.

If you have not done the above, please read my previous post before reading this post. Otherwise feel free to continue reading.

Setup Networking

In the first post I mentioned that you wont be able to install Gentoo using WiFi. So we will need to connect our PC to our router via Eithernet. The Eithernet port looks like a phone jack but slightly bigger. If your computer has two ports that look like they would be for connecting a landline them, and one is slightly bigger then the bigger one is usually the Eithernet port. . Next we plug the other end of the Eithernet cable into our router. Once your computer is connected to the router you will boot into the installation media. To know how to do this refer to my last post. And after we have booted into our installation media we will now check our network connection by typing the following.

ifconfig

If everything goes well you should get an output that looks similair to the following.

eth0 Link encap:Ethernet HWaddr 00:50:BA:8F:61:7A
inet addr:192.168.0.2 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::50:ba8f:617a/10 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1498792 errors:0 dropped:0 overruns:0 frame:0
TX packets:1284980 errors:0 dropped:0 overruns:0 carrier:0
collisions:1984 txqueuelen:100
RX bytes:485691215 (463.1 Mb) TX bytes:123951388 (118.2 Mb)
Interrupt:11 Base address:0xe800

We can use ping to confirm that we have successfully connected to the network.

ping -c 3 www.gentoo.org

If we aren’t connected we will need to connect manually. To connect manually we will use the net-setup utility. For example.

net-setup eth0

For more information you can always refer to the Gentoo Handbook.

Setting The Date & Time

Having the correct date and time setup on your Linux system is vital. Without the correct date and time we will be in a whole world of pain. We can check to see if our date and time are correct by using the date command.

date

The above should output the date like so.

Wed Aug 2 02:23:41 EDT 2017

If the date and time is wrong and in my case it usually is, then we need to change it to make it correct. But before we do this lets refer to the date help file.

date --help

The above will output the following.

Usage: date [OPTION]... [+FORMAT]
or: date [-u|--utc|--universal] [MMDDhhmm[[CC]YY][.ss]]
Display the current time in the given FORMAT, or set the system date.

Mandatory arguments to long options are mandatory for short options too.
-d, --date=STRING display time described by STRING, not 'now'
-f, --file=DATEFILE like --date; once for each line of DATEFILE
-I[FMT], --iso-8601[=FMT] output date/time in ISO 8601 format.
FMT='date' for date only (the default),
'hours', 'minutes', 'seconds', or 'ns'
for date and time to the indicated precision.
Example: 2006-08-14T02:34:56-0600
-R, --rfc-2822 output date and time in RFC 2822 format.
Example: Mon, 14 Aug 2006 02:34:56 -0600
--rfc-3339=FMT output date/time in RFC 3339 format.
FMT='date', 'seconds', or 'ns'
for date and time to the indicated precision.
Example: 2006-08-14 02:34:56-06:00
-r, --reference=FILE display the last modification time of FILE
-s, --set=STRING set time described by STRING
-u, --utc, --universal print or set Coordinated Universal Time (UTC)
--help display this help and exit
--version output version information and exit

FORMAT controls the output. Interpreted sequences are:

%% a literal %
%a locale's abbreviated weekday name (e.g., Sun)
%A locale's full weekday name (e.g., Sunday)
%b locale's abbreviated month name (e.g., Jan)
%B locale's full month name (e.g., January)
%c locale's date and time (e.g., Thu Mar 3 23:05:25 2005)
%C century; like %Y, except omit last two digits (e.g., 20)
%d day of month (e.g., 01)
%D date; same as %m/%d/%y
%e day of month, space padded; same as %_d
%F full date; same as %Y-%m-%d
%g last two digits of year of ISO week number (see %G)
%G year of ISO week number (see %V); normally useful only with %V
%h same as %b
%H hour (00..23)
%I hour (01..12)
%j day of year (001..366)
%k hour, space padded ( 0..23); same as %_H
%l hour, space padded ( 1..12); same as %_I
%m month (01..12)
%M minute (00..59)
%n a newline
%N nanoseconds (000000000..999999999)
%p locale's equivalent of either AM or PM; blank if not known
%P like %p, but lower case
%r locale's 12-hour clock time (e.g., 11:11:04 PM)
%R 24-hour hour and minute; same as %H:%M
%s seconds since 1970-01-01 00:00:00 UTC
%S second (00..60)
%t a tab
%T time; same as %H:%M:%S
%u day of week (1..7); 1 is Monday
%U week number of year, with Sunday as first day of week (00..53)
%V ISO week number, with Monday as first day of week (01..53)
%w day of week (0..6); 0 is Sunday
%W week number of year, with Monday as first day of week (00..53)
%x locale's date representation (e.g., 12/31/99)
%X locale's time representation (e.g., 23:13:48)
%y last two digits of year (00..99)
%Y year
%z +hhmm numeric time zone (e.g., -0400)
%:z +hh:mm numeric time zone (e.g., -04:00)
%::z +hh:mm:ss numeric time zone (e.g., -04:00:00)
%:::z numeric time zone with : to necessary precision (e.g., -04, +05:30)
%Z alphabetic time zone abbreviation (e.g., EDT)

By default, date pads numeric fields with zeroes.
The following optional flags may follow '%':


- (hyphen) do not pad the field
_ (underscore) pad with spaces
0 (zero) pad with zeros
^ use upper case if possible
# use opposite case if possible

After any flags comes an optional field width, as a decimal number;
then an optional modifier, which is either
E to use the locale's alternate representations if available, or
O to use the locale's alternate numeric symbols if available.

Examples:
Convert seconds since the epoch (1970-01-01 UTC) to a date
$ date --date='@2147483647'

Show the time on the west coast of the US (use tzselect(1) to find TZ)
$ TZ='America/Los_Angeles' date

Show the local time for 9AM next Friday on the west coast of the US
$ date --date='TZ="America/Los_Angeles" 09:00 next Fri'


GNU coreutils online help: <http://www.gnu.org/software/coreutils/>
Full documentation at: <http://www.gnu.org/software/coreutils/date>
or available locally via: info '(coreutils) date invocation'

The above output of the date --help is very helpful to us. It tells us if we use -s we can set the date and time. So if our date is correct we can set just the time. In the help file it tells us that %H represents hours in a 24 hour format from 00 to 23. So if we only need to set the hour we can use the %H to set it correctly. Like so.

date -s +%H '01'

The above will set the hour to 01 or 1AM and it will keep the date and minutes the same. So if we type date again we will get the following.

Wed Aug 2 01:26:22 EDT 2017

Once our date and time is setup properly we can move on with our installation.

Installing Stage 3 Tarball

The Stage 3 Tarball is a tarball file that contains the entire source code for a bare bones Gentoo system. We will need to get this file onto our system from a mirror that has it. There is a large list of mirrors to get the Stage 3 tarball. But it is usually best to get the one from a server closest to you. In my case that is the Rochester Institute of Technology. So I will be using that. A list of all the mirrors can be found from the Gentoo Mirror list.

But before we get the Stage 3 tarball file we will first want to mount our Root FS Disk Partition like so.

mount /dev/sdb4 /mnt/gentoo

Then we will move into the directory.

cd /mnt/gentoo

Now there are many ways to download the file. But I prefer wget simply because of how simple it is.

wget <locatation of the stage 3 file on the server>

Because of the size of the file we will want to verify that the file download entirely and didn’t get corrupted during the download. We can do this by getting the SHA512 of the file and seeing if it matches.

sha512sum stage3.tar.bz

If it matches then we are ready to extract the contents of the file.

tar xvjpf stage3-*.tar.bz2 --xattrs --numeric-owner

Once it is done extracting you should notice that you now have many of the same directories an average Linux system has. Feel free to navigate around in them but be very careful you don’t mess anything up. Part of Gentoo is about being able to change these files but at the same time you can cause damages if you don’t know what your doing.

In my next post we will start to compile the system.

If you like my work show support on my Patreon