§2023-10-29

  1. start sshd service
# systemctl start systemd-networkd
# systemctl enable systemd-networkd
# systemctl start sshd
# systemctl enable sshd
  1. ssh into it, using alexlai, and make sure alexlai could do su
  2. systemd-firstboot
localhost /home/alexlai # systemd-firstboot --prompt

Welcome to your new installation of Gentoo Linux!

Please configure your system!

-- Press any key to proceed --

‣ Please enter hostname for new system (empty to skip): orgpi5+16G
Specified hostname invalid.
‣ Please enter hostname for new system (empty to skip): orgpi516G
/etc/hostname written.

reboot

  1. systemctl preset-all
orgpi516G /home/alexlai # systemctl preset-all
Removed "/etc/systemd/system/multi-user.target.wants/sshd.service".
Removed "/etc/systemd/system/sockets.target.wants/systemd-networkd.socket".
Created symlink /etc/systemd/system/sockets.target.wants/systemd-networkd.socket → /lib/systemd/system/systemd-networkd.socket.
  1. set localcal time
orgpi516G /home/alexlai # ln  -sf  /usr/share/zoneinfo/Asia/Taipei /etc/localtime
orgpi516G /home/alexlai # date
Sun Oct 29 10:39:37 CST 2023
  1. locale-gen
orgpi516G /home/alexlai # nano /etc/locale.gen 
orgpi516G /home/alexlai # locale-gen
 * Generating 3 locales (this might take a while) with 8 jobs
 *  (3/3) Generating C.UTF-8 ...                                                                                                                                                                                                                                                                                        [ ok ]
 *  (2/3) Generating ja_JP.UTF-8 ...                                                                                                                                                                                                                                                                                    [ ok ]
 *  (1/3) Generating en_US.UTF-8 ...                                                                                                                                                                                                                                                                                    [ ok ]
 * Generation complete
 * Adding locales to archive ...                                                                                                                                                                                                                                                                                        [ ok ]
orgpi516G /home/alexlai # eselect locale list
Available targets for the LANG variable:
  [1]   C
  [2]   C.utf8
  [3]   POSIX
  [4]   en_US.utf8
  [5]   ja_JP.utf8
  [6]   C.UTF8 *
  [ ]   (free form)
