.. vim: set noexpandtab fileencoding=utf-8 nomodified wrap textwidth=200 foldmethod=marker foldcolumn=4 ruler showcmd lcs=tab\:|- list: :date: 2020.05.10 05:43:19 :tags: Cobra-Mk3,gentoo :summary: Cobra-Mk3 - instalace :authors: Gilhad :title: 2020.05.10 - Cobra-Mk3 - instalace %HEADER% UEFI ================================================================================ - UEFI BIOS - DOCP - Profile #1 (RAM=3600 MHz) - CSM - Compatibility Support Module - enabled, UEFI only, no network - BOOT - Fast - disabled - a pár podobných Boot ================================================================================ Boot z Gentoo USB .. code:: passwd /etc/init.d/sshd start /etc/init.d/ntp-client start ----- Vzdálená instalace - příprava disku a stažení základního systému ================================================================================ Partišny -------------------------------------------------------------------------------- Login z venku a podle ``_ GPT určitě, budu používat UEFI pro spoustu systémů /dev/nvme0n1 tady bude nový systém, (ADATA /dev/sda je instalační USB flash) .. code:: livecd ~ # parted -l ... Error: /dev/nvme0n1: unrecognised disk label Model: Unknown (unknown) Disk /dev/nvme0n1: 1000GB Sector size (logical/physical): 512B/512B Partition Table: unknown Disk Flags: livecd ~ # parted -a optimal /dev/nvme0n1 GNU Parted 3.2 Using /dev/nvme0n1 Welcome to GNU Parted! Type 'help' to view a list of commands. (parted) mklabel gpt (parted) q Parted je nějaký komplikovaný, fakt nechci počítat sektory ručně. Použiju raději ``fdisk`` (což jsem asi měl udělat hned) .. code:: livecd ~ # fdisk /dev/nvme0n1 Welcome to fdisk (util-linux 2.33.2). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. Command (m for help): g Created a new GPT disklabel (GUID: 37A33C18-76C9-8C46-9708-385EE791F953). Command (m for help): n Partition number (1-128, default 1): First sector (2048-1953525134, default 2048): Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-1953525134, default 1953525134): +100M Created a new partition 1 of type 'Linux filesystem' and of size 100 MiB. Command (m for help): t Selected partition 1 Partition type (type L to list all types): 1 Changed type of partition 'Linux filesystem' to 'EFI System'. Command (m for help): n Partition number (2-128, default 2): First sector (206848-1953525134, default 206848): Last sector, +/-sectors or +/-size{K,M,G,T,P} (206848-1953525134, default 1953525134): +50G Created a new partition 2 of type 'Linux filesystem' and of size 50 GiB. Command (m for help): t Partition number (1,2, default 2): Partition type (type L to list all types): 19 Changed type of partition 'Linux filesystem' to 'Linux swap'. Command (m for help): n Partition number (3-128, default 3): First sector (105064448-1953525134, default 105064448): Last sector, +/-sectors or +/-size{K,M,G,T,P} (105064448-1953525134, default 1953525134): +50G Created a new partition 3 of type 'Linux filesystem' and of size 50 GiB. Command (m for help): n Partition number (4-128, default 4): First sector (209922048-1953525134, default 209922048): Last sector, +/-sectors or +/-size{K,M,G,T,P} (209922048-1953525134, default 1953525134): +50G Created a new partition 4 of type 'Linux filesystem' and of size 50 GiB. Command (m for help): p Disk /dev/nvme0n1: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors Disk model: Viper M.2 VP4100 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: gpt Disk identifier: 37A33C18-76C9-8C46-9708-385EE791F953 Device Start End Sectors Size Type /dev/nvme0n1p1 2048 206847 204800 100M EFI System /dev/nvme0n1p2 206848 105064447 104857600 50G Linux swap /dev/nvme0n1p3 105064448 209922047 104857600 50G Linux filesystem /dev/nvme0n1p4 209922048 314779647 104857600 50G Linux filesystem Command (m for help): w The partition table has been altered. Calling ioctl() to re-read partition table. Syncing disks. Takže mám potřebné partišny, teď je ješte pojmenuju v ``partedu`` z CLI (NVM-SYSTEM slouží pro obecnou správu disku, NVM-SYSBCK je jeho záložní kopie - takže bootem z jednoho mám druhý plně k dispozici pro zkopírování na nově vytvářenou instalaci, bez všech pseudosystémů a otevřených souborů) .. code:: livecd ~ # parted /dev/nvme0n1 name 1 EFIboot livecd ~ # parted /dev/nvme0n1 name 2 SWAP livecd ~ # parted /dev/nvme0n1 name 3 NVM-SYSTEM livecd ~ # parted /dev/nvme0n1 name 4 NVM-SYSBCK livecd ~ # parted /dev/nvme0n1 print Model: Unknown (unknown) Disk /dev/nvme0n1: 1000GB Sector size (logical/physical): 512B/512B Partition Table: gpt Disk Flags: Number Start End Size File system Name Flags 1 1049kB 106MB 105MB EFIboot boot, esp 2 106MB 53.8GB 53.7GB SWAP 3 53.8GB 107GB 53.7GB NVM-SYSTEM 4 107GB 161GB 53.7GB NVM-SYSBCK Formátování -------------------------------------------------------------------------------- Otázka na tělo, které fs potřebujeme? U nekritických bych volil ``ext4``, ale je tam problém, když vypadne napájení a data jsou ještě v cache (a ext4 je tam drží "dlouho" - navíc rozbíjí ideu ``jurnálu`` a ``ordered`` z ``ext3``, kdy soubor byl buď ve staré nebo nové verzi, ale ne "něco mezi tím" = ``mv fname.new fname`` už není atomické, když v dohledné době vypadne napájení.) Na druhou stranu je ext4 rychlejší, míň fragmentuje a míň "vyklepává na disk", protože víc cachuje. Na serveru (a hlavně na boxech) bych volil ``ext3 a ordered``, na domácím počítači asi risknu ``ext4``. .. code:: livecd ~ # mkfs.fat -F 32 /dev/nvme0n1p1 mkfs.fat 4.1 (2017.01.24) livecd ~ # mkswap /dev/nvme0n1p2 Setting up swapspace version 1, size = 50 GiB (53687087104 bytes) no label, UUID=c3e1c088-ee23-450f-b897-2886a370cad2 livecd ~ # mkfs.ext4 -L NVM-SYSTEM /dev/nvme0n1p3 mke2fs 1.45.5 (07-Jan-2020) Discarding device blocks: done Creating filesystem with 13107200 4k blocks and 3276800 inodes Filesystem UUID: c82837c8-4642-43ea-b148-072f49ec39fe Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624, 11239424 Allocating group tables: done Writing inode tables: done Creating journal (65536 blocks): done Writing superblocks and filesystem accounting information: done livecd ~ # mkfs.ext4 -L NVM-SYSBCK /dev/nvme0n1p4 mke2fs 1.45.5 (07-Jan-2020) Discarding device blocks: done Creating filesystem with 13107200 4k blocks and 3276800 inodes Filesystem UUID: edb20f6d-0fdb-4733-b52b-561a961bfefe Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624, 11239424 Allocating group tables: done Writing inode tables: done Creating journal (65536 blocks): done Writing superblocks and filesystem accounting information: done livecd ~ # swapon /dev/nvme0n1p2 livecd ~ # free -h total used free shared buff/cache available Mem: 31Gi 128Mi 30Gi 62Mi 290Mi 30Gi Swap: 49Gi 0B 49Gi livecd ~ # parted /dev/nvme0n1 print Model: Unknown (unknown) Disk /dev/nvme0n1: 1000GB Sector size (logical/physical): 512B/512B Partition Table: gpt Disk Flags: Number Start End Size File system Name Flags 1 1049kB 106MB 105MB fat32 EFIboot boot, esp 2 106MB 53.8GB 53.7GB linux-swap(v1) SWAP 3 53.8GB 107GB 53.7GB ext3 NVM-SYSTEM 4 107GB 161GB 53.7GB ext3 NVM-SYSBCK Mounting the root partition -------------------------------------------------------------------------------- .. code:: livecd ~ # mount /dev/nvme0n1p3 /mnt/gentoo/ Downloading the stage tarball -------------------------------------------------------------------------------- .. code:: livecd ~ # cd /mnt/gentoo livecd /mnt/gentoo # links https://www.gentoo.org/downloads/mirrors/ ### or livecd /mnt/gentoo # wget https://bouncer.gentoo.org/fetch/root/all/releases/amd64/autobuilds/20200422T214502Z/stage3-amd64-20200422T214502Z.tar.xz ### or livecd /mnt/gentoo # wget https://mirror.bytemark.co.uk/gentoo//releases/amd64/autobuilds/20200422T214502Z/stage3-amd64-20200422T214502Z.tar.xz livecd /mnt/gentoo # wget https://mirror.bytemark.co.uk/gentoo//releases/amd64/autobuilds/20200422T214502Z/stage3-amd64-20200422T214502Z.tar.xz.CONTENTS livecd /mnt/gentoo # wget https://mirror.bytemark.co.uk/gentoo//releases/amd64/autobuilds/20200422T214502Z/stage3-amd64-20200422T214502Z.tar.xz.DIGESTS livecd /mnt/gentoo # wget https://mirror.bytemark.co.uk/gentoo//releases/amd64/autobuilds/20200422T214502Z/stage3-amd64-20200422T214502Z.tar.xz.DIGESTS.asc ### anyway: livecd /mnt/gentoo # sha512sum stage3-amd64-*.tar.xz 637f43fac14de5b301ddda84de1ee095bbdb45002c9486f7b9eb37028f28ad181f5521b0e960b1b5c07ba527f7707f1e2894feb1f3e2ad03779e44d772aeffc8 stage3-amd64-20200422T214502Z.tar.xz livecd /mnt/gentoo # grep 637f43fac14de5b301ddda84de1ee095bbdb45002c9486f7b9eb37028f28ad181f5521b0e960b1b5c07ba527f7707f1e2894feb1f3e2ad03779e44d772aeffc8 stage3-amd64*.DIGESTS 637f43fac14de5b301ddda84de1ee095bbdb45002c9486f7b9eb37028f28ad181f5521b0e960b1b5c07ba527f7707f1e2894feb1f3e2ad03779e44d772aeffc8 stage3-amd64-20200422T214502Z.tar.xz ### or openssl dgst -r -whirlpool stage3-amd64-*.tar.xz ### dtto stage3-amd64-*.tar.xz.CONTENTS ### gpg --verify stage3-amd64-*.xz{.DIGESTS.asc,} livecd /mnt/gentoo # tar xpf stage3-*.tar.xz --xattrs-include='*.*' --numeric-owner Configuring compile options !!! |bomb| ------------------------------------------------------------------------------- Předně využiju možnosti podadresářů v ``/etcp/portage`` a to i pro ``make.conf``, následně budu dávat konfigurace jednotlivých "hlavních programů" do souborů s odpovídajícími jmény. Konfigurace si dám sem už předem, aby se různé ``USE`` a podobně neměnily průběžně a pak nebyly různé verze programů a knihoven a nemuselo se toho kompilovat pořád dokola - stejně to nakonec projedu s ``--empty-tree`` pro jistotu, ale i tak si nastavím spoustu věcí "do foroty" .. code:: livecd /mnt/gentoo # mv etc/portage/make.conf etc/portage/00-make.conf livecd /mnt/gentoo # mkdir etc/portage/make.conf livecd /mnt/gentoo # mv etc/portage/00-make.conf etc/portage/make.conf livecd /mnt/gentoo # cat etc/portage/make.conf/00-make.conf # These settings were set by the catalyst build script that automatically # built this stage. # Please consult /usr/share/portage/config/make.conf.example for a more # detailed example. COMMON_FLAGS="-O2 -pipe" CFLAGS="${COMMON_FLAGS}" CXXFLAGS="${COMMON_FLAGS}" FCFLAGS="${COMMON_FLAGS}" FFLAGS="${COMMON_FLAGS}" # NOTE: This stage was built with the bindist Use flag enabled PORTDIR="/var/db/repos/gentoo" DISTDIR="/var/cache/distfiles" PKGDIR="/var/cache/binpkgs" # This sets the language of build output to English. # Please keep this setting intact when reporting bugs. LC_MESSAGES=C ``PORTDIR`` a spol vedou jinam, než jsem byl zvyklý, ale pro víc overlayů to dává lepší smysl. Jenom přidáme ``MAKEOPTS`` (mám 24 jader, dám aspoň 26, ať jsou nějaká navíc, když se čeká na I/O, zámky a podobně). .. code:: livecd /mnt/gentoo # echo 'MAKEOPTS="-j26 "'>>etc/portage/make.conf/00-make.conf livecd /mnt/gentoo # echo 'FEATURES="${FEATURES} parallel-fetch"'>>etc/portage/make.conf/00-make.conf Selecting mirrors ------------------------------------------------------------------------------ .. code:: livecd /mnt/gentoo # mirrorselect -i -o >> /mnt/gentoo/etc/portage/make.conf/01-mirrors ### or livecd /mnt/gentoo # echo 'GENTOO_MIRRORS="http://ftp.fi.muni.cz/pub/linux/gentoo/ http://gentoo.ussg.indiana.edu/ http://gentoo.cs.utah.edu/" >> /mnt/gentoo/etc/portage/make.conf/01-mirrors Oblibene USE ----------------------------------------------------------------------------- .. code:: cat >>/etc/portage/make.conf/02-USE <>/etc/portage/make.conf/debianutils < /etc/timezone emerge --config sys-libs/timezone-data echo "en_US.UTF-8 UTF-8" >>/etc/locale.gen echo "cs_CZ.UTF-8 UTF-8" >>/etc/locale.gen locale-gen echo >>/etc/env.d/02locale 'LANG="C"' echo >>/etc/env.d/90gilhad_xsession 'XSESSION="fluxbox"' echo >>/etc/env.d/02gilhad_editor 'EDITOR=vim' echo >>/etc/env.d/02gilhad_locale 'LC_CTYPE=cs_CZ.utf8' env-update && source /etc/profile && export PS1="(chroot) ${PS1}" Kernel ================================================================================ GPU ---------------------------------------------------------------------- ``_ a v ``/etc/portage/savedconfig/sys-kernel/linux-firmware-20200421`` jde nastavit, co se má stahovat .. code:: mkdir /etc/portage/package.license echo -e "sys-kernel/linux-firmware\tlinux-fw-redistributable no-source-code" >>/etc/portage/package.license/GPU emerge -avq sys-kernel/linux-firmware * Messages for package sys-kernel/linux-firmware-20200421: * Your configuration for sys-kernel/linux-firmware-20200421 has been saved in * "/etc/portage/savedconfig/sys-kernel/linux-firmware-20200421" for your editing pleasure. * You can edit these files by hand and remerge this package with * USE=savedconfig to customise the configuration. * You can rename this file/directory to one of the following for * its configuration to apply to multiple versions: * ${PORTAGE_CONFIGROOT}/etc/portage/savedconfig/ * [${CTARGET}|${CHOST}|""]/${CATEGORY}/[${PF}|${P}|${PN}] * If you are only interested in particular firmware files, edit the saved * configfile and remove those that you do not want. echo "x11-drivers/xf86-video-amdgpu udev" >> /etc/portage/package.use/GPU echo "x11-libs/libdrm video_cards_radeon" >> /etc/portage/package.use/GPU echo 'VIDEO_CARDS="amdgpu radeonsi"' >>/etc/portage/make.conf/GPU UEFI --------------------------------------------------------------------- ``_ potřebuje ``NLS ISO 8859-1`` a **vypnutý** ``EFI mixed-mode support`` .. code:: emerge -avq sys-boot/efibootmgr mount | grep efivars # must be RW otherwise try somthing like # mount -o remount,rw -t efivarfs efivarfs /sys/firmware/efi/efivars efibootmgr -v # just list entries for fun :) kernel ---------------------------------------------------------------------- .. code:: emerge --ask --verbose --update --deep --newuse -q --load-average --jobs -N sys-kernel/gentoo-sources sys-apps/pciutils lspci ls -al /usr/src/ cd /usr/src/linux make menuconfig .. Nastavení kernelu Sensor driver: X570 boards (no WMI interface - use nct6775 driver instead) (``root=/dev/nvme0n1p3``) Built-in kernel command string - podle skutecne partisny .. code:: Processor type and features ---> [*] Symmetric multi-processing support [ ] Support for extended (non-PC) x86 platforms [*] AMD ACPI2Platform devices support Processor family (Generic-x86-64) [*] Machine Check / overheating reporting [ ] Intel MCE Features [*] AMD MCE Features [*] CPU microcode loading support [ ] Intel microcode loading support [*] AMD microcode loading support Performance monitoring ---> < > Intel *** <*> AMD Processor Power Reporting Mechanism [*] Multi-core scheduler support [ ] Numa Memory Allocation and Scheduler Support -*- MTRR (Memory Type Range Register) support [*] EFI runtime service support [*] EFI stub support [ ] EFI mixed-mode support [*] Built-in kernel command line (root=/dev/nvme0n1p3 net.ifnames=0 vga=ask) Built-in kernel command string Power management and ACPI options ---> CPU Frequency scaling ---> Default CPUFreq governor (ondemand) ---> <*> ACPI Processor P-States driver <*> AMD frequency sensitivity feedback powersave bias Firmware Drivers ---> EFI (Extensible Firmware Interface) Support ---> <*> EFI Variable Support via sysfs Binary Emulations ---> [*] IA32 Emulation Device Drivers ---> NVME Support ---> <*> NVM Express block device I2C support ---> <*> I2C device interface I2C Hardware Bus support ---> AMD *** < > Intel *** Graphics support ---> <*> Direct Rendering Manager (XFree86 4.1.0 and higher DRI support) ---> [*] Enable legacy fbdev support for your modesetting driver < > ATI Radeon <*> AMD GPU [ ] Enable amdgpu support for SI parts [ ] Enable amdgpu support for CIK parts ACP (Audio CoProcessor) Configuration ---> [ ] Enable AMD Audio CoProcessor IP support Display Engine Configuration ---> [*] AMD DC - Enable new display engine [*] DCN 2.0 family < > Intel 8xx/9xx/G3x/G4x/HD Graphics Console display driver support ---> (160) Initial number of console screen columns (def 80) (64) Initial number of console screen rows (def 25) <*> Sound card support ---> <*> Advanced Linux Sound Architecture ---> HD-Audio ---> <*> Build Realtek HD-audio codec support (2048) Pre-allocated buffer size for HD-audio driver (def 64) [ ] USB sound devices ---- [ ] PCMCIA sound devices ---- < > ALSA for SoC audio support ---- [ ] X86 sound devices ---- Generic Driver Options ---> [*] Maintain a devtmpfs filesystem to mount at /dev [*] Automount devtmpfs at /dev, after the kernel mounted the rootfs Firmware loader ---> Build named firmware blobs into the kernel binary amdgpu/navi10_asd.bin amdgpu/navi10_ce.bin amdgpu/navi10_gpu_info.bin amdgpu/navi10_me.bin amdgpu/navi10_mec2.bin amdgpu/navi10_mec.bin amdgpu/navi10_pfp.bin amdgpu/navi10_rlc.bin amdgpu/navi10_sdma1.bin amdgpu/navi10_sdma.bin amdgpu/navi10_smc.bin amdgpu/navi10_sos.bin amdgpu/navi10_vcn.bin (/lib/firmware) Firmware blobs root directory Hardware Monitoring support ---> <*> AMD Family 10h+ temperature sensor <*> Nuvoton NCT6775F and compatibles Input device support ---> <*> Mouse interface <*> Joystick interface HID support ---> -*- HID bus support <*> Generic HID driver USB HID support ---> <*> USB HID transport layer [*] USB support ---> <*> xHCI HCD (USB 3.0) support <*> EHCI HCD (USB 2.0) support <*> OHCI HCD (USB 1.1) support [*] IOMMU Hardware Support ---> [*] AMD IOMMU support <*> AMD IOMMU Version 2 driver [ ] X86 Platform Specific Device Drivers ---- -*- Enable the block layer ---> Partition Types ---> [*] Advanced partition selection [*] EFI GUID Partition support File systems ---> Pseudo Filesystems ---> [*] /proc file system support [*] Tmpfs virtual memory file system support (former shm fs) Native Language support ---> [*] NLS ISO 8859-1 (Latin 1; Western European Languages) Otázka na tělo, které fs potřebujeme? (``ext3``/``ext4`` viz `Formátování`_. ) Plus co navíc? ``VFAT`` pro USB (a jiné diskety), ``NTFS`` je potřeba dělat přez ``FUSE`` pomocí ``sys-fs/ntfs3g`` viz ``_ .. code:: File systems ---> < > Second extended fs support < > The Extended 3 (ext3) filesystem <*> The Extended 4 (ext4) filesystem [*] Use ext4 for ext2 file systems [*] Ext4 POSIX Access Control Lists [*] Ext4 Security Labels [ ] Ext4 debugging support < > Reiserfs support < > JFS filesystem support < > XFS filesystem support < > Btrfs filesystem support <*> FUSE (Filesystem in Userspace) support DOS/FAT/NT Filesystems ---> <*> MSDOS fs support <*> VFAT (Windows-95) fs support < > NTFS file system support CD-ROM/DVD Filesystems ---> <*> UDF file system support AMD microcode ------------------------------------------------------------------------- potřebuje ``sys-kernel/linux-firmware`` .. code:: emerge --ask sys-kernel/linux-firmware grep -F -m 1 "cpu family" /proc/cpuinfo|uniq ### cpu family : 23 == 0x17 == 17h Processor type and features ---> [*] CPU microcode loading support [ ] Intel microcode patch loading support [*] AMD microcode patch loading support Device Drivers ---> Generic Driver Options (amd-ucode/microcode_amd_fam17h.bin) External firmware blobs to build into the kernel binary (/lib/firmware) Firmware blobs root directory Mounting the boot partition (pro kernel) -------------------------------------------------------------------------- .. code:: (chroot) livecd / # mount /dev/nvme0n1p1 /boot/ (chroot) livecd / # df -h /boot Filesystem Size Used Avail Use% Mounted on /dev/nvme0n1p1 99M 512 99M 1% /boot Compiling kernel -------------------------------------------------------------------------- .. code:: make -j 26 make modules_install mkdir -p /boot/EFI/'Gentoo-NVM-SYSTEM' # or any other name under /boot/EFI cp /usr/src/linux/arch/x86/boot/bzImage /boot/EFI/'Gentoo-NVM-SYSTEM'/bzImage.efi efibootmgr -c -L "Gentoo-NVM-SYSTEM" -l '\EFI\Gentoo-NVM-SYSTEM\bzImage.efi' NTFS ------------------------------------------------------------------------- .. code:: emerge --ask sys-fs/ntfs3g chmod a+x /usr/bin/ntfs-3g vim, mc, gpm ------------------------------------------------------------------------ .. code:: emerge -avq --jobs --load-average --newuse -DuN vim app-misc/mc sys-libs/gpm rc-update add gpm default .. code:: ################################################################################ # cat .mc/ini ################################################################################ [Misc] timeformat_recent=%d.%m. %H:%M timeformat_old=%d.%m.%Y %H:%M ### or timeformat_recent= %m.%d %H:%M timeformat_old=%Y.%m.%d %H:%M fstab a spol ------------------------------------------------------------------------ .. code:: vim /etc/fstab ### /dev/nvme0n1p3 / ext4 noatime 0 1 ### /dev/nvme0n1p2 none swap sw 0 0 for i in 1 2 3 4 5 6 7 8 9 ; do mkdir -p /mnt/nvme0n1/$i; >/mnt/nvme0n1/$i/.keep ; echo -e >>/etc/fstab "/dev/nvme0n1p$i\t/mnt/nvme0n1/$i\tauto\tnoauto,noatime\t0 0"; done for i in 0 1 2 3 4 5 6 7 8 9 ; do mkdir -p /mnt/nvme0n1/1$i; >/mnt/nvme0n1/1$i/.keep ; echo -e >>/etc/fstab "/dev/nvme0n1p1$i\t/mnt/nvme0n1/1$i\tauto\tnoauto,noatime\t0 0"; done vim /etc/conf.d/hostname ### hostname="cobra-mk3" echo 'config_eth0="dhcp"' >>/etc/conf.d/net cd /etc/init.d ln -s net.lo net.eth0 rc-update add net.eth0 default rc-update add sshd default vim /etc/hosts ### 127.0.0.1 localhost cobra-mk3 cobra-mk3.iam.god ### 10.0.1.3 merle merle.iam.god vim /etc/inittab ### --noclear za kazdy terminal passwd #vim /etc/rc.conf #vim /etc/conf.d/keymaps #vim /etc/conf.d/hwclock emerge -avq --jobs --load-average app-admin/sysklogd sys-process/cronie sys-apps/mlocate net-misc/dhcpcd net-misc/ntp # net-misc/ntpclient rc-update add sysklogd default rc-update add cronie default rc-update add ntp-client default updatedb ssh ----------------------------------------------------------------------- .. code:: mkdir ~/.ssh cd ~/.ssh scp gilhad@merle:root@cobra-mk3.key.pub . cat root\@cobra-mk3.key.pub >>authorized_keys mkdir ids cat >>config </mnt/sda/$i/.keep ; done mkdir -p /mnt/nvme0n1/{1,2,3,4,5,6,7,8,9,this} for i in 1 2 3 4 5 6 7 8 9 this; do >/mnt/nvme0n1/$i/.keep ; done .. code:: cp /usr/src/linux/arch/x86/boot/bzImage /boot/bzImage.efi mount /dev/sda1 /boot mkdir -p /boot/EFI/'Gentoo-NVM-SYSTEM' cp /usr/src/linux/arch/x86/boot/bzImage /boot/EFI/'Gentoo-NVM-SYSTEM'/bzImage.efi efibootmgr -c -L "Gentoo-NVM-SYSTEM" -l '\EFI\Gentoo-NVM-SYSTEM\bzImage.efi' reboot **OK je to blbý jak facka na břicho, ale bootujeme bez flešky !!!** FINALIZACE systému ================================================================================ reboot z flašky a zkopíruju si výsledky .. code:: fdisk /dev/sda # sda2 +10G Linux (default) # sda3 +10G Linux (default) mkfs.ext4 -L SDA2-SYSTEM /dev/sda2 # odsud by melo jit bootovat mkfs.ext4 -L SDA-BCK-NVM-SYSTEM /dev/sda3 # 1:1 kopie SYSTEM z NVMe/SYSTEM mkdir /mnt/gentoo2 mkdir /mnt/gentoo3 mkdir /mnt/gentoo4 mount /dev/nvme0n1p3 /mnt/gentoo/ mount /dev/nvme0n1p4 /mnt/gentoo2/ mount /dev/sda2 /mnt/gentoo3 mount /dev/sda3 /mnt/gentoo4 rsync -ra /mnt/gentoo/* /mnt/gentoo2 rsync -ra /mnt/gentoo/* /mnt/gentoo3 rsync -ra /mnt/gentoo/* /mnt/gentoo4 umount /mnt/gentoo/ umount /mnt/gentoo2/ umount /mnt/gentoo3/ umount /mnt/gentoo4/ Provoznění bootu z HDD -------------------------------------------------------------------------------- Chrootnu do ``/dev/sda2``, v kernelu změním root=/dev/sda2, kernel přeložím a vrazím do /boot/Gentoo-SDA2 (a obdobne pro Gentoo-NVM-SYSBCK) .. code:: mount /dev/sda2 /mnt/gentoo mount --types proc /proc /mnt/gentoo/proc mount --rbind /sys /mnt/gentoo/sys mount --rbind /dev /mnt/gentoo/dev chroot /mnt/gentoo /bin/bash source /etc/profile export PS1="(chroot) ${PS1}" df -h / mount /dev/sda1 /boot vim /etc/fstab # /dev/sda2 / ext4 noatime 0 1 cd /usr/src/linux make menuconfig .. code:: Processor type and features ---> [*] Built-in kernel command line (root=/dev/sda2 net.ifnames=0 vga=ask) Built-in kernel command string .. code:: make -j 26 make modules_install mkdir -p /boot/EFI/'Gentoo-SDA2' # or any other name under /boot/EFI cp /usr/src/linux/arch/x86/boot/bzImage /boot/EFI/'Gentoo-SDA2'/bzImage.efi efibootmgr -c -L "Gentoo-SDA2" -l '\EFI\Gentoo-SDA2\bzImage.efi' umount /boot exit cd umount -l /mnt/gentoo/dev{/shm,/pts,} umount -R /mnt/gentoo reboot Next steps ================================================================================ Další potřebnosti ------------------------------------------------------------------------------- spoustu programů potřebuju mít k ruce, tady je stáhnu na jednu hromadu (a pak si dám předchozí reistalační kolečko ještě jednou - a sjednotím i názvy disků, systémů a spol. .. code:: emerge -avqN sys-process/iotop net-fs/sshfs sys-apps/hdparm Nastavení EFI, když ho něco zboří ------------------------------------------------------------------------------ .. code:: ################################################################################ # cat ebm ################################################################################ #!/bin/bash -x efibootmgr -B -b 0 efibootmgr -B -b 1 efibootmgr -B -b 2 mount /dev/nvme0n1p1 /boot/ efibootmgr -b 0 -c -L "NVM-Gentoo-NVM-SYSTEM" -l '\EFI\Gentoo-NVM-SYSTEM\bzImage.efi' -d /dev/nvme0n1p1 efibootmgr -b 1 -c -L "NVM-Gentoo-SDA2" -l '\EFI\Gentoo-SDA2\bzImage.efi' -d /dev/nvme0n1p1 efibootmgr -b 2 -c -L "NVM-Gentoo-NVM-SYSBCK" -l '\EFI\Gentoo-NVM-SYSBCK\bzImage.efi' -d /dev/nvme0n1p1 umount /boot mount /dev/sda1 /boot/ if ( df /boot | grep -q /dev/sda1 ) ; then echo SDA efibootmgr -B -b 3 efibootmgr -B -b 4 efibootmgr -B -b 5 efibootmgr -c -L "SDA-Gentoo-NVM-SYSTEM" -l '\EFI\Gentoo-NVM-SYSTEM\bzImage.efi' -d/dev/sda1 efibootmgr -c -L "SDA-Gentoo-SDA2" -l '\EFI\Gentoo-SDA2\bzImage.efi' -d/dev/sda1 efibootmgr -c -L "SDA-Gentoo-NVM-SYSBCK" -l '\EFI\Gentoo-NVM-SYSBCK\bzImage.efi' -d/dev/sda1 fi umount /boot efibootmgr -o 0,1,2 efibootmgr -D Pro testování emerge: ------------------------------------------------------------------------------ .. code:: ################################################################################ # cat /etc/portage/make.conf/00-make.conf ################################################################################ .......... ##### Alt++ settings MAKEOPTS="-j24 -l" EMERGE_DEFAULT_OPTS="--jobs --load-average " PORTAGE_NICENESS=19 #PORTAGE_IONICE_COMMAND="ionice -c 3 -p \${PID}" FEATURES="${FEATURES} -merge-sync parallel-fetch -parallel-install -ebuild-locks" ################################################################################ # cat to_build.sh ################################################################################ #!/bin/bash emerge -pq -e "$@" |sed "s/.*] */ =/"|tr -d \\r\\n ################################################################################ # cat timetest ################################################################################ time emerge -vqe1 --nodeps `./to_build.sh @world` ################################################################################ # cat load_check.sh ################################################################################ #!/bin/bash SL=10 if [ $# == 1 ] ; then SL=$1 ; fi echo " total used free shared buff/cache available total used free load average" while true; do (free -h|grep -v total;uptime |sed "s/.*average:/ == /")|tr \\r\\n " ";echo;sleep $SL;done BRANCH: TeachMePCB comp ================================================================================ už nutně potřebuju počítač pro TeachMePCB, kde jsem asi dva týdny pozadu a Ryoga je zoufalost, takze zkopnu ``NVM-Gentoo-NVM-SYSBCK`` a celkem neřízeně a nedokumentovaně ho použiju `<2020.05.15-cobra-mk3-TeachMePCB.html>`_ app-portage/cpuid2cpuflags ================================================================================ .. code:: emerge -avq app-portage/cpuid2cpuflags cpuid2cpuflags