Zde popíši jednoduchou minimalistickou instalaci Gentoo Linuxu, použitelnou třeba pro router nebo minimální server.

Gentoo Linux se liší od jiných distribucí Linuxu hlavně tím, že se sestavuje (kompiluje) na stroji, na který se systém instaluje. Trvá to ovšem někdy dost dlouho.

Systém Gentoo se příliš nehodí pro desktop, protože sestavení a nastavení desktopu je hodně dlouhé a náročné na znalosti. Na desktop se lépe hodí třeba Ubuntu Linux nebo Fedora, které se dají nainstalovat během hodiny. U Gentoo to jde také, ale bude to trvat třeba několik dní.
Použité hardware Gigabyte MiniPC 16GB RAM, 120GB SSD Inted disk

gigabyte minipc

Boot počítače

Použije se Finnix z USB klíčenky, popis jak si ji vyrobit je zde

Výpis hardware
root@0:~# lspci
00:00.0 Host bridge: Intel Corporation Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series SoC Transaction Register (rev 35)
00:02.0 VGA compatible controller: Intel Corporation Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Integrated Graphics Controller (rev 35)
00:10.0 SD Host controller: Intel Corporation Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series MMC Controller (rev 35)
00:12.0 SD Host controller: Intel Corporation Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series SD Controller (rev 35)
00:13.0 SATA controller: Intel Corporation Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series SATA Controller (rev 35)
00:14.0 USB controller: Intel Corporation Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series USB xHCI Controller (rev 35)
00:1a.0 Encryption controller: Intel Corporation Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series Trusted Execution Engine (rev 35)
00:1b.0 Audio device: Intel Corporation Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series High Definition Audio Controller (rev 35)
00:1c.0 PCI bridge: Intel Corporation Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series PCI Express Port #1 (rev 35)
00:1c.1 PCI bridge: Intel Corporation Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series PCI Express Port #2 (rev 35)
00:1c.3 PCI bridge: Intel Corporation Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series PCI Express Port #4 (rev 35)
00:1f.0 ISA bridge: Intel Corporation Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series PCU (rev 35)
00:1f.3 SMBus: Intel Corporation Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx SMBus Controller (rev 35)
01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)
03:00.0 PCI bridge: ASMedia Technology Inc. ASM1182e 2-Port PCIe x1 Gen2 Packet Switch

Vytvoření diskových oddílů

Výpis diskových oddílů jednotlivých disků
root@0:~# fdisk -l
Disk /dev/sda: 119.24 GiB, 128035676160 bytes, 250069680 sectors
Disk model: INTEL SSDSC2KW12
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x609419c0

Device     Boot     Start       End   Sectors  Size Id Type
/dev/sda1            2048 232785919 232783872  111G 83 Linux        (1)
/dev/sda2       232785920 250069679  17283760  8.2G 83 Linux        (2)


Disk /dev/sdb: 28.67 GiB, 30784094208 bytes, 60125184 sectors
Disk model: Cruzer Blade
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xb2a38918

Device     Boot Start     End Sectors  Size Id Type
/dev/sdb1  *       64 1001471 1001408  489M  0 Empty
/dev/sdb2         740   10915   10176    5M ef EFI (FAT-12/16/32)


Disk /dev/loop0: 407.92 MiB, 427737088 bytes, 835424 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/zram0: 7.77 GiB, 8341893120 bytes, 2036595 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
root@0:~#
1 Tady je nějaká stará instalace Linuxu
2 Zde je od ní swap oddíl

Budeme instalovat na první disk /dev/sda, ale nejprve si ho fyzicky vymažeme, protože tam je již nějaká instalace.

Fyzické smazání disku (trvá dost dlouho)
root@0:~# dd if=/dev/zero of=/dev/sda bs=8192 (1)
^C11915889+0 records in
11915889+0 records out
97614962688 bytes (98 GB, 91 GiB) copied, 725.644 s, 135 MB/s
1 /dev/zero je zařízení, které produkuje samé 0, zapíšeme je na 1. disk /dev/sda po blocích o velikosti 8192 bajtů

Můžeme zkontrolovat stav disku pomocí smartctl --all /dev/sda

Kontrola zdraví disku
root@0:~# smartctl --all /dev/sda
smartctl 7.3 2022-02-28 r5338 [x86_64-linux-6.1.0-6-amd64] (local build)
Copyright (C) 2002-22, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     Intel 545s Series SSDs
Device Model:     INTEL SSDSC2KW128G8
Serial Number:    PHLA806100WQ128BGN
LU WWN Device Id: 5 5cd2e4 14f166a41
Firmware Version: LHF002C
User Capacity:    128,035,676,160 bytes [128 GB]
Sector Size:      512 bytes logical/physical
Rotation Rate:    Solid State Device
Form Factor:      2.5 inches
TRIM Command:     Available, deterministic, zeroed
Device is:        In smartctl database 7.3/5319
ATA Version is:   ACS-3 (minor revision not indicated)
SATA Version is:  SATA 3.2, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is:    Mon Nov 27 05:07:30 2023 UTC
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x00)	Offline data collection activity
					was never started.
					Auto Offline Data Collection: Disabled.
