Cobra MK III
Můj nový počítač
2025.07.08-Ryoga.2025
2025.07.08 05:25:41 HW SW Ryoga gentoo systems Gilhad

1   2025.07.08-Ryoga.2025

Měl jsem tam (asi) TeachMePCB a baterka asi umřela a EFI si nepamatovalo nic, tak nebootovalo. Nabootoval jsem z instalačky gentoo, našel řadek s efibootmgr a aplikoval ho a zase to šlo. Ale systém je neupdatovatelný a nemám tam nic, o čem bych věděl, že to chci, takže znova od začátku.

Chci to na chatičku, protože Mahoro už nezvládá KiCad a tohle tam může sedět nafurt.

cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 76
model name      : Intel(R) Celeron(R) CPU  N3000  @ 1.04GHz
stepping        : 3
microcode       : 0x34c
cpu MHz         : 480.001
cache size      : 1024 KB
physical id     : 0
siblings        : 2
core id         : 0
cpu cores       : 2
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 11
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology tsc_reliable nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes rdrand lahf_lm 3dnowprefetch epb pti tpr_shadow flexpriority ept vpid tsc_adjust smep erms dtherm ida arat vnmi
vmx flags       : vnmi preemption_timer invvpid ept_x_only flexpriority tsc_offset vtpr mtf vapic ept vpid unrestricted_guest
bugs            : cpu_meltdown spectre_v1 spectre_v2 mds msbds_only mmio_unknown
bogomips        : 2080.66
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

processor       : 1 (to samé, víc jich není)
free -h
               total        used        free      shared  buff/cache   available
Mem:           1.8Gi       263Mi       1.6Gi       1.5Mi       157Mi       1.6Gi
Swap:             0B          0B          0B
 fdisk /dev/sda -l
Disk /dev/sda: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: ST1000LM048-2E71
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 52097823-C0A4-4234-AC00-2AA470A7BE31

Device         Start       End   Sectors  Size Type
/dev/sda1       2048   2099199   2097152    1G EFI System
/dev/sda2    2099200 421529599 419430400  200G Linux filesystem
/dev/sda3  421529600 840959999 419430400  200G Linux filesystem
/dev/sda4  840960000 882903039  41943040   20G Linux swap
parted /dev/sda name 1 EFI-boot
parted /dev/sda name 2 Ryoga2025
parted /dev/sda name 3 Ryoga2025bck
parted /dev/sda name 4 SWAP


mkfs.fat -F 32 /dev/sda1 -n EFI
mkswap /dev/sda4
mkfs.ext4 -L Ryoga2025 /dev/sda2
mkfs.ext4 -L Ryoga2025bck /dev/sda3

swapon /dev/sda4
mount /dev/sda2 /mnt/gentoo
cd /mnt/gentoo/
>~Ryoga.2025
wget https://mirror.bytemark.co.uk/gentoo/releases/amd64/autobuilds/current-stage3-amd64-openrc/stage3-amd64-openrc-20250126T154834Z.tar.xz

tar xpf stage3-*.tar.xz --xattrs-include='*.*' --numeric-owner
mv etc/portage/make.conf etc/portage/00-make.conf
mkdir etc/portage/make.conf
mv etc/portage/00-make.conf etc/portage/make.conf

cat >>etc/portage/make.conf/00-make.conf <<EOF

PORTDIR="/var/db/repos/gentoo"
DISTDIR="/var/cache/distfiles"
PKGDIR="/var/cache/binpkgs"


L10N="en"
# PYTHON_TARGETS="python2_7 python3_6 python3_7"
# PYTHON_TARGETS="python2_7 python3_6 python3_7"
# PYTHON_SINGLE_TARGET="python3_6"

MAKEOPTS="-j3 -l8"
FEATURES="${FEATURES} parallel-fetch"

