User:Vokiel/Beelink-SER6-Mini-PC

From Gentoo Wiki
Jump to:navigation Jump to:search

Beelink SER6 Mini PC (Early 2023) Installation Log

This page is an installation log of gentoo linux on a Beelink SER6 Mini PC with the Ryzen 7 chipset. I won't go into detailed technical explanations in this log. I may drop a number of links which may eventually die and become inaccessible. I will however document everything that I've done, what worked well and what didn't. I will try to log everything in a neutral position as much as possible. I'll set my own requirements, and make my own choices. Some of which will most likely be wrong, so don't take this page as a Guide without asking for multiple opinions on it. If you find some problematic setup, don't hesitate to share it under the Discussions tab.

This is the product string I get from dmidecode:

user $dmidecode -s system-product-name
SER


Requirements

  1. Must not dual boot Windows or any other system.
  2. Must use an EFI boot partition on a GPT disk.
  3. Should use OpenRC
  4. Should be running 24/7 with low fan noise


Connecting to the Network

Basically followed the Network Guide, but this always fails everywhere without DHCP for some reason. I had to use ifconfig manually with route add and editing the resolv.conf to add the DNS confs.

root #ifconfig enp2s0 192.168.1.100 broadcast 192.168.0.255 netmask 255.255.255.0 up
root #route add default gw 192.168.1.1
root #vi /etc/resolv.conf


Creating the Partitions

This will be a close to vanilla install without any encrypted partition as it is not my main machine and I won't be holding any sensitive documents on it. It's a stream/seed box with some other useful tooling. I won't isolate /var/tmp this time around, because I'm having more issues with /var/cache filling up and having to clean it up manually.

root #fdisk /dev/nvme0n1

With fdisk, we create a new GPT partition table and dump whatever was there before (g). After, it's simply a matter of creating an EFI partition (n, default, default, +256M, t, 1) and then an extended Linux Filesystem partition. (n, default, default, default)

Warning
This is a log. Only do this if you don't want to dual boot
root #fdisk -l /dev/nvme0n1
Disk /dev/nvme0n1: 465.76 GiB, 500107862016 bytes, 976773168 sectors
Disk model: KINGSTON SNV2S500G                      
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: 376C08BD-6B9A-9C4F-B7A0-CDCE0402FFFC

Device             Start       End   Sectors   Size Type
/dev/nvme0n1p1      2048    526335    524288   256M EFI System
/dev/nvme0n1p2    526336  67635199  67108864    32G Linux swap
/dev/nvme0n1p3  67635200 134744063  67108864    32G Linux filesystem
/dev/nvme0n1p4 134744064 268961791 134217728    64G Linux filesystem
/dev/nvme0n1p5 268961792 285739007  16777216     8G Linux filesystem
/dev/nvme0n1p6 285739008 419956735 134217728    64G Linux filesystem
/dev/nvme0n1p7 419956736 976773134 556816399 265.5G Linux filesystem


EFI Partition

Needs to be vfat according to the EFI System Partition Guide.

root #mkfs.vfat -F 32 /dev/nvme0n1p1


Linux Partitions

The partitions created are: swap, /, /var, /var/log, /home and a toy partition on /media

root #mkswap -L swap /dev/nvme0n1p2
Setting up swapspace version 1, size = 32 GiB (34359734272 bytes)
no label, UUID=b01b24a4-b1cf-4714-b1c4-ca12c64effae
root #swapon /dev/nvme0n1p2
root #mkfs.ext4 -L root /dev/nvme0n1p3
root #mkfs.ext4 -L var /dev/nvme0n1p4
root #mkfs.ext4 -L varlog /dev/nvme0n1p5
root #mkfs.ext4 -L home /dev/nvme0n1p6
root #mkfs.ext4 -L media /dev/nvme0n1p7


Installing Gentoo from Stage 3

Following the Handbook closely:

root #date 062708462023
root #mount /dev/nvme0n1p3 /mnt/gentoo/
root #cd /mnt/gentoo
root #mkdir {home,var,media}
root #mount /dev/nvme0n1p4 var
root #cd var/
root #mkdir log
root #mount /dev/nvme0n1p5 log
root #cd ..
root #mount /dev/nvme0n1p6 home
root #mount /dev/nvme0n1p7 media


Configuring make.conf

This is a minimal make.conf file:

