Gentoo Linux sparc Podręcznik: Instalowanie Gentoo
Wprowadzenie
Witaj
Przede wszystkim, witamy w Gentoo! Zamierzasz wkroczyć w świat wyboru i możliwości. Gentoo polega na wyborach. Podczas instalacji Gentoo, jest to wielokrotnie jasno przedstawione - użytkownicy mogą wybrać co ma zawierać ich kompilacja, jak zainstalować Gentoo, jakiego loggera systemowego użyć, etc.
Gentoo jest szybką, nowoczesną metadystrybucją z przejżystą oraz elastyczną konstrukcją. Opiera się na ekosystemie wolnego oprogramowania i nie ukrywa swojego wnętrza przed użytkownikami. Portage, system zarządzania pakietami, którego używa Gentoo, jest napisany w Pythonie. Co oznacza, że użytkownik może łatwo przejżeć i zmodyfikować jego kod źródłowy. System pakietów Gentoo wykorzystuje kod źródłowy (aczkolwiek istnieje również wsparcie dla prekompilowanych pakietów) i konfiguruje działanie Gentoo w normalnych plikach tekstowych. Innymisłowy, otwarty wszędzie.
Jest to bardzo ważne, by każdy użytkownik zrozumiał, iż możliwość wyboru jest głównym czynnikiem istnienia Gentoo. Staramy się nie zmuszać użytkowników do robienia czegokolwiek, co im się nie podoba. Jeśli ktoś uważa inaczej, prosimy o zgłoszenie raportu o błędzie.
Jak zbudowana jest instalacja
Instalacja Gentoo może być przedstawiona jako 10-etapowa procedura, odpowiadająca następnym zestawom działań. Wyniki każdego działaia w danym etapie:
Etap | Wynik |
---|---|
1 | Użytkownik znajduje się w środowisku roboczym, które jest gotowe do zainstalowania Gentoo. |
2 | Połączenie internetowe jest gotowe do zainstalowania Gentoo. |
3 | Dyski twarde są przygotowane do obsługi instalacji Gentoo. |
4 | Środowisko instalacyjne jest przygotowane, a użytkownik jest gotowy do wykonania chroot w nowym środowisku. |
5 | Instalowane są podstawowe pakiety, które są takie same we wszystkich instalacjach Gentoo. |
6 | Jądro Linuksa jest zainstalowane. |
7 | Większość plików konfiguracyjnych systemu Gentoo jest utworzona. |
8 | Zainstalowane są niezbędne narzędzia systemowe. |
9 | Odpowiedni system rozruchowy został zainstalowany i skonfigurowany. |
10 | Świeżo zainstalowane środowisko Gentoo Linux jest gotowe do eksploracji. |
Whenever a certain choice is presented the handbook will try to explain the pros and cons of each choice. Although the text then continues with a default choice (identified by "Default: " in the title), the other possibilities will be documented as well (marked by "Alternative: " in the title). Do not think that the default is what Gentoo recommends. It is, however, the choice that Gentoo believes most users will make.
Sometimes an optional step can be followed. Such steps are marked as "Optional: " and are therefore not needed to install Gentoo. However, some optional steps are dependent on a previously made decision. The instructions will inform the reader when this happens, both when the decision is made, and right before the optional step is described.
Opcje instalacyjne Gentoo
Gentoo można zainstalować na wiele różnych sposobów. Można go pobrać i zainstalować z oficjalnych nośników instalacyjnych Gentoo, takich jak nasze płyty CD i DVD. Nośnik instalacyjny można zainstalować na pamięci USB lub uzyskać do niego dostęp za pośrednictwem środowiska sieciowego. Alternatywnie, Gentoo można zainstalować z nieoficjalnych nośników, takich jak już zainstalowana dystrybucja lub dysk startowy inny niż Gentoo (np. Knoppix).
Ten dokument opisuje instalację przy użyciu oficjalnego nośnika instalacyjnego Gentoo, a w niektórych przypadkach instalację sieciową.
For help on the other installation approaches, including using non-Gentoo CDs, please read our Alternative installation guide.
We also provide a Gentoo installation tips and tricks document that might be useful.
Problemy
Jeśli został znaleziony problem w instalacji (lub dokumentacji instalacji), proszę odwiedzić system śledzenia błędów i sprawdzić czy błąd jest znany. Jeśli nie, proszę stworzyć raport błędu, dzięki temu możemy się nim zająć.
Although this document is architecture-specific, it may contain references to other architectures as well, because large parts of the Gentoo Handbook use text that is identical for all architectures (to avoid duplication of effort). Such references have been kept to a minimum, to avoid confusion.
If there is some uncertainty whether or not the problem is a user-problem (some error made despite having read the documentation carefully) or a software-problem (some error we made despite having tested the installation/documentation carefully) everybody is welcome to join the #gentoo channel on irc.freenode.net. Of course, everyone is welcome otherwise too as our chat channel covers the broad Gentoo spectrum.
Speaking of which, if there are any additional questions regarding Gentoo, check out the Frequently Asked Questions article. There are also FAQs on the Gentoo Forums.
Hardware requirements
Before we start, we first list what hardware requirements are needed to successfully install Gentoo on a sparc box.
Sparc System | Please check the Gentoo Linux/SPARC64 compatibility list or the UltraLinux FAQ |
---|---|
CPU | Currently support is limited to SPARC64 CPUs |
Memory | 64 MB |
Disk space | 1.5 GB (excluding swap space) |
Swap space | At least 256 MB |
Installation method
Below we cover how to install Gentoo Linux on a sparc system using the minimal installation CD. Gentoo also supports installation from a TFTP netboot image. For more information, please see the Sparc/Netboot article for setting up a netboot server, and find the TFTPBoot images on the Gentoo mirrors under experimental/sparc/tftpboot/sparc64/.
Gentoo Linux installation media
Minimal installation CD
The Gentoo minimal installation CD is a bootable image: a self-contained Gentoo environment. It allows the user to boot Linux from the CD or other installation media. During the boot process the hardware is detected and the appropriate drivers are loaded. The image is maintained by Gentoo developers and allows anyone to install Gentoo if an active Internet connection is available.
The Minimal Installation CD is called install-sparc-minimal-<release>.iso.
The occasional Gentoo LiveDVD
Occasionally, a special DVD image is crafted which can be used to install Gentoo. The instructions in this chapter target the Minimal Installation CD, so things might be a bit different when booting from the LiveDVD. However, the LiveDVD (or any other bootable Linux environment) supports getting a root prompt by just invoking sudo su - or sudo -i in a terminal.
What are stages then?
A stage3 tarball is an archive containing a profile specific minimal Gentoo environment. Stage3 tarballs are suitable to continue the Gentoo installation using the instructions in this handbook. Previously, the handbook described the installation using one of three stage tarballs. Gentoo does not offer stage1 and stage2 tarballs for download any more since these are mostly for internal use and for bootstrapping Gentoo on new architectures.
Stage3 tarballs can be downloaded from releases/sparc/autobuilds/ on any of the official Gentoo mirrors. Stage files update frequently and are not included in official installation images.
Downloading
Obtain the media
The default installation media that Gentoo Linux uses are the minimal installation CDs, which host a bootable, very small Gentoo Linux environment. This environment contains all the right tools to install Gentoo. The CD images themselves can be downloaded from the downloads page (recommended) or by manually browsing to the ISO location on one of the many available mirrors.
If downloading from a mirror, the minimal installation CDs can be found as follows:
- Go to the releases/ directory.
- Select the directory for the relevant target architecture (such as sparc/).
- Select the autobuilds/ directory.
- For amd64 and x86 architectures select either the current-install-amd64-minimal/ or current-install-x86-minimal/ directory (respectively). For all other architectures navigate to the current-iso/ directory.
Some target architectures such as arm, mips, and s390 will not have minimal install CDs. At this time the Gentoo Release Engineering project does not support building .iso files for these targets.
Inside this location, the installation media file is the file with the .iso suffix. For instance, take a look at the following listing:
[DIR] hardened/ 05-Dec-2014 01:42 - [ ] install-sparc-minimal-20141204.iso 04-Dec-2014 21:04 208M [ ] install-sparc-minimal-20141204.iso.CONTENTS 04-Dec-2014 21:04 3.0K [ ] install-sparc-minimal-20141204.iso.DIGESTS 04-Dec-2014 21:04 740 [TXT] install-sparc-minimal-20141204.iso.DIGESTS.asc 05-Dec-2014 01:42 1.6K [ ] stage3-sparc-20141204.tar.bz2 04-Dec-2014 21:04 198M [ ] stage3-sparc-20141204.tar.bz2.CONTENTS 04-Dec-2014 21:04 4.6M [ ] stage3-sparc-20141204.tar.bz2.DIGESTS 04-Dec-2014 21:04 720 [TXT] stage3-sparc-20141204.tar.bz2.DIGESTS.asc 05-Dec-2014 01:42 1.5K
In the above example, the install-sparc-minimal-20141204.iso file is the minimal installation CD itself. But as can be seen, other related files exist as well:
- A .CONTENTS file which is a text file listing all files available on the installation media. This file can be useful to verify if particular firmware or drivers are available on the installation media before downloading it.
- A .DIGESTS file which contains the hash of the ISO file itself, in various hashing formats/algorithms. This file can be used to verify if the downloaded ISO file is corrupt or not.
- A .DIGESTS.asc file which not only contains the hash of the ISO file (like the .DIGESTS file), but also a cryptographic signature of that file. This can be used to both verify if the downloaded ISO file is corrupt or not, as well as verify that the download is indeed provided by the Gentoo Release Engineering team and has not been tampered with.
Ignore the other files available at this location for now - those will come back when the installation has proceeded further. Download the .iso file and, if verification of the download is wanted, download the .DIGESTS.asc file for the .iso file as well. The .CONTENTS file does not need to be downloaded as the installation instructions will not refer to this file anymore, and the .DIGESTS file should contain the same information as the .DIGESTS.asc file, except that the latter also contains a signature on top of it.
Verifying the downloaded files
This is an optional step and not necessary to install Gentoo Linux. However, it is recommended as it ensures that the downloaded file is not corrupt and has indeed been provided by the Gentoo Infrastructure team.
Through the .DIGESTS and .DIGESTS.asc files, the validity of the ISO file can be confirmed using the right set of tools. This verification is usually done in two steps:
- First, the cryptographic signature is validated to make sure that the installation file is provided by the Gentoo Release Engineering team
- If the cryptographic signature validates, then the checksum is verified to make sure that the downloaded file itself is not corrupted
Microsoft Windows based verification
On a Microsoft Windows system, chances are low that the right set of tools to verify checksums and cryptographic signatures are in place.
To first verify the cryptographic signature, tools such as GPG4Win can be used. After installation, the public keys of the Gentoo Release Engineering team need to be imported. The list of keys is available on the signatures page. Once imported, the user can then verify the signature of the .DIGESTS.asc file.
This does not verify that the .DIGESTS file is correct, only that the .DIGESTS.asc file is. That also implies that the checksum should be verified against the values in the .DIGESTS.asc file, which is why the instructions above only refer to downloading the .DIGESTS.asc file.
The checksum itself can be verified using the Hashcalc application, although many others exist as well. Most of the time, these tools will show the user the calculated checksum, and the user is requested to verify this checksum with the value that is inside the .DIGESTS.asc file.
Linux based verification
On a Linux system, the most common method for verifying the cryptographic signature is to use the app-crypt/gnupg software. With this package installed, the following commands can be used to verify the cryptographic signature of the .DIGESTS.asc file.
First, download the right set of keys as made available on the signatures page:
user $
gpg --keyserver hkps://hkps.pool.sks-keyservers.net --recv-keys 0xBB572E0E2D182910
gpg: requesting key 0xBB572E0E2D182910 from hkp server pool.sks-keyservers.net gpg: key 0xBB572E0E2D182910: "Gentoo Linux Release Engineering (Automated Weekly Release Key) <releng@gentoo.org>" 1 new signature gpg: 3 marginal(s) needed, 1 complete(s) needed, classic trust model gpg: depth: 0 valid: 3 signed: 20 trust: 0-, 0q, 0n, 0m, 0f, 3u gpg: depth: 1 valid: 20 signed: 12 trust: 9-, 0q, 0n, 9m, 2f, 0u gpg: next trustdb check due at 2018-09-15 gpg: Total number processed: 1 gpg: new signatures: 1
Alternatively you can use instead the WKD to download the key:
user $
wget -O- https://gentoo.org/.well-known/openpgpkey/hu/wtktzo4gyuhzu8a4z5fdj3fgmr1u6tob?l=releng | gpg --import
--2019-04-19 20:46:32-- https://gentoo.org/.well-known/openpgpkey/hu/wtktzo4gyuhzu8a4z5fdj3fgmr1u6tob?l=releng Resolving gentoo.org (gentoo.org)... 89.16.167.134 Connecting to gentoo.org (gentoo.org)|89.16.167.134|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 35444 (35K) [application/octet-stream] Saving to: 'STDOUT' 0K .......... .......... .......... .... 100% 11.9M=0.003s 2019-04-19 20:46:32 (11.9 MB/s) - written to stdout [35444/35444] gpg: key 9E6438C817072058: 84 signatures not checked due to missing keys gpg: /tmp/test2/trustdb.gpg: trustdb created gpg: key 9E6438C817072058: public key "Gentoo Linux Release Engineering (Gentoo Linux Release Signing Key) <releng@gentoo.org>" imported gpg: key BB572E0E2D182910: 12 signatures not checked due to missing keys gpg: key BB572E0E2D182910: 1 bad signature gpg: key BB572E0E2D182910: public key "Gentoo Linux Release Engineering (Automated Weekly Release Key) <releng@gentoo.org>" imported gpg: Total number processed: 2 gpg: imported: 2 gpg: no ultimately trusted keys found
Next verify the cryptographic signature of the .DIGESTS.asc file:
user $
gpg --verify install-sparc-minimal-20141204.iso.DIGESTS.asc
gpg: Signature made Fri 05 Dec 2014 02:42:44 AM CET gpg: using RSA key 0xBB572E0E2D182910 gpg: Good signature from "Gentoo Linux Release Engineering (Automated Weekly Release Key) <releng@gentoo.org>" [unknown] gpg: WARNING: This key is not certified with a trusted signature! gpg: There is no indication that the signature belongs to the owner. Primary key fingerprint: 13EB BDBE DE7A 1277 5DFD B1BA BB57 2E0E 2D18 2910
To be absolutely certain that everything is valid, verify the fingerprint shown with the fingerprint on the Gentoo signatures page.
With the cryptographic signature validated, next verify the checksum to make sure the downloaded ISO file is not corrupted. The .DIGESTS.asc file contains multiple hashing algorithms, so one of the methods to validate the right one is to first look at the checksum registered in the .DIGESTS.asc file. For instance, to get the SHA512 checksum:
user $
grep -A 1 -i sha512 install-sparc-minimal-20141204.iso.DIGESTS.asc
# SHA512 HASH 364d32c4f8420605f8a9fa3a0fc55864d5b0d1af11aa62b7a4d4699a427e5144b2d918225dfb7c5dec8d3f0fe2cddb7cc306da6f0cef4f01abec33eec74f3024 install-sparc-minimal-20141204.iso -- # SHA512 HASH 0719a8954dc7432750de2e3076c8b843a2c79f5e60defe43fcca8c32ab26681dfb9898b102e211174a895ff4c8c41ddd9e9a00ad6434d36c68d74bd02f19b57f install-sparc-minimal-20141204.iso.CONTENTS
In the above output, two SHA512 checksums are shown - one for the install-sparc-minimal-20141204.iso file and one for its accompanying .CONTENTS file. Only the first checksum is of interest, as it needs to be compared with the calculated SHA512 checksum which can be generated as follows:
user $
sha512sum install-sparc-minimal-20141204.iso
364d32c4f8420605f8a9fa3a0fc55864d5b0d1af11aa62b7a4d4699a427e5144b2d918225dfb7c5dec8d3f0fe2cddb7cc306da6f0cef4f01abec33eec74f3024 install-sparc-minimal-20141204.iso
As both checksums match, the file is not corrupted and the installation can continue.
Burning a disk
Of course, with just an ISO file downloaded, the Gentoo Linux installation cannot be started. The ISO file needs to be burned on a CD to boot from, and in such a way that its content is burned on the CD, not just the file itself. Below a few common methods are described - a more elaborate set of instructions can be found in Our FAQ on burning an ISO file.
Burning with Microsoft Windows 7 and above
Versions of Microsoft Windows 7 and above can both mount and burn ISO images to optical media without the requirement for third-party software. Simply insert a burnable disk, browse to the downloaded ISO files, right click the file in Windows Explorer, and select "Burn disk image".
Burning with Linux
The cdrecord utility from the package app-cdr/cdrtools can burn ISO images on Linux.
To burn the ISO file on the CD in the /dev/sr0 device (this is the first CD device on the system - substitute with the right device file if necessary):
user $
cdrecord dev=/dev/sr0 install-sparc-minimal-20141204.iso
Users that prefer a graphical user interface can use K3B, part of the kde-apps/k3b package. In K3B, go to Tools and use Burn CD Image.
Booting
Booting the installation CD
Insert the Gentoo installation CD in the CD-ROM and boot the system. During startup, press Stop + A to enter OpenBootPROM (OBP). Once in the OBP, boot from the CD-ROM:
ok
boot cdrom
The SILO boot manager (on the installation CD) is then started. Hit Enter for more help. Type in gentoo and press Enter to continue booting the system:
boot:
gentoo
Once the Installation CD is booted, a root ("#") prompt will be displayed on the current console. There will also be a root prompt on the serial console (ttyS0).
Extra hardware configuration
When the Installation medium boots, it tries to detect all the hardware devices and loads the appropriate kernel modules to support the hardware. In the vast majority of cases, it does a very good job. However, in some cases it may not auto-load the kernel modules needed by the system. If the PCI auto-detection missed some of the system's hardware, the appropriate kernel modules have to be loaded manually.
In the next example the 8139too module (which supports certain kinds of network interfaces) is loaded:
root #
modprobe 8139too
Optional: User accounts
If other people need access to the installation environment, or there is need to run commands as a non-root user on the installation medium (such as to chat using irssi without root privileges for security reasons), then an additional user account needs to be created and the root password set to a strong password.
To change the root password, use the passwd utility:
root #
passwd
New password: (Enter the new password) Re-enter password: (Re-enter the password)
To create a user account, first enter their credentials, followed by the account's password. The useradd and passwd commands are used for these tasks.
In the next example, a user called john is created:
root #
useradd -m -G users john
root #
passwd john
New password: (Enter john's password) Re-enter password: (Re-enter john's password)
To switch from the (current) root user to the newly created user account, use the su command:
root #
su - john
Optional: Viewing documentation while installing
TTYs
To view the Gentoo handbook during the installation, first create a user account as described above. Then press Alt+F2 to go to a new terminal.
During the installation, the links command can be used to browse the Gentoo handbook - of course only from the moment that the Internet connection is working.
user $
links https://wiki.gentoo.org/wiki/Handbook:SPARC
To go back to the original terminal, press Alt+F1.
GNU Screen
The Screen utility is installed by default on official Gentoo installation media. It may be more efficient for the seasoned Linux enthusiast to use screen to view installation instructions via split panes rather than the multiple TTY method mentioned above.
Optional: Starting the SSH daemon
To allow other users to access the system during the installation (perhaps to support during an installation, or even do it remotely), a user account needs to be created (as was documented earlier on) and the SSH daemon needs to be started.
To fire up the SSH daemon on an OpenRC init, execute the following command:
root #
rc-service sshd start
If users log on to the system, they will see a message that the host key for this system needs to be confirmed (through what is called a fingerprint). This behavior is typical and can be expected for initial connections to an SSH server. However, later when the system is set up and someone logs on to the newly created system, the SSH client will warn that the host key has been changed. This is because the user now logs on to - for SSH - a different server (namely the freshly installed Gentoo system rather than the live environment that the installation is currently using). Follow the instructions given on the screen then to replace the host key on the client system.
To be able to use sshd, the network needs to function properly. Continue with the chapter on Configuring the network.
/pl
Handbook:Parts/Installation/Networking/pl
Handbook:Parts/Installation/Disks/pl
Handbook:Parts/Installation/Stage/pl
Chrooting
Optional: Selecting mirrors
Distribution files
In order to download source code quickly it is recommended to select a fast mirror. Portage will look in the make.conf file for the GENTOO_MIRRORS variable and use the mirrors listed therein. It is possible to surf to the Gentoo mirror list and search for a mirror (or mirrors) that is close to the system's physical location (as those are most frequently the fastest ones). However, we provide a nice tool called mirrorselect which provides users with a nice interface to select the mirrors needed. Just navigate to the mirrors of choice and press Spacebar to select one or more mirrors.
root #
mirrorselect -i -o >> /mnt/gentoo/etc/portage/make.conf
Gentoo ebuild repository
A second important step in selecting mirrors is to configure the Gentoo ebuild repository via the /etc/portage/repos.conf/gentoo.conf file. This file contains the sync information needed to update the package repository (the collection of ebuilds and related files containing all the information Portage needs to download and install software packages).
Configuring the repository can be done in a few simple steps. First, if it does not exist, create the repos.conf directory:
root #
mkdir --parents /mnt/gentoo/etc/portage/repos.conf
Next, copy the Gentoo repository configuration file provided by Portage to the (newly created) repos.conf directory:
root #
cp /mnt/gentoo/usr/share/portage/config/repos.conf /mnt/gentoo/etc/portage/repos.conf/gentoo.conf
Take a peek with a text editor or by using the cat command. The inside of the file should be in .ini format and look like this:
/mnt/gentoo/etc/portage/repos.conf/gentoo.conf
[DEFAULT] main-repo = gentoo [gentoo] location = /var/db/repos/gentoo sync-type = rsync sync-uri = rsync://rsync.gentoo.org/gentoo-portage auto-sync = yes sync-rsync-verify-jobs = 1 sync-rsync-verify-metamanifest = yes sync-rsync-verify-max-age = 24 sync-openpgp-key-path = /usr/share/openpgp-keys/gentoo-release.asc sync-openpgp-key-refresh-retry-count = 40 sync-openpgp-key-refresh-retry-overall-timeout = 1200 sync-openpgp-key-refresh-retry-delay-exp-base = 2 sync-openpgp-key-refresh-retry-delay-max = 60 sync-openpgp-key-refresh-retry-delay-mult = 4
The default sync-uri variable value listed above will determine a mirror location based on a rotation. This will aid in easing bandwidth stress on Gentoo's infrastructure and will provide a fail-safe in case a specific mirror is offline. It is recommended the default URI is retained unless a local, private Portage mirror will be used.
For those interested, the official specification for Portage's plug-in sync API can be found in the Portage project's Sync article.
Copy DNS info
One thing still remains to be done before entering the new environment and that is copying over the DNS information in /etc/resolv.conf. This needs to be done to ensure that networking still works even after entering the new environment. /etc/resolv.conf contains the name servers for the network.
To copy this information, it is recommended to pass the --dereference
option to the cp command. This ensures that, if /etc/resolv.conf is a symbolic link, that the link's target file is copied instead of the symbolic link itself. Otherwise in the new environment the symbolic link would point to a non-existing file (as the link's target is most likely not available inside the new environment).
root #
cp --dereference /etc/resolv.conf /mnt/gentoo/etc/
Mounting the necessary filesystems
In a few moments, the Linux root will be changed towards the new location. To make sure that the new environment works properly, certain filesystems need to be made available there as well.
The filesystems that need to be made available are:
- /proc/ which is a pseudo-filesystem (it looks like regular files, but is actually generated on-the-fly) from which the Linux kernel exposes information to the environment
- /sys/ which is a pseudo-filesystem, like /proc/ which it was once meant to replace, and is more structured than /proc/
- /dev/ is a regular file system, partially managed by the Linux device manager (usually udev), which contains all device files
The /proc/ location will be mounted on /mnt/gentoo/proc/ whereas the other two are bind-mounted. The latter means that, for instance, /mnt/gentoo/sys/ will actually be /sys/ (it is just a second entry point to the same filesystem) whereas /mnt/gentoo/proc/ is a new mount (instance so to speak) of the filesystem.
root #
mount --types proc /proc /mnt/gentoo/proc
root #
mount --rbind /sys /mnt/gentoo/sys
root #
mount --make-rslave /mnt/gentoo/sys
root #
mount --rbind /dev /mnt/gentoo/dev
root #
mount --make-rslave /mnt/gentoo/dev
The
--make-rslave
operations are needed for systemd support later in the installation.When using non-Gentoo installation media, this might not be sufficient. Some distributions make /dev/shm a symbolic link to /run/shm/ which, after the chroot, becomes invalid. Making /dev/shm/ a proper tmpfs mount up front can fix this:
root #
test -L /dev/shm && rm /dev/shm && mkdir /dev/shm
root #
mount --types tmpfs --options nosuid,nodev,noexec shm /dev/shm
Also ensure that mode 1777 is set:
root #
chmod 1777 /dev/shm
Entering the new environment
Now that all partitions are initialized and the base environment installed, it is time to enter the new installation environment by chrooting into it. This means that the session will change its root (most top-level location that can be accessed) from the current installation environment (installation CD or other installation medium) to the installation system (namely the initialized partitions). Hence the name, change root or chroot.
This chrooting is done in three steps:
- The root location is changed from / (on the installation medium) to /mnt/gentoo/ (on the partitions) using chroot
- Some settings (those in /etc/profile) are reloaded in memory using the source command
- The primary prompt is changed to help us remember that this session is inside a chroot environment.
root #
chroot /mnt/gentoo /bin/bash
root #
source /etc/profile
root #
export PS1="(chroot) ${PS1}"
From this point, all actions performed are immediately on the new Gentoo Linux environment. Of course it is far from finished, which is why the installation still has some sections left!
If the Gentoo installation is interrupted anywhere after this point, it should be possible to 'resume' the installation at this step. There is no need to repartition the disks again! Simply mount the root partition and run the steps above starting with copying the DNS info to re-enter the working environment. This is also useful for fixing bootloader issues. More information can be found in the chroot article.
Configuring Portage
Installing a Gentoo ebuild repository snapshot from the web
Next step is to install a snapshot of the Gentoo ebuild repository. This snapshot contains a collection of files that informs Portage about available software titles (for installation), which profiles the system administrator can select, package or profile specific news items, etc.
The use of emerge-webrsync is recommended for those who are behind restrictive firewalls (it uses HTTP/FTP protocols for downloading the snapshot) and saves network bandwidth. Readers who have no network or bandwidth restrictions can happily skip down to the next section.
This will fetch the latest snapshot (which is released on a daily basis) from one of Gentoo's mirrors and install it onto the system:
root #
emerge-webrsync
During this operation, emerge-webrsync might complain about a missing /var/db/repos/gentoo/ location. This is to be expected and nothing to worry about - the tool will create the location.
From this point onward, Portage might mention that certain updates are recommended to be executed. This is because system packages installed through the stage file might have newer versions available; Portage is now aware of new packages because of the repository snapshot. Package updates can be safely ignored for now; updates can be delayed until after the Gentoo installation has finished.
Opcjonalne: Aktualizowanie repozytorium Gentoo
It is possible to update the Gentoo ebuild repository to the latest version. The previous emerge-webrsync command will have installed a very recent snapshot (usually recent up to 24h) so this step is definitely optional.
Suppose there is a need for the last package updates (up to 1 hour), then use emerge --sync. This command will use the rsync protocol to update the Gentoo ebuild repository (which was fetched earlier on through emerge-webrsync) to the latest state.
root #
emerge --sync
On slow terminals, like some framebuffers or serial consoles, it is recommended to use the --quiet
option to speed up the process:
root #
emerge --sync --quiet
Reading news items
When the Gentoo ebuild repository is synchronized, Portage may output informational messages similar to the following:
* IMPORTANT: 2 news items need reading for repository 'gentoo'.
* Use eselect news to read news items.
News items were created to provide a communication medium to push critical messages to users via the Gentoo ebuild repository. To manage them, use eselect news. The eselect application is a Gentoo-specific utility that allows for a common management interface for system administration. In this case, eselect is asked to use its news
module.
For the news
module, three operations are most used:
- With
list
an overview of the available news items is displayed. - With
read
the news items can be read. - With
purge
news items can be removed once they have been read and will not be reread anymore.
root #
eselect news list
root #
eselect news read
More information about the news reader is available through its manual page:
root #
man news.eselect
Choosing the right profile
A profile is a building block for any Gentoo system. Not only does it specify default values for USE, CFLAGS, and other important variables, it also locks the system to a certain range of package versions. These settings are all maintained by Gentoo's Portage developers.
You can see what profile the system is currently using with eselect, now using the profile
module:
root #
eselect profile list
Available profile symlink targets: [1] default/linux/sparc/ * [2] default/linux/sparc//desktop [3] default/linux/sparc//desktop/gnome [4] default/linux/sparc//desktop/kde
The output of the command is just an example and evolves over time.
As can be seen, there are also desktop subprofiles available for some architectures.
Profile upgrades are not to be taken lightly. When selecting the initial profile, make sure to use profile corresponding to the same version as the one initially used by stage3 (e.g. ). Each new profile version is announced through a news item containing migration instructions. Make sure to read it and follow them before switching to a newer profile.
After viewing the available profiles for the sparc architecture, users can select a different profile for the system:
root #
eselect profile set 2
The
developer
subprofile is specifically for Gentoo Linux development and is not meant to be used by casual users.Updating the @world set
At this point, it is wise to update the system's @world set so that a base can be established.
This following step is necessary so the system can apply any updates or USE flag changes which have appeared since the stage3 was built and from any profile selection:
root #
emerge --ask --verbose --update --deep --newuse @world
If a full scale desktop environment profile has been selected this process could greatly extend the amount of time necessary for the install process. Those in a time crunch can work by this 'rule of thumb': the shorter the profile name, the less specific the system's @world set; the less specific the @world set, the fewer packages the system will require. In other words:
- Selecting
default/linux/amd64/
will require very few packages to be updated, whereas - Selecting
default/linux/amd64//desktop/gnome/systemd
will require many packages to be installed since the init system is changing from OpenRC to systemd, and the GNOME desktop environment framework will be installed.
Configuring the USE variable
USE is one of the most powerful variables Gentoo provides to its users. Several programs can be compiled with or without optional support for certain items. For instance, some programs can be compiled with support for GTK+ or with support for Qt. Others can be compiled with or without SSL support. Some programs can even be compiled with framebuffer support (svgalib) instead of X11 support (X-server).
Most distributions compile their packages with support for as much as possible, increasing the size of the programs and startup time, not to mention an enormous amount of dependencies. With Gentoo users can define what options a package should be compiled with. This is where USE comes into play.
In the USE variable users define keywords which are mapped onto compile-options. For instance, ssl
will compile SSL support in the programs that support it. -X
will remove X-server support (note the minus sign in front). gnome gtk -kde -qt4 -qt5
will compile programs with GNOME (and GTK+) support, and not with KDE (and Qt) support, making the system fully tweaked for GNOME (if the architecture supports it).
The default USE settings are placed in the make.defaults files of the Gentoo profile used by the system. Gentoo uses a (complex) inheritance system for its profiles, which we will not dive into at this stage. The easiest way to check the currently active USE settings is to run emerge --info and select the line that starts with USE:
root #
emerge --info | grep ^USE
USE="X acl alsa amd64 berkdb bindist bzip2 cli cracklib crypt cxx dri ..."
The above example is truncated, the actual list of USE values is much, much larger.
A full description on the available USE flags can be found on the system in /var/db/repos/gentoo/profiles/use.desc.
root #
less /var/db/repos/gentoo/profiles/use.desc
Inside the less command, scrolling can be done using the ↑ and ↓ keys, and exited by pressing q.
As an example we show a USE setting for a KDE-based system with DVD, ALSA, and CD recording support:
root #
nano -w /etc/portage/make.conf
/etc/portage/make.conf
Enabling flags for a KDE/Plasma-based system with DVD, ALSA, and CD recording supportUSE="-gtk -gnome qt4 qt5 kde dvd alsa cdr"
When USE is defined in /etc/portage/make.conf it is added (or removed if the USE flag starts with the - sign) from that default list. Users who want to ignore any default USE settings and manage it completely themselves should start the USE definition in make.conf with -*
:
/etc/portage/make.conf
Ignoring default USE flagsUSE="-* X acl alsa"
Although possible, setting
-*
(as seen in the example above) is discouraged since carefully chosen USE flag defaults may be configured for some packages to prevent conflicts and other errors.Optional: Configuring the ACCEPT_LICENSE variable
All of the Gentoo packages are tagged with the license(s) the package falls under. This allows users to select software by specific licenses or groups of licenses prior to installing it.
The LICENSE variable in an ebuild is only a guideline for Gentoo developers and users. It is not a legal statement, and there is no guarantee that it will reflect reality. So don't rely on it, but check the package itself in depth, including all files that you use.
Portage uses the ACCEPT_LICENSE variable to determine which packages to allow without prompting the user for the licenses previously accepted. Exceptions can be made per-package in /etc/portage/package.license as well.
The license groups defined in the Gentoo repository, managed by the Gentoo Licenses project, are:
Group Name | Description |
---|---|
@GPL-COMPATIBLE | GPL compatible licenses approved by the Free Software Foundation [a_license 1] |
@FSF-APPROVED | Free software licenses approved by the FSF (includes @GPL-COMPATIBLE) |
@OSI-APPROVED | Licenses approved by the Open Source Initiative [a_license 2] |
@MISC-FREE | Misc licenses that are probably free software, i.e. follow the Free Software Definition [a_license 3] but are not approved by either FSF or OSI |
@FREE-SOFTWARE | Combines @FSF-APPROVED, @OSI-APPROVED and @MISC-FREE |
@FSF-APPROVED-OTHER | FSF-approved licenses for "free documentation" and "works of practical use besides software and documentation" (including fonts) |
@MISC-FREE-DOCS | Misc licenses for free documents and other works (including fonts) that follow the free definition [a_license 4] but are NOT listed in @FSF-APPROVED-OTHER |
@FREE-DOCUMENTS | Combines @FSF-APPROVED-OTHER and @MISC-FREE-DOCS |
@FREE | Metaset of all licenses with the freedom to use, share, modify and share modifications. Combines @FREE-SOFTWARE and @FREE-DOCUMENTS |
@BINARY-REDISTRIBUTABLE | Licenses that at least permit free redistribution of the software in binary form. Includes @FREE |
@EULA | License agreements that try to take away your rights. These are more restrictive than "all-rights-reserved" or require explicit approval |
Gentoo comes with a predefined value in the profiles, for example:
user $
portageq envvar ACCEPT_LICENSE
@FREE
This can be customized system wide by changing /etc/portage/make.conf. The default value will only accept licenses that are explicitly approved by the Free Software Foundation, the Open Source Initiative, or that follow the Free Software Definition:
/etc/portage/make.conf
Customizing ACCEPT_LICENSEACCEPT_LICENSE="-* @FREE"
Per package overrides can then be added if necessary and desired, for example:
/etc/portage/package.license/kernel
Sample license acceptanceapp-arch/unrar unRAR sys-kernel/linux-firmware @BINARY-REDISTRIBUTABLE sys-firmware/intel-microcode intel-ucode
Timezone
Select the timezone for the system. Look for the available timezones in /usr/share/zoneinfo/, then write it in the /etc/timezone file.
root #
ls /usr/share/zoneinfo
Suppose the timezone of choice is Europe/Brussels:
root #
echo "Europe/Brussels" > /etc/timezone
Please avoid the /usr/share/zoneinfo/Etc/GMT* timezones as their names do not indicate the expected zones. For instance, GMT-8 is in fact GMT+8.
Next, reconfigure the sys-libs/timezone-data package, which will update the /etc/localtime file for us, based on the /etc/timezone entry. The /etc/localtime file is used by the system C library to know the timezone the system is in.
root #
emerge --config sys-libs/timezone-data
Configure locales
Locale generation
Most users will want to use only one or two locales on their system.
Locales specify not only the language that the user should use to interact with the system, but also the rules for sorting strings, displaying dates and times, etc. Locales are case sensitive and must be represented exactly as described. A full listing of available locales can be found in the /usr/share/i18n/SUPPORTED file.
Supported system locales must be defined in the /etc/locale.gen file.
root #
nano -w /etc/locale.gen
The following locales are an example to get both English (United States) and German (Germany/Deutchland) with the accompanying character formats (like UTF-8).
/etc/locale.gen
Enabling US and DE locales with the appropriate character formatsen_US ISO-8859-1 en_US.UTF-8 UTF-8 de_DE ISO-8859-1 de_DE.UTF-8 UTF-8
We strongly suggest adding at least one UTF-8 locale because many applications may require it to build properly.
The next step is to run the locale-gen command. This command generates all locales specified in the /etc/locale.gen file.
root #
locale-gen
To verify that the selected locales are now available, run locale -a.
Locale selection
Once done, it is now time to set the system-wide locale settings. Again we use eselect for this, now with the locale
module.
With eselect locale list, the available targets are displayed:
root #
eselect locale list
Available targets for the LANG variable: [1] C [2] POSIX [3] en_US [4] en_US.iso88591 [5] en_US.utf8 [6] de_DE [7] de_DE.iso88591 [8] de_DE.iso885915 [9] de_DE.utf8 [ ] (free form)
With eselect locale set <NUMBER> the correct locale can be selected:
root #
eselect locale set 9
Manually, this can still be accomplished through the /etc/env.d/02locale file:
/etc/env.d/02locale
Manually setting system locale definitionsLANG="de_DE.UTF-8" LC_COLLATE="C"
Setting the locale will avoid warnings and errors during kernel and software compilations later in the installation.
Now reload the environment:
root #
env-update && source /etc/profile && export PS1="(chroot) ${PS1}"
A full Localization guide to provide additional guidance through the locale selection process. Another interesting article is the UTF-8 guide for very specific information to enable UTF-8 on the system.
Handbook:Parts/Installation/Kernel/pl
Handbook:Parts/Installation/System/pl
Handbook:Parts/Installation/Tools/pl
SILO, the SPARC bootloader
Now install and configure SILO, the Sparc Improved boot LOader.
root #
emerge --ask sys-boot/silo
Next create /etc/silo.conf:
root #
nano -w /etc/silo.conf
Below an example silo.conf file is shown. It uses the partitioning scheme we use throughout this book, kernel-3.16.5-gentoo as kernel image and initramfs-genkernel-sparc64-3.16.5-gentoo as initramfs.
/etc/silo.conf
Example configuration filepartition = 1 # Boot partition (= root partition) root = /dev/sda1 # Root partition timeout = 150 # Wait 15 seconds before booting the default section image = /boot/kernel-3.16.5-gentoo label = linux append = "initrd=/boot/initramfs-genkernel-sparc64-3.16.5-gentoo root=/dev/sda1"
When using the example silo.conf file as delivered by Portage, be sure to comment out all lines that aren't needed.
If the physical disk on which to install SILO (as bootloader) differs from the physical disk on which /etc/silo.conf resides, then first copy over /etc/silo.conf to a partition on that disk. If /boot/ is a separate partition on that disk, copy over the configuration file to /boot/ and run /sbin/silo:
root #
cp /etc/silo.conf /boot
root #
/sbin/silo -C /boot/silo.conf
/boot/silo.conf appears to be valid
Otherwise just run /sbin/silo:
root #
/sbin/silo
/etc/silo.conf appears to be valid
Run silo (with parameters if necessary) again each time after updating or installing the sys-boot/silo package.
Ponowne uruchomienie systemu
Wyjdź z środowiska chroot i odmontuj wszystkie zamontowane partycje. Następnie wpisz magiczne polecenie, które inicjuje ostateczny, prawdziwy test: reboot.
root #
exit
cdimage ~#
cd
cdimage ~#
umount -l /mnt/gentoo/dev{/shm,/pts,}
cdimage ~#
umount -R /mnt/gentoo
cdimage ~#
reboot
Nie zapomnij usunąć medium instalacyjnego, w przeciwnym razie zamiast nowego systemu Gentoo może zostać ponownie uruchomione medium instalacyjne.
Po uruchomieniu świeżo zainstalowanego środowiska Gentoo, kontynuuj Finalizowanie instalacji Gentoo.
Handbook:Parts/Installation/Finalizing/pl
Warning: Display title "Gentoo Linux sparc Podręcznik: Instalowanie Gentoo" overrides earlier display title "Handbook:SPARC/Full/Installation".