orgpi516G /home/alexlai # eselect locale set 4
Setting LANG to en_US.utf8 ...
!!! Section 'gentoo' in repos.conf has location attribute set to nonexistent directory: '/var/db/repos/gentoo'
!!! Invalid Repository Location (not a dir): '/var/db/repos/gentoo'
Run ". /etc/profile" to update the variable in your shell.
orgpi516G /home/alexlai # source /etc/profile
  1. Configuring compile options for [/etc/portage/make.conf](https://wiki.gentoo.org/wiki/Safe_CFLAGS#ARMv7-A.2FCortex-A9_MPCore)
...
# COMMON_FLAGS="-O2 -pipe"
COMMON_FLAGS="-march=armv8-a+crc -mtune=cortex-a53 -O2 -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
FCFLAGS="${COMMON_FLAGS}"
FFLAGS="${COMMON_FLAGS}"
...
# MAKEOPTS
MAKEOPTS="--jobs 8 --load-average 7"
  1. set /etc/portage/repos.conf
orgpi516G /home/alexlai # mkdir /etc/portage/repos.conf

orgpi516G /home/alexlai # cp -v /usr/share/portage/config/repos.conf /etc/portage/repos.conf/gentoo.conf
'/usr/share/portage/config/repos.conf' -> '/etc/portage/repos.conf/gentoo.conf'
orgpi516G /home/alexlai # cat /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-keyserver = hkps://keys.gentoo.org
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
sync-webrsync-verify-signature = yes
  1. emerge-webrsync
  2. eselect profile list make sure properly set
orgpi516G /home/alexlai # eselect profile list
Available profile symlink targets:
  [1]   default/linux/arm64/17.0 (stable)
  [2]   default/linux/arm64/17.0/hardened (exp)
  [3]   default/linux/arm64/17.0/hardened/selinux (dev)
  [4]   default/linux/arm64/17.0/desktop (stable)
  [5]   default/linux/arm64/17.0/desktop/gnome (stable)
  [6]   default/linux/arm64/17.0/desktop/gnome/systemd (stable)
  [7]   default/linux/arm64/17.0/desktop/gnome/systemd/merged-usr (stable)
  [8]   default/linux/arm64/17.0/desktop/plasma (stable)
  [9]   default/linux/arm64/17.0/desktop/plasma/systemd (stable)
  [10]  default/linux/arm64/17.0/desktop/plasma/systemd/merged-usr (stable)
  [11]  default/linux/arm64/17.0/desktop/systemd (stable) *             <-- default
  [12]  default/linux/arm64/17.0/desktop/systemd/merged-usr (stable)
  [13]  default/linux/arm64/17.0/developer (exp)
  [14]  default/linux/arm64/17.0/systemd (stable)
  [15]  default/linux/arm64/17.0/systemd/merged-usr (stable)
  [16]  default/linux/arm64/17.0/systemd/selinux (exp)
  [17]  default/linux/arm64/17.0/systemd/selinux/merged-usr (exp)
  [18]  default/linux/arm64/17.0/llvm (exp)
  [19]  default/linux/arm64/17.0/systemd/llvm (exp)
  [20]  default/linux/arm64/17.0/systemd/llvm/merged-usr (exp)
  [21]  default/linux/arm64/17.0/big-endian (exp)
  [22]  default/linux/arm64/17.0/big-endian/systemd (exp)
  [23]  default/linux/arm64/17.0/big-endian/systemd/merged-usr (exp)
  [24]  default/linux/arm64/17.0/musl (dev)
  [25]  default/linux/arm64/17.0/musl/llvm (exp)
  [26]  default/linux/arm64/17.0/musl/hardened (exp)
  [27]  default/linux/arm64/17.0/musl/hardened/selinux (exp)
  1. Configuring the CPU Flags
emerge --ask app-portage/cpuid2cpuflags
orgpi516G /home/alexlai # cpuid2cpuflags
CPU_FLAGS_ARM: edsp neon thumb vfp vfpv3 vfpv4 vfp-d32 aes sha1 sha2 crc32 v4 v5 v6 v7 v8 thumb2  <-- put it into make.conf
  1. Licenses acceptance is set in our /etc/portage/make.conf in the variable ACCEPT_LICENSE, like:
ACCEPT_LICENSE="-* @FREE @BINARY-REDISTRIBUTABLE"
  1. emerge app-portage/mirrorselect
# emerge app-portage/mirrorselect
# mirrorselect -D -s4 -o >> /etc/portage/make.conf

And /etc/portgage/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"
COMMON_FLAGS="-march=armv8-a+crc -mtune=cortex-a53 -O2 -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
FCFLAGS="${COMMON_FLAGS}"
FFLAGS="${COMMON_FLAGS}"

# WARNING: Changing your CHOST is not something that should be done lightly.
# Please consult https://wiki.gentoo.org/wiki/Changing_the_CHOST_variable before changing.
CHOST="aarch64-unknown-linux-gnu"

# 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

# MAKEOPTS
MAKEOPTS="--jobs 8 --load-average 7"

# cpuid2cpuflags
CPU_FLAGS_ARM="edsp neon thumb vfp vfpv3 vfpv4 vfp-d32 aes sha1 sha2 crc32 v4 v5 v6 v7 v8 thumb2"

#
ACCEPT_LICENSE="-* @FREE @BINARY-REDISTRIBUTABLE"

GENTOO_MIRRORS="http://ftp.vectranet.pl/gentoo/ \
    http://gentoo.mirror.root.lu/ \
    http://tux.rainside.sk/gentoo/ \
    ftp://ftp.vectranet.pl/gentoo/"
  1. Re-compile and update @world

After setting up the USE and CPU flags, we're ready to re-compile and update all packages that we have installed in our base system before moving forward:

emerge --ask --verbose --update --deep --newuse @world