Self-test execution status:      (   0)	The previous self-test routine completed
					without error or no self-test has ever
					been run.
Total time to complete Offline
data collection: 		(    0) seconds.
Offline data collection
capabilities: 			 (0x53) SMART execute Offline immediate.
					Auto Offline data collection on/off support.
					Suspend Offline collection upon new
					command.
					No Offline surface scan supported.
					Self-test supported.
					No Conveyance Self-test supported.
					Selective Self-test supported.
SMART capabilities:            (0x0003)	Saves SMART data before entering
					power-saving mode.
					Supports SMART auto save timer.
Error logging capability:        (0x01)	Error logging supported.
					General Purpose Logging supported.
Short self-test routine
recommended polling time: 	 (   2) minutes.
Extended self-test routine
recommended polling time: 	 (  15) minutes.
SCT capabilities: 	       (0x003d)	SCT Status supported.
					SCT Error Recovery Control supported.
					SCT Feature Control supported.
					SCT Data Table supported.

SMART Attributes Data Structure revision number: 1
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  5 Reallocated_Sector_Ct   0x0032   100   100   000    Old_age   Always       -       0
  9 Power_On_Hours          0x0032   100   100   000    Old_age   Always       -       35432
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       31
170 Unknown_Attribute       0x0033   100   100   010    Pre-fail  Always       -       0
171 Program_Fail_Count      0x0032   100   100   000    Old_age   Always       -       0
172 Erase_Fail_Count        0x0032   100   100   000    Old_age   Always       -       0
173 Unknown_Attribute       0x0033   099   099   005    Pre-fail  Always       -       107376738305
174 Unexpect_Power_Loss_Ct  0x0032   100   100   000    Old_age   Always       -       28
183 SATA_Downshift_Count    0x0032   100   100   000    Old_age   Always       -       0
184 End-to-End_Error        0x0033   100   100   090    Pre-fail  Always       -       0
187 Reported_Uncorrect      0x0032   100   100   000    Old_age   Always       -       0
190 Temperature_Case        0x0032   030   039   000    Old_age   Always       -       30 (Min/Max 19/39)
192 Unsafe_Shutdown_Count   0x0032   100   100   000    Old_age   Always       -       28
199 CRC_Error_Count         0x0032   100   100   000    Old_age   Always       -       0
225 Host_Writes_32MiB       0x0032   100   100   000    Old_age   Always       -       13650
226 Workld_Media_Wear_Indic 0x0032   100   100   000    Old_age   Always       -       0
227 Workld_Host_Reads_Perc  0x0032   100   100   000    Old_age   Always       -       0
228 Workload_Minutes        0x0032   100   100   000    Old_age   Always       -       0
232 Available_Reservd_Space 0x0033   100   100   010    Pre-fail  Always       -       0
233 Media_Wearout_Indicator 0x0032   099   099   000    Old_age   Always       -       0
236 Unknown_Attribute       0x0032   099   099   000    Old_age   Always       -       0
241 Host_Writes_32MiB       0x0032   100   100   000    Old_age   Always       -       13650
242 Host_Reads_32MiB        0x0032   100   100   000    Old_age   Always       -       4361
249 NAND_Writes_1GiB        0x0032   100   100   000    Old_age   Always       -       2700
252 Unknown_Attribute       0x0032   100   100   000    Old_age   Always       -       25

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
No self-tests have been logged.  [To run self-tests, use: smartctl -t]

SMART Selective self-test log data structure revision number 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.

root@0:~#

Disk má sice naběháno 35432 hodin, ale nemá žádné realokované sektory ani jiné chyby. Navíc je to průmyslový typ disku od Intelu, prostě držák.

Vytvoříme diskové oddíly pomocí fdisk, disk je malý použijeme MBR partition (GPT partition je zbytečná).

Vytvoření diskových oddílů (partitions)
root@0:~# fdisk /dev/sda

Welcome to fdisk (util-linux 2.38.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

This disk is currently in use - repartitioning is probably a bad idea.
It's recommended to umount all file systems, and swapoff all swap
partitions on this disk.


Device does not contain a recognized partition table.
Created a new DOS (MBR) disklabel with disk identifier 0xf97afa25.

Command (m for help): n  (1)
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): p   (2)
Partition number (1-4, default 1): 1    (3)
First sector (2048-250069679, default 2048):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-250069679, default 250069679): +100G    (4)