#### Alt++ settings
PORTAGE_RSYNC_EXTRA_OPTS="--info=stats0"
EMERGE_DEFAULT_OPTS="--jobs 3  --load-average 8"
PORTAGE_NICENESS=19
PORTAGE_IONICE_COMMAND="ionice -c 3 -p \${PID}"
FEATURES="${FEATURES} -merge-sync parallel-fetch -parallel-install -ebuild-locks"
EOF
mirrorselect -i -o >> /mnt/gentoo/etc/portage/make.conf/01-mirrors
cat >>/mnt/gentoo/etc/portage/make.conf/02-USE <<EOF
USE="\$USE -xdg"        # je to zrudnost
USE="\$USE -zeroconf"   # je to zrudnost
USE="\$USE -subversion" # nechci ani v gitu
USE="\$USE -ipv6"       # nepouzivame
USE="\$USE mysql"       # nase hlavni db
USE="\$USE -berkleydb"  # nepouzivame
USE="\$USE webp"        # protoze se to siri jak mor
USE="\$USE X"   # Xka asi chceme
USE="\$USE -libglvnd"   # asi nechceme
USE="\$USE -pulseaudio" # nechci pulseaudio
USE="\$USE mp3 vorbis"
USE="\$USE lm-sensors"
USE="\$USE -filecaps"   # asi nechci
USE="\$USE -nullok -passwdqc"   # novy check na komplexitu hesel
USE="\$USE -telemetry"
EOF

cat >>/mnt/gentoo/etc/portage/make.conf/debianutils <<EOF
USE="\$USE -installkernel"      # nechci instalivate kernel prez "make install", kopiruju bzImage rucne bez magie
USE="\$USE logrotate -anacron"  # rotuju prez logrotate, anacron nepouzivam
EOF

mkdir --parents /mnt/gentoo/var/db/repos/gentoo
mkdir --parents /mnt/gentoo/etc/portage/repos.conf
cp /mnt/gentoo/usr/share/portage/config/repos.conf /mnt/gentoo/etc/portage/repos.conf/gentoo.conf

cat >>/mnt/gentoo/etc/portage/repos.conf/GilToo-gilhad-repo <<EOF
[GilToo-gilhad-repo]
location = /var/db/repos/GilToo-gilhad-repo
sync-type = rsync
sync-uri = rsync://giltoo.gilhad.cz/GilToo-gilhad-repo/portage
auto-sync = yes
EOF
cp --dereference /etc/resolv.conf /mnt/gentoo/etc/

mount --types proc /proc /mnt/gentoo/proc
mount --rbind /sys /mnt/gentoo/sys
mount --rbind /dev /mnt/gentoo/dev

chroot /mnt/gentoo /bin/bash

## TED JSME CHROOTNUTI

source /etc/profile
export PS1="(chroot) ${PS1}"


df -h  /
mkdir /efi

emerge --sync

eselect profile list

echo "dev-vcs/git        -blksha1 -cgi -curl -gpg -safe-directory -subversion -webdav                 # iconv nls pcre perl" >>/etc/portage/package.use/git
emerge -avq --load-average=3 --jobs=10 dev-vcs/git



cd /etc/
git config --global user.email "gilhad@seznam.cz"
git config --global user.name "root"
git config --global init.defaultBranch master
git init
git add -A
git rm --cached  portage/package.use/git portage/make.conf/01-mirrors.giltoo portage/repos.conf/GilToo-gilhad-repo portage/make.conf/02-USE portage/make.conf/debianutils
git commit -am "uplny zacatek"
git add portage/package.use/git
git commit -am "+git"

mount /dev/sda1 /efi
emerge --ask --oneshot app-portage/cpuid2cpuflags
echo "*/* $(cpuid2cpuflags)" >> /etc/portage/package.use/00cpu-flags
echo "*/* VIDEO_CARDS: intel" >> /etc/portage/package.use/00video_cards
ln -sf /usr/share/zoneinfo/Europe/Prague /etc/localtime

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'

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

emerge --ask --verbose --update --deep --newuse  -q --load-average --jobs sys-kernel/gentoo-sources sys-apps/pciutils

cd /root
mkdir .ssh
cd .ssh
cat root\@ryoga.key.pub >>authorized_keys
chmod 600 authorized_keys
chmod 700 /root/.ssh
passwd
rc-update add sshd default
emerge -avq app-misc/screen vim
vim /etc/conf.d/hostname
# relogin
echo "USE=\"\$USE -quic -httpsrr -http2 -http3 \"" >> /etc/portage/make.conf/02-USE
screen
        emerge -avqDuUN  @world