annotate posts/How_I_almost_sucessfully_installed_Gentoo_Linux.md @ 49:758b6e5e4e40 draft default tip

Added a comment: Oops
author Alex <Alex@web>
date Wed, 27 Jun 2018 08:45:10 +0000
parents 2307e281b4b7
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13
2307e281b4b7 tagify all the things
Samuel Hodgkins <samuel.hodgkins@sky.com>
parents: 3
diff changeset
1 [[!tag tech linux gentoo old]]
3
45362e07941c Add more old posts.
Samuel Hodgkins <samuel.hodgkins@sky.com>
parents:
diff changeset
2 I'm not a distro-hopper by any means, but even so I have tested/tasted a number of Linux distributions.
45362e07941c Add more old posts.
Samuel Hodgkins <samuel.hodgkins@sky.com>
parents:
diff changeset
3 Primarily, these have been in the Debian family: X/K/Ubuntu, Debian itself, Raspbian and likely more that I'm forgetting.
45362e07941c Add more old posts.
Samuel Hodgkins <samuel.hodgkins@sky.com>
parents:
diff changeset
4 I was recommended and used very happily for a good while Arch Linux (experiments with GNU Guix on it notwithstanding), until my hard drive began dying one day.
45362e07941c Add more old posts.
Samuel Hodgkins <samuel.hodgkins@sky.com>
parents:
diff changeset
5 I had heard that Tumbleweed was also rolling-release, and provided interesting rollback functionality out of the box using BTRFS and Snapper, so I installed it on a spare USB stick.
45362e07941c Add more old posts.
Samuel Hodgkins <samuel.hodgkins@sky.com>
parents:
diff changeset
6 Recently, I was thinking about Gentoo Linux. I was mainly thinking of the perhaps not-entirely-accurate idea that it would take substantial time to install due to the requisite amounts of compiling
45362e07941c Add more old posts.
Samuel Hodgkins <samuel.hodgkins@sky.com>
parents:
diff changeset
7 I also thought that the difficulty level of the installation was roughly equivalent to that of Arch,. I wanted to see if my thoughts/perceptions were right, so I planned to install and migrate to Gentoo.
45362e07941c Add more old posts.
Samuel Hodgkins <samuel.hodgkins@sky.com>
parents:
diff changeset
8 This led to a sequence of events that can be divided into approximately 3 parts.
45362e07941c Add more old posts.
Samuel Hodgkins <samuel.hodgkins@sky.com>
parents:
diff changeset
9
45362e07941c Add more old posts.
Samuel Hodgkins <samuel.hodgkins@sky.com>
parents:
diff changeset
10 # Part I: The actual installation of Gentoo
45362e07941c Add more old posts.
Samuel Hodgkins <samuel.hodgkins@sky.com>
parents:
diff changeset
11 Much like Arch Linux, Gentoo has a [comprehensive wiki]() filled with documentation about not only the installation procedures but also a large number of other things that are needed post-install.
45362e07941c Add more old posts.
Samuel Hodgkins <samuel.hodgkins@sky.com>
parents:
diff changeset
12 This is a very good thing, because documentation is very useful when installing either distribution (especially if you haven't done it before).
45362e07941c Add more old posts.
Samuel Hodgkins <samuel.hodgkins@sky.com>
parents:
diff changeset
13 As such, I mostly ended up following the [Gentoo Handbook]() which provides a well-written resource much like Arch's own installation guide (except it seemed more organized and structured into steps).
45362e07941c Add more old posts.
Samuel Hodgkins <samuel.hodgkins@sky.com>
parents:
diff changeset
14 Seeing as I was going to install Gentoo onto an existing filesystem (as a BTRFS subvolume) and was installing from an existing Linux rather than a CD, I could ignore 3 segments of the first part.
45362e07941c Add more old posts.
Samuel Hodgkins <samuel.hodgkins@sky.com>
parents:
diff changeset
15 The remaining installation steps looked like this:
45362e07941c Add more old posts.
Samuel Hodgkins <samuel.hodgkins@sky.com>
parents:
diff changeset
16
45362e07941c Add more old posts.
Samuel Hodgkins <samuel.hodgkins@sky.com>
parents:
diff changeset
17 1. Download (and extract) a precompiled base system (a stage3 tarball)
45362e07941c Add more old posts.
Samuel Hodgkins <samuel.hodgkins@sky.com>
parents:
diff changeset
18 This stage was very easy, only a couple of commands to execute with no decisions to make.
45362e07941c Add more old posts.
Samuel Hodgkins <samuel.hodgkins@sky.com>
parents:
diff changeset
19 2. Set appropriate compiliation settings
45362e07941c Add more old posts.
Samuel Hodgkins <samuel.hodgkins@sky.com>
parents:
diff changeset
20 At this point I needed to select what compiliation flags I would be using as well as decide how many parallel jobs `make` should be running.
45362e07941c Add more old posts.
Samuel Hodgkins <samuel.hodgkins@sky.com>
parents:
diff changeset
21 I decided to go with the default set of flags, only tweaking it to target GCC towards my specific CPU type (`-march=amdfam10`) and to also follow the recommendation for job count so that `make` could run up to 5 tasks in parallel.
45362e07941c Add more old posts.
Samuel Hodgkins <samuel.hodgkins@sky.com>
parents:
diff changeset
22 This was a very good decision - for one thing it made sure that compiling felt very fast and also ensured that all of my CPU's capacity could be used by the process if needed.
45362e07941c Add more old posts.
Samuel Hodgkins <samuel.hodgkins@sky.com>
parents:
diff changeset
23 3. Enter the installed base system and configure/update Portage (Gentoo's package manager)
45362e07941c Add more old posts.
Samuel Hodgkins <samuel.hodgkins@sky.com>
parents:
diff changeset
24 This step was also rather easy, a bit of copying files around and a few commands. I selected the generic 'desktop' profile, not seeing one more accurate.
45362e07941c Add more old posts.
Samuel Hodgkins <samuel.hodgkins@sky.com>
parents:
diff changeset
25 4. Rebuild the world
45362e07941c Add more old posts.
Samuel Hodgkins <samuel.hodgkins@sky.com>
parents:
diff changeset
26 Now that I had selected my profile, I needed to update my system to include the changed settings/flags that came with the new profile.
45362e07941c Add more old posts.
Samuel Hodgkins <samuel.hodgkins@sky.com>
parents:
diff changeset
27 Additionally, I needed to install the additional software selected to my profile.
45362e07941c Add more old posts.
Samuel Hodgkins <samuel.hodgkins@sky.com>
parents:
diff changeset
28 In short, what I (or Gentoo's portage) actually did could be succinctly explained with this image:
45362e07941c Add more old posts.
Samuel Hodgkins <samuel.hodgkins@sky.com>
parents:
diff changeset
29
45362e07941c Add more old posts.
Samuel Hodgkins <samuel.hodgkins@sky.com>
parents:
diff changeset
30 ![COMPILE ALL THE THINGS](https://cdn.meme.am/instances/500x/71652744.jpg)
45362e07941c Add more old posts.
Samuel Hodgkins <samuel.hodgkins@sky.com>
parents:
diff changeset
31
45362e07941c Add more old posts.
Samuel Hodgkins <samuel.hodgkins@sky.com>
parents:
diff changeset
32 I expected that this would be the longest part of the installation, and that was a correct expectation. Compiling 164 packages does take some time.
45362e07941c Add more old posts.
Samuel Hodgkins <samuel.hodgkins@sky.com>
parents:
diff changeset
33 However, it didn't take as much time as I imagined it to, things felt pretty fast actually. Building a generic linux kernel from scratch and installing it only took ~1h.
45362e07941c Add more old posts.
Samuel Hodgkins <samuel.hodgkins@sky.com>
parents:
diff changeset
34 I attribute this unexpected speediness to the benefits of passing `-j5` to make - Allowing 4 files to be compiled at once while using an entire CPU core speeded things up very nicely, while a 5th task meant there was almost always something to do when it was otherwise idle.
45362e07941c Add more old posts.
Samuel Hodgkins <samuel.hodgkins@sky.com>
parents:
diff changeset
35 5. Configuration of USE flags/locale/timezone
45362e07941c Add more old posts.
Samuel Hodgkins <samuel.hodgkins@sky.com>
parents:
diff changeset
36 At the present time, I decided to not really touch the USE flags immediately as they could be easily modified later as an when I needed to.
45362e07941c Add more old posts.
Samuel Hodgkins <samuel.hodgkins@sky.com>
parents:
diff changeset
37 I set the locale & timezone in accordance with my physical location (the UK).
45362e07941c Add more old posts.
Samuel Hodgkins <samuel.hodgkins@sky.com>
parents:
diff changeset
38 6. Compiling and installation of the kernel
45362e07941c Add more old posts.
Samuel Hodgkins <samuel.hodgkins@sky.com>
parents:
diff changeset
39 I decided that rather than start with a custom kernel configuration that may or may not boot, I would instead start with Genkernel, which would provide me a base from which to customise my own kernel.
45362e07941c Add more old posts.
Samuel Hodgkins <samuel.hodgkins@sky.com>
parents:
diff changeset
40 Considering that the result was a rather generic kernel, it was a bit surprising that it only took an hour or so to compile and install the kernel from scratch.
45362e07941c Add more old posts.
Samuel Hodgkins <samuel.hodgkins@sky.com>
parents:
diff changeset
41 7. General system configuration
45362e07941c Add more old posts.
Samuel Hodgkins <samuel.hodgkins@sky.com>
parents:
diff changeset
42 In this stage, I wrote /etc/fstab as well as configuring the network (simply automatically running DHCP on the only ethernet interface).
45362e07941c Add more old posts.
Samuel Hodgkins <samuel.hodgkins@sky.com>
parents:
diff changeset
43 I also assigned the system a hostname, and made sure that OpenRC used the correct keymap and started the network at boot-time.
45362e07941c Add more old posts.
Samuel Hodgkins <samuel.hodgkins@sky.com>
parents:
diff changeset
44 Before moving on to bootloader configuration, I selected what initial optional services I wanted installed and running at boot. These included a system logger, a cron daemon as well as `mlocate`.
45362e07941c Add more old posts.
Samuel Hodgkins <samuel.hodgkins@sky.com>
parents:
diff changeset
45
45362e07941c Add more old posts.
Samuel Hodgkins <samuel.hodgkins@sky.com>
parents:
diff changeset
46 The next stage was bootloader configuration, but I think discussion of that would fit better in Part II. This post is getting somewhat long, so that'll be in another post in a short while.