root #grep -m1 -A3 "vendor_id" /proc/cpuinfo
vendor_id       : AuthenticAMD
cpu family      : 25
model           : 68
model name      : AMD Ryzen 7 7735HS with Radeon Graphics
Warning
Usually I have a Gentoo live usb stick, but this time it was SystemRescueCD, and app-portage/cpuid2cpuflags is not available, so I went to chroot, installed it and completed the file while chrooted.
root #cpuid2cpuflags
CPU_FLAGS_X86: aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sha sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3


FILE /etc/portage/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 -march=znver3 -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
FCFLAGS="${COMMON_FLAGS}"
FFLAGS="${COMMON_FLAGS}"
CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sse sse2 sse3 sse4_1 sse4_2 ssse3"
MAKEOPTS="-j5"

# NOTE: This stage was built with the bindist Use flag enabled

# This sets the language of build output to English.
# Please keep this setting intact when reporting bugs.
LC_MESSAGES=C.utf8

GENTOO_MIRRORS="https://mirror.csclub.uwaterloo.ca/gentoo-distfiles/"
ACCEPT_LICENSE="*"


Chroot to /mnt/gentoo

Largely from the Installation Guide:

root #mirrorselect -i -o >> /mnt/gentoo/etc/portage/make.conf
root #mkdir -p /mnt/gentoo/etc/portage/repos.conf
root #cp /mnt/gentoo/usr/share/portage/config/repos.conf /mnt/gentoo/etc/portage/repos.conf/gentoo.conf
root #cp --dereference /etc/resolv.conf /mnt/gentoo/etc/
root #mount --types proc /proc /mnt/gentoo/proc
root #mount --rbind /sys /mnt/gentoo/sys
root #mount --rbind /dev /mnt/gentoo/dev
root #mount --bind /run /mnt/gentoo/run
root #chroot /mnt/gentoo /bin/bash
root #source /etc/profile
root #export PS1="(chroot) ${PS1}"
(chroot) root #emerge-webrsync
(chroot) root #emerge --sync
(chroot) root #eselect profile list
Available profile symlink targets:
  [1]   default/linux/amd64/17.1 (stable)
  [2]   default/linux/amd64/17.1/selinux (stable)
  [3]   default/linux/amd64/17.1/hardened (stable)
  [4]   default/linux/amd64/17.1/hardened/selinux (stable)
  [5]   default/linux/amd64/17.1/desktop (stable)
  [6]   default/linux/amd64/17.1/desktop/gnome (stable)
  [7]   default/linux/amd64/17.1/desktop/gnome/systemd (stable)
  [8]   default/linux/amd64/17.1/desktop/plasma (stable)
  [9]   default/linux/amd64/17.1/desktop/plasma/systemd (stable)
...

Requirements on this build are made to avoid fat environments like Gnome, KDE and SystemD. Starting leaner with default/linux/amd64/17.1/desktop (stable).

root #eselect profile set 5
root #emerge --ask --verbose --update --deep --newuse @world
root #echo "Canada/Eastern" > /etc/timezone
root #emerge --config sys-libs/timezone-data
root #nano -w /etc/locale.gen
root #locale-gen
root #eselect locale list
  [1]   C
  [2]   cs_CZ
  [3]   cs_CZ.iso88592
  [4]   cs_CZ.utf8
  [5]   C.utf8
  [6]   da_DK
  [7]   da_DK.iso88591
  [8]   da_DK.utf8
  [9]   de_DE
  [10]  de_DE.iso88591
  [11]  de_DE.utf8
  [12]  en_CA
  [13]  en_CA.iso88591
  [14]  en_CA.utf8
  [15]  en_US
  [16]  en_US.iso88591
  [17]  en_US.utf8 *
...


Configuring the kernel

(chroot) root #emerge --ask sys-apps/pciutils
(chroot) root #emerge --ask sys-kernel/gentoo-sources
(chroot) root #eselect kernel list
Available kernel symlink targets:
  [1]   linux-6.1.31-gentoo *
(chroot) root #cd /usr/src/linux
(chroot) root #make menuconfig
(chroot) root #lspci -v|less
(chroot) root #lsmod
... Repeat until configured ...
Warning
There's no best way to configure a kernel, you have to immerse yourself with Linux and do some research. This is by no mean authoritative. I went on pure instinct, coming up with some search hits, and deciding whether it might be needed or useful. I start by what I know I'll need and remove what i know I won't.