Created a new partition 1 of type 'Linux' and of size 100 GiB.

Command (m for help): n (5)
Partition type
   p   primary (1 primary, 0 extended, 3 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (2-4, default 2): 2
First sector (209717248-250069679, default 209717248):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (209717248-250069679, default 250069679): (6)

Created a new partition 2 of type 'Linux' and of size 19.2 GiB.

Command (m for help): t     (7)
Partition number (1,2, default 2):
Hex code or alias (type L to list all): 82  (8)

Changed type of partition 'Linux' to 'Linux swap / Solaris'.

Command (m for help): p     (9)
Disk /dev/sda: 119.24 GiB, 128035676160 bytes, 250069680 sectors
Disk model: INTEL SSDSC2KW12
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xf97afa25

Device     Boot     Start       End   Sectors  Size Id Type
/dev/sda1            2048 209717247 209715200  100G 83 Linux
/dev/sda2       209717248 250069679  40352432 19.2G 82 Linux swap / Solaris

Command (m for help): w
The partition table has been altered.
Failed to add partition 1 to system: Device or resource busy
Failed to add partition 2 to system: Device or resource busy

The kernel still uses the old partitions. The new table will be used at the next reboot. (10)
Syncing disks.
root@0:~# reboot
1 Vytvoříme nový oddíl pro kořenový filesystém
2 Typ oddílu je primární
3 Číslo oddílu je 1
4 O velikosti 100 GByte
5 Vytvoříme ještě jeden nový oddíl pro swap
6 Velikost bude do konce disku, mačkám ENTER
7 U druhého oddílu musím změnit typ
8 Linux swap má číslo typu 82 (pokud bych nevěděl, tak mi velké L vypíše nápovědu)
9 Výpis oddílů, jsem spokojen, mohu to uložit příkazem w
10 Protože my systém hlásí, že má v paměti stále starou tabulku oddílů, musím celý stroj restartovat

Vytvoření filesystému a swapu

Po restartu stroje vytvořím kořenový filesystém ext4

Vytvoření ext4
root@0:~# mkfs -t ext4 /dev/sda1
mke2fs 1.46.6 (1-Feb-2023)
/dev/sda1 contains a ext4 file system
	last mounted on /mnt/gentoo on Mon Nov 27 04:53:20 2023
Proceed anyway? (y,N) y
Discarding device blocks: done
Creating filesystem with 26214400 4k blocks and 6553600 inodes
Filesystem UUID: 5a475ce2-9614-46b1-89dc-7a73e303d2d6
Superblock backups stored on blocks:
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
	4096000, 7962624, 11239424, 20480000, 23887872

Allocating group tables: done
Writing inode tables: done
Creating journal (131072 blocks): done
Writing superblocks and filesystem accounting information: done

root@0:~#

Vytvořím odkládací oddíl (swap) a hned ho aktivuji.

Vytvoření swap oddílu a jeho aktivace
root@0:~# mkswap /dev/sda2
Setting up swapspace version 1, size = 19.2 GiB (20660441088 bytes)
no label, UUID=0d49b572-f5ca-4bce-9ac6-eeab1d27ab62
root@0:~# swapon /dev/sda2

Nově vytvořený filesystém si připojím do přípojného bodu /mnt/gentoo.

root@0:~# mkdir /mnt/gentoo
root@0:~# mount -t ext4 /dev/sda1 /mnt/gentoo

Přepnu se do adresáře /mnt/gentoo a stáhnu si pomocí textového webového prohlížeče elinks archiv s předpřipraveným systémem Stage 3 openrc 2023-11-19 245MiB z Gentoo webu.

Poznámka: Automatický build se mění skoro každý den, proto je to lepší stahovat elinksem
a neautomatizovat třeba wgetem.
Textový internetový prohlížeč elinks
root@0:~# cd /mnt/gentoo
root@0:/mnt/gentoo# elinks https://www.gentoo.org/

                                                                                                                                                                                                                                                                                                 Welcome – Gentoo Linux (1/3)
   Link: Gentoo Website (search)
   Link: Gentoo Forums (search)
   Link: Gentoo Bugzilla (search)
   Link: Gentoo Packages (search)
   Link: Gentoo List Archives (search)
   Link: Gentoo Linux news (alternate)
   Get Gentoo!
   gentoo.org sites

     • gentoo.org
     • Wiki
     • Bugs
     • Packages
     • Devmanual
     • Forums
     • 

     • Planet
     • Archives
     • Gitweb
     • 

     • Infra status

   [IMG] Gentoo Linux logo
   Toggle navigation

     • Home
     • Get started
     • Downloads
     • Inside Gentoo
     • Support
     • Get involved
                                                                                                                              ┌─────────────────────────── Welcome ────────────────────────────┐
     • Donate                                                                                                                 │                                                                │
                                                                                                                              │                       Welcome to ELinks!                       │
   Welcome to Gentoo, a highly flexible, source-based Linux distribution.                                                     │                                                                │
                                                                                                                              │  Press ESC for menu. Documentation is available in Help menu.  │
   Learn more Get started now                                                                                                 │                                                                │
                                                                                                                              │                            [ OK ]                              │
Gentoo accepted into Google Summer of Code 2023 (Feb 22, 2023)                                                                └────────────────────────────────────────────────────────────────┘

   GSoC logo

   Do you want to learn more about Gentoo and contribute to your favourite free software project?! Once again, now for the 11th time, we have been accepted as a mentoring organization for this year’s Google Summer of Code!

   The GSoC is an excellent opportunity for gaining real-world experience in software design and making oneself known in the broader open source community. It also looks great on a resume. Some initial project ideas can be found here, but new projects ideas are also welcome. For new projects time is of the
   essence: they have to be worked out, discussed with the mentors, and submitted before the April 4th deadline. It is strongly recommended that contributors refine new project ideas with a mentor before proposing the idea formally.

   Potential GSoC contributors are encouraged to e-mail the GSoC admins with their name, IRC nickname, and the desired project, and discuss ideas in the #gentoo-soc IRC channel on Libera Chat. Further information can be found on the Gentoo GSoC 2023 wiki page. Those with unanswered questions should also not
   hesitate to contact the Summer of Code mentors via their mailing list.

2022 in retrospect & late happy new year 2023! (Feb 9, 2023)

   Gentoo Fireworks A quite late Happy New Year 2023 to all of you!

   Once again with 2022 an eventful year has passed, and Gentoo is still alive and kicking! 2023 already started some time ago and some of us have even already been meeting up and networking at FOSDEM 2023. Still, we are happy to present once more a review of the Gentoo news of the past year 2022. Read on for new
   developers, distribution wide initiatives and improvements, up-to-date numbers on Gentoo development, tales from the infrastructure, and all the fresh new packages you can emerge now.

   All news items

   ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Developer blogs live from Planet Gentoo

   mpagano Genpatches Supported Kernel Versions
   GSoC    Final Report, Automated Gentoo System Updater
   GSoC    gentoo_update User Guide
   GSoC    Week 12 report on porting Gentoo packages to modern C
   GSoC    Week 11+12 Report, Automated Gentoo System Updater

Security advisories from our Security database

   GLSA 202311-17 phpMyAdmin: Multiple Vulnerabilities   low
https://www.gentoo.org/search/www-gentoo-org.xml

Archiv stage3 je stažen, rozbalím ho na nově vytvořeném filesytému pomocí taru.

Rozbalení stage3
root@0:/mnt/gentoo# ls -l
total 251448
drwx------ 2 root root     16384 Nov 27 05:24 lost+found
-rw-r--r-- 1 root root 257465000 Nov 27 05:35 stage3-amd64-openrc-20231119T164701Z.tar.xz
root@0:/mnt/gentoo# tar xf stage3-amd64-openrc-20231119T164701Z.tar.xz
root@0:/mnt/gentoo#

Instalace systému

Rozbalením stage3 mám naistalován systém, kde mohu kompilovat další balíky a sestavit a nainstalovat jádro (kernel) operačního systému Linux.

Musím ještě přimontovat některé pseudofilesytémy a zkopírovat do adresáře /etc soubor /etc/resolv.conf (konfigurační soubor resolveru).

root@0:/mnt/gentoo# mount -t proc proc /mnt/gentoo/proc
root@0:/mnt/gentoo# mount --rbind /dev /mnt/gentoo/dev
root@0:/mnt/gentoo# mount --rbind /sys /mnt/gentoo/sys
root@0:/mnt/gentoo# cp /etc/resolv.conf /mnt/gentoo/etc/

Nyní mohu udělat chroot do nového systému a dodělat instalaci.

chroot /mnt/gentoo /bin/bash

Ocitám se v novém systému a jdeme sestavovat balíky.

Sestavování softwarových balíků na Gentoo Linuxu se provádí příkazem emerge. Program emerge řeší závislosti mezi jednotlivými balíky, takže se o to nemusím starat.

Nejprve zasynchronizuji svůj repozitář softwarových balíků s repozitářem vývojářů Gentoo.

finnix / # emerge --sync --quiet (1)
setlocale: unsupported locale setting
setlocale: unsupported locale setting
1 Všechny príkazy emerge budu dělat s přepínačm --quiet, protože jinak by výpisy byly hooodně dlouhé.

Po synchronizaci repozitářů si nainstaluji Midnight Commander mc, zavaděč systému grub a upravené zdrojové kódy jádra operačního sytému Linux gentoo-sources.

Sestavení Midnight Commanderu
finnix / # emerge app-misc/mc --quiet
setlocale: unsupported locale setting
setlocale: unsupported locale setting

 * IMPORTANT: 13 news items need reading for repository 'gentoo'.
 * Use eselect news read to view new items.

>>> Verifying ebuild manifests
>>> Emerging (1 of 7) dev-libs/libpcre-8.45-r2::gentoo
>>> Installing (1 of 7) dev-libs/libpcre-8.45-r2::gentoo
>>> Completed (1 of 7) dev-libs/libpcre-8.45-r2::gentoo
>>> Emerging (2 of 7) dev-libs/elfutils-0.189-r4::gentoo
>>> Installing (2 of 7) dev-libs/elfutils-0.189-r4::gentoo
>>> Completed (2 of 7) dev-libs/elfutils-0.189-r4::gentoo
>>> Emerging (3 of 7) sys-libs/slang-2.3.3::gentoo
>>> Installing (3 of 7) sys-libs/slang-2.3.3::gentoo
>>> Completed (3 of 7) sys-libs/slang-2.3.3::gentoo
>>> Emerging (4 of 7) virtual/libelf-3-r1::gentoo
>>> Installing (4 of 7) virtual/libelf-3-r1::gentoo
>>> Completed (4 of 7) virtual/libelf-3-r1::gentoo
>>> Emerging (5 of 7) dev-libs/glib-2.76.4::gentoo
>>> Installing (5 of 7) dev-libs/glib-2.76.4::gentoo
>>> Completed (5 of 7) dev-libs/glib-2.76.4::gentoo
>>> Emerging (6 of 7) x11-misc/shared-mime-info-2.2::gentoo
>>> Installing (6 of 7) x11-misc/shared-mime-info-2.2::gentoo
>>> Completed (6 of 7) x11-misc/shared-mime-info-2.2::gentoo
>>> Emerging (7 of 7) app-misc/mc-4.8.29::gentoo
>>> Installing (7 of 7) app-misc/mc-4.8.29::gentoo
>>> Recording app-misc/mc in "world" favorites file...
>>> Completed (7 of 7) app-misc/mc-4.8.29::gentoo

 * Messages for package dev-libs/glib-2.76.4:

 * Unable to find kernel sources at /usr/src/linux
 * Unable to calculate Linux Kernel version for build, attempting to use running version
 * Unable to check for the following kernel config options due
 * to absence of any configured kernel sources or compiled
 * config:
 *  - INOTIFY_USER
 * You're on your own to make sure they are set if needed.

 * Messages for package app-misc/mc-4.8.29:

 * To enable exiting to latest working directory,
 * put this into your ~/.bashrc:
 * . /usr/libexec/mc/mc.sh

 * IMPORTANT: 14 news items need reading for repository 'gentoo'.
 * Use eselect news read to view new items.

finnix / #
Sestavení Grubu a stažení zdrojových souborů Linux kernelu
finnix / # emerge grub gentoo-sources --quiet
setlocale: unsupported locale setting
setlocale: unsupported locale setting

 * IMPORTANT: 14 news items need reading for repository 'gentoo'.
 * Use eselect news read to view new items.

>>> Verifying ebuild manifests
>>> Running pre-merge checks for app-text/mandoc-1.14.6
>>> Running pre-merge checks for media-libs/freetype-2.13.2
>>> Running pre-merge checks for sys-apps/pciutils-3.10.0
>>> Emerging (1 of 12) sys-apps/hwdata-0.375::gentoo
>>> Installing (1 of 12) sys-apps/hwdata-0.375::gentoo
>>> Completed (1 of 12) sys-apps/hwdata-0.375::gentoo
>>> Emerging (2 of 12) media-libs/libpng-1.6.40-r1::gentoo
>>> Installing (2 of 12) media-libs/libpng-1.6.40-r1::gentoo
>>> Completed (2 of 12) media-libs/libpng-1.6.40-r1::gentoo
>>> Emerging (3 of 12) app-text/mandoc-1.14.6::gentoo
>>> Installing (3 of 12) app-text/mandoc-1.14.6::gentoo
>>> Completed (3 of 12) app-text/mandoc-1.14.6::gentoo
>>> Emerging (4 of 12) virtual/libudev-251-r2::gentoo
>>> Installing (4 of 12) virtual/libudev-251-r2::gentoo
>>> Completed (4 of 12) virtual/libudev-251-r2::gentoo
>>> Emerging (5 of 12) media-libs/freetype-2.13.2::gentoo
>>> Installing (5 of 12) media-libs/freetype-2.13.2::gentoo
>>> Completed (5 of 12) media-libs/freetype-2.13.2::gentoo
>>> Emerging (6 of 12) sys-apps/pciutils-3.10.0::gentoo
>>> Installing (6 of 12) sys-apps/pciutils-3.10.0::gentoo
>>> Completed (6 of 12) sys-apps/pciutils-3.10.0::gentoo
>>> Emerging (7 of 12) sys-libs/efivar-38::gentoo
>>> Installing (7 of 12) sys-libs/efivar-38::gentoo
>>> Completed (7 of 12) sys-libs/efivar-38::gentoo
>>> Emerging (8 of 12) sys-boot/efibootmgr-18-r1::gentoo
>>> Installing (8 of 12) sys-boot/efibootmgr-18-r1::gentoo
>>> Completed (8 of 12) sys-boot/efibootmgr-18-r1::gentoo
>>> Emerging (9 of 12) sys-boot/grub-2.06-r9::gentoo
>>> Installing (9 of 12) sys-boot/grub-2.06-r9::gentoo
>>> Recording sys-boot/grub in "world" favorites file...
>>> Completed (9 of 12) sys-boot/grub-2.06-r9::gentoo
>>> Emerging (10 of 12) app-arch/cpio-2.14::gentoo
>>> Installing (10 of 12) app-arch/cpio-2.14::gentoo
>>> Completed (10 of 12) app-arch/cpio-2.14::gentoo
>>> Emerging (11 of 12) app-alternatives/cpio-0::gentoo
>>> Installing (11 of 12) app-alternatives/cpio-0::gentoo
>>> Completed (11 of 12) app-alternatives/cpio-0::gentoo
>>> Emerging (12 of 12) sys-kernel/gentoo-sources-6.1.57::gentoo
>>> Installing (12 of 12) sys-kernel/gentoo-sources-6.1.57::gentoo
>>> Recording sys-kernel/gentoo-sources in "world" favorites file...
>>> Completed (12 of 12) sys-kernel/gentoo-sources-6.1.57::gentoo

 * Messages for package sys-boot/grub-2.06-r9:

 * For information on how to configure GRUB2 please refer to the guide:
 *     https://wiki.gentoo.org/wiki/GRUB2_Quick_Start
 *
 * Install additional packages for optional runtime features:
 *   sys-boot/os-prober for detecting other operating systems (grub-mkconfig)
 *   dev-libs/libisoburn for creating rescue media (grub-mkrescue)
 *   sys-fs/mdadm for enabling RAID device detection

 * Messages for package app-alternatives/cpio-0:

 * This package will overwrite one or more files that may belong to other
 * packages (see list below).
 *
 * Detected file collision(s):
 *
 * 	/bin/cpio
 *
 * Searching all installed packages for file collisions...
 *
 * Press Ctrl-C to Stop
 *
 * None of the installed packages claim the file(s).
 *
 * Package 'app-alternatives/cpio-0' merged despite file collisions. If
 * necessary, refer to your elog messages for the whole content of the
 * above message.

 * Messages for package sys-kernel/gentoo-sources-6.1.57:

 * If you are upgrading from a previous kernel, you may be interested
 * in the following document:
 *   - General upgrade guide: https://wiki.gentoo.org/wiki/Kernel/Upgrade

 * IMPORTANT: 14 news items need reading for repository 'gentoo'.
 * Use eselect news read to view new items.

finnix / #

Jádro operačního sytému musím sestavit mimo příkaz emerge. Konfigurační soubor pro jádro již mám připraven, stáhnu si ho.

finnix / # cd /usr/src/
finnix /usr/src # ls -l
total 4
drwxr-xr-x 27 root root 4096 Nov 27 06:45 linux-6.1.57-gentoo
finnix /usr/src # ln -s linux-6.1.57-gentoo linux
finnix /usr/src # scp root@dizzy.chorche.net:/tmp/config-6.1.57-gentoo linux/.config
The authenticity of host 'dizzy.chorche.net (2a0e:5340:1:8000::2)' can't be established.
ED25519 key fingerprint is SHA256:ehiILsvzvfflBwrx9tcDX0Owrkly0NaIMwvmKz4BydE.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'dizzy.chorche.net' (ED25519) to the list of known hosts.
root@dizzy.chorche.net's password:
config-6.1.57-gentoo                                                                                                                                                                                                                                                                        100%  121KB   6.1MB/s   00:00
finnix /usr/src #
Instalace grubu
finnix /usr/src # grub-install --target=i386-pc /dev/sda
Installing for i386-pc platform.
Installation finished. No error reported.
finnix /usr/src #
Překlad a instalace jádra
finnix /usr/src # cd linux
finnix /usr/src/linux # make && make install && make modules_install && grub-mkconfig -o /boot/grub/grub.cfg
  SYNC    include/config/auto.conf
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/confdata.o
  HOSTCC  scripts/kconfig/expr.o
  LEX     scripts/kconfig/lexer.lex.c
  YACC    scripts/kconfig/parser.tab.[ch]
  HOSTCC  scripts/kconfig/lexer.lex.o
  HOSTCC  scripts/kconfig/menu.o
  HOSTCC  scripts/kconfig/parser.tab.o
  HOSTCC  scripts/kconfig/preprocess.o
  HOSTCC  scripts/kconfig/symbol.o
  HOSTCC  scripts/kconfig/util.o
....
# další výpis je hodně dlouhý
....
LD [M]  net/sched/sch_sfq.ko
  CC [M]  net/sched/sch_tbf.mod.o
  LD [M]  net/sched/sch_tbf.ko
  CC [M]  net/sched/sch_teql.mod.o
  LD [M]  net/sched/sch_teql.ko
  INSTALL /boot
  INSTALL /lib/modules/6.1.57-gentoo/kernel/drivers/net/tun.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/drivers/thermal/intel/x86_pkg_temp_thermal.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/fs/efivarfs/efivarfs.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/bridge/br_netfilter.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/bridge/netfilter/ebt_802_3.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/bridge/netfilter/ebt_among.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/bridge/netfilter/ebt_arp.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/bridge/netfilter/ebt_arpreply.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/bridge/netfilter/ebt_dnat.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/bridge/netfilter/ebt_ip.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/bridge/netfilter/ebt_ip6.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/bridge/netfilter/ebt_limit.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/bridge/netfilter/ebt_log.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/bridge/netfilter/ebt_mark.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/bridge/netfilter/ebt_mark_m.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/bridge/netfilter/ebt_nflog.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/bridge/netfilter/ebt_pkttype.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/bridge/netfilter/ebt_redirect.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/bridge/netfilter/ebt_snat.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/bridge/netfilter/ebt_stp.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/bridge/netfilter/ebt_vlan.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/bridge/netfilter/ebtable_broute.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/bridge/netfilter/ebtable_filter.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/bridge/netfilter/ebtable_nat.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/bridge/netfilter/ebtables.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/ipv4/netfilter/arp_tables.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/ipv4/netfilter/arpt_mangle.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/ipv4/netfilter/arptable_filter.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/ipv4/netfilter/ipt_CLUSTERIP.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/ipv4/netfilter/ipt_ECN.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/ipv4/netfilter/ipt_SYNPROXY.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/ipv4/netfilter/ipt_ah.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/ipv4/netfilter/ipt_rpfilter.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/ipv4/netfilter/iptable_nat.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/ipv4/netfilter/nf_dup_ipv4.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/ipv4/netfilter/nf_tproxy_ipv4.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/ipv6/netfilter/ip6t_NPT.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/ipv6/netfilter/ip6t_SYNPROXY.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/ipv6/netfilter/ip6t_ah.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/ipv6/netfilter/ip6t_eui64.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/ipv6/netfilter/ip6t_frag.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/ipv6/netfilter/ip6t_hbh.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/ipv6/netfilter/ip6t_mh.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/ipv6/netfilter/ip6t_rpfilter.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/ipv6/netfilter/ip6t_rt.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/ipv6/netfilter/ip6t_srh.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/ipv6/netfilter/ip6table_nat.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/ipv6/netfilter/ip6table_raw.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/ipv6/netfilter/nf_dup_ipv6.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/ipv6/netfilter/nf_tproxy_ipv6.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/nf_conncount.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/nf_log_syslog.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/nf_nat.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/nf_synproxy_core.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_AUDIT.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_CHECKSUM.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_CLASSIFY.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_DSCP.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_HL.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_HMARK.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_IDLETIMER.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_LOG.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_MASQUERADE.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_NETMAP.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_NFQUEUE.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_RATEEST.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_REDIRECT.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_TCPOPTSTRIP.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_TEE.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_TPROXY.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_addrtype.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_bpf.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_cgroup.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_cluster.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_comment.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_connbytes.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_connlabel.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_connlimit.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_connmark.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_cpu.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_dccp.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_devgroup.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_dscp.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_ecn.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_esp.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_hashlimit.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_helper.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_hl.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_ipcomp.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_iprange.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_l2tp.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_length.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_limit.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_mac.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_mark.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_multiport.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_nat.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_nfacct.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_owner.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_physdev.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_pkttype.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_quota.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_rateest.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_realm.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_recent.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_sctp.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_set.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_statistic.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_string.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_tcpmss.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_time.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/netfilter/xt_u32.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/sched/cls_basic.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/sched/cls_bpf.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/sched/cls_cgroup.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/sched/cls_flow.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/sched/cls_flower.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/sched/cls_fw.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/sched/cls_matchall.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/sched/cls_route.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/sched/cls_u32.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/sched/sch_cbq.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/sched/sch_choke.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/sched/sch_codel.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/sched/sch_drr.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/sched/sch_dsmark.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/sched/sch_fq.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/sched/sch_fq_codel.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/sched/sch_gred.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/sched/sch_hfsc.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/sched/sch_hhf.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/sched/sch_htb.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/sched/sch_ingress.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/sched/sch_mqprio.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/sched/sch_multiq.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/sched/sch_netem.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/sched/sch_pie.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/sched/sch_plug.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/sched/sch_prio.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/sched/sch_qfq.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/sched/sch_red.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/sched/sch_sfb.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/sched/sch_sfq.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/sched/sch_tbf.ko
  INSTALL /lib/modules/6.1.57-gentoo/kernel/net/sched/sch_teql.ko
  DEPMOD  /lib/modules/6.1.57-gentoo
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-6.1.57-gentoo
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
Adding boot menu entry for UEFI Firmware Settings ...
done

Závěrečné úpravy

Musím nastavit heslo pro roota:

finnix /usr/src/linux # passwd

You can now choose the new password or passphrase.

A valid password should be a mix of upper and lower case letters, digits, and
other characters.  You can use a password containing at least 7 characters
from all of these classes, or a password containing at least 8 characters
from just 3 of these 4 classes.
An upper case letter that begins the password and a digit that ends it do not
count towards the number of character classes used.

A passphrase should be of at least 3 words, 11 to 72 characters long, and
contain enough different characters.

Alternatively, if no one else can see your terminal now, you can pick this as
your password: "Force*floor4Metric".

Enter new password:
Re-type new password:
passwd: password updated successfully

Vyplnit /etc/fstab tak, aby se mi připojil po startu systému kořenový filesystém a incializoval swap.

/dev/sda1       /       ext4        noatime     0 1
/dev/sda2       none    swap        sw          0 0

A ještě vyplnit v /etc/conf.d/hostname jméno počítače:

hostname="rtr5"
Je hotovo, mohu vyskočit z chrootu a restartnout stroj.
finnix /usr/src/linux # (1)
exit
root@0:/mnt/gentoo# reboot (2)
1 Vyskočím z chrootu pomocí Ctrl+D
2 Restart stroje. Před novým bootem vytáhnu USB klíčenku.

Nový stroj je připraven a můžeme ho použít třeba na cvičení ze statického směrování pro další pracoviště.

Funguje to

Na novém stroji se síťová karta inicializuje sama, protože mám na své síti dhcp server pro automatické přidělování IPv4, stačí mi jenom nastavit sshd server

Editace /etc/ssh/sshd_config
#PermitRootLogin prohibit-password
PermitRootLogin yes (1)
1 Tímto povolím přihlašování pomocí hesla uživateli root, později nakopíruju veřejný klíč a přihlašování heslem zase zakážu.
Nastartuji sshd server
rtr5 ~ # /etc/init.d/sshd start
Nyní se mohu přihlásit z jiného počítače pomocí ssh jako root heslem
jirka@jirka-Precision-T3610:~$ ssh-keygen -f "/home/jirka/.ssh/known_hosts" -R "192.168.120.152" (1)
# Host 192.168.120.152 found: line 314
/home/jirka/.ssh/known_hosts updated.
Original contents retained as /home/jirka/.ssh/known_hosts.old
jirka@jirka-Precision-T3610:~$ ssh root@192.168.120.152
ssh: connect to host 192.168.120.152 port 22: Connection refused
jirka@jirka-Precision-T3610:~$ ssh root@192.168.120.152
The authenticity of host '192.168.120.152 (192.168.120.152)' can't be established.
ECDSA key fingerprint is SHA256:3QmT1uFWzZsJECAtBKWv2viE5cKD6EhWhIPiM6XbbX0.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '192.168.120.152' (ECDSA) to the list of known hosts.
Password:
rtr5 ~ #
rtr5 ~ # uname -a
Linux rtr5 6.1.57-gentoo #1 SMP PREEMPT_DYNAMIC Mon Nov 27 09:02:35 -00 2023 x86_64 Intel(R) Celeron(R) CPU N3160 @ 1.60GHz GenuineIntel GNU/Linux
rtr5 ~ #  (2)
1 Musím smazat ssh klíč hostitele, protože nově instalovaný stroj si ho vytvoří nový a bez smazání bych se nemohl přihlásit
2 Jsem tam.

Další práce je v konfiguraci nového systému, doinstalování dalších programů, ale to až někdy příště.

Zdroje a odkazy