§2023-11-05

  1. odroid-hc4, was install as Ubuntu Mantic 23.10
alexlai@hc4Mantic:~/build/src$ lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda      8:0    0 298.1G  0 disk 
├─sda1   8:1    0   1.9G  0 part /boot
├─sda2   8:2    0   7.5G  0 part [SWAP]
├─sda3   8:3    0  29.8G  0 part /
└─sda4   8:4    0  89.4G  0 part /mnt/gentoo

  1. edit /etc/systemd/network/50-dhcp.network as,
[Match]
Name=end0

[Network]
DHCP=yes

Then, systemctl restart systemd-networkd.service to get ip

  1. Installing the Gentoo base system, stage3
$ sudo tar xvf stage3-arm64-systemd-20231029T231700Z.tar.xz --xattrs -C /mnt/gentoo/
$ ls /mnt/gentoo/
bin  boot  dev  etc  home  lib  lib64  lost+found  media  mnt  opt  proc  root  run  sbin  sys  tmp  usr  var
$ ls /mnt/gentoo/boot/        <--- empty
  1. arch-chroot
alexlai@hc4Mantic:~$ sudo systemctl daemon-reload
alexlai@hc4Mantic:~$ sudo arch-chroot /mnt/gentoo/ /bin/bash
hc4Mantic / # source /etc/profile
hc4Mantic / # 
  1. Configuring compile options
$ gcc -c -Q -march=native --help=target | awk '/^  -march=/ {print $2}'   <-- return blnak
/etc/portage/make.conf

COMMON_FLAGS="-march=armv8-a+crc -mtune=cortex-a53 -O2 -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
$ lscpu | awk '/^CPU\(s\):/ {print $2}'
4
# 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=goldmont-plus -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

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


# MAKEOPTS
MAKEOPTS="--jobs 4 --load-average 3"

Load Average Below the Number of CPU Cores: A common rule of thumb is to keep the load average below the number of physical CPU cores or threads available on your system. For example, on a quad-core CPU, a load average of 4 or below is generally considered good.

  1. Configuring the main Gentoo repository
ecd ~ $ sudo mkdir -p /mnt/gentoo/etc/portage/repos.conf
$ sudo cp -v /mnt/gentoo/usr/share/portage/config/repos.conf /mnt/gentoo/etc/portage/repos.conf/gentoo.conf
'/mnt/gentoo/usr/share/portage/config/repos.conf' -> '/mnt/gentoo/etc/portage/repos.conf/gentoo.conf'(chroot) hc4Mantic / # mkdir /etc/portage/repos.conf
(chroot) hc4Mantic / # 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'
(chroot) hc4Mantic / # 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. edit /etc/resolv.conf as
nameserver 8.8.8.8
nameserver 8.8.4.4
(chroot) hc4Mantic / # ping -c  3 google.com
PING google.com (172.217.163.46) 56(84) bytes of data.
64 bytes from tsa01s13-in-f14.1e100.net (172.217.163.46): icmp_seq=1 ttl=115 time=4.12 ms
64 bytes from tsa01s13-in-f14.1e100.net (172.217.163.46): icmp_seq=2 ttl=115 time=4.06 ms
64 bytes from tsa01s13-in-f14.1e100.net (172.217.163.46): icmp_seq=3 ttl=115 time=3.96 ms

--- google.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 3.961/4.045/4.120/0.065 ms
  1. First sync, emerge --sync or emerge-webrsync

emerge --sync fetches the complete tree, while emerge-webrsync fetches a smaller, compressed snapshot, making it a faster option in some situations, but it may not provide all the files available in a full sync. The choice between the two commands depends on your specific needs and the constraints of your environment.

  1. Choosing the right profile
(chroot) hc4Mantic / # 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)
  [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)

if not eselect profile set 14 <-- to set the default

  1. Configuring the USE variable

As we said, USE flags are a core feature of Gentoo. Therefore, a good understanding of how to deal with them is needed to have a customized and healthy Gentoo system.

The USE variables can be defined system-wide or per package domain. You can read more info here:

- System-wide in [/etc/portage/make.conf](https://wiki.gentoo.org/wiki//etc/portage/make.conf#USE)
- Per package in [/etc/portage/package.use](https://wiki.gentoo.org/wiki//etc/portage/package.use)

We can see the list of USE flags that are set up in our system by running:

(chroot) livecd / # emerge --info | grep ^USE

USE="acl amd64 bzip2 cli crypt dri fortran gdbm iconv ipv6 libtirpc multilib ncurses nls nptl openmp pam pcre readline seccomp split-usr ssl systemd test-rust udev unicode xattr zlib" ABI_X86="64" ADA_TARGET="gnat_2021" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-1" POSTGRES_TARGETS="postgres15" PYTHON_SINGLE_TARGET="python3_11" PYTHON_TARGETS="python3_11" RUBY_TARGETS="ruby31" VIDEO_CARDS="amdgpu fbdev intel nouveau radeon radeonsi vesa dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
USE="acl amd64 bzip2 cli crypt dri fortran gdbm iconv ipv6 libtirpc multilib ncurses nls nptl openmp pam pcre readline seccomp split-usr ssl systemd test-rust udev unicode xattr zlib"

This USE flag information can be broken down as follows:

We can find a description of all USE flags in less /var/db/repos/gentoo/profiles/use.desc.

Additionally, the utility named quse from portage-utils package can tell us which package uses what USE flags.

For example, if you want to know which packages use the systemd flag we simply need to run:

quse systemd --> shows the list of packages affected by systemd.

In your case, since the USE variable is not present in your /etc/portage/make.conf file, your system is likely using the default USE flags provided by the selected profile. This is a common configuration for many Gentoo systems, as it simplifies the management of USE flags by relying on profile defaults.

    1. Selecting mirrors
$ sudo mirrorselect -D -s4 -o >> /mnt/gentoo/etc/portage/make.conf
-bash: /mnt/gentoo/etc/portage/make.conf: Permission denied
$ sudo passwd root
New password: 
Retype new password: 
passwd: password updated successfully
$ su
Password: 
livecd /home/alexlai # mirrorselect -D -s4 -o >> /mnt/gentoo/etc/portage/make.conf
* Using url: https://api.gentoo.org/mirrors/distfiles.xml
* Downloading a list of mirrors...
 Got 249 mirrors.
* Downloading 100k files from each mirror... [249 of 249]
(chroot) hc4Mantic / # emerge --search mirrorselect
  
[ Results for search key : mirrorselect ]
Searching...

*  app-portage/mirrorselect
      Latest version available: 2.4.0
      Latest version installed: [ Not Installed ]
      Size of files: 117 KiB
      Homepage:      https://wiki.gentoo.org/wiki/Mirrorselect
      Description:   Tool to help select distfiles mirrors for Gentoo
      License:       GPL-2

[ Applications found : 1 ]

(chroot) hc4Mantic / # emerge app-portage/mirrorselect
mirrorselect -D -s4 -o >> /mnt/gentoo/etc/portage/make.conf
  1. Configuring the CPU Flags

USE flags that are available for our system. We could use the advantages of some CPU instruction sets using what are called CPU flags. You can read more on the Gentoo CPU_FLAGS_X86 wiki page.

To know what optimizations we can use for our CPU, we're going to use a tool called cpuid2cpuflags: emerge --ask app-portage/cpuid2cpuflags

# emerge app-portage/cpuid2cpuflags
(chroot) hc4Mantic / # cpuid2cpuflags
CPU_FLAGS_ARM: edsp neon thumb vfp vfpv3 vfpv4 vfp-d32 aes sha1 sha2 crc32 v4 v5 v6 v7 v8 thumb2

nano /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 -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 4 --load-average 3"

GENTOO_MIRRORS="http://ftp.vectranet.pl/gentoo/ \
    http://tux.rainside.sk/gentoo/ \
    http://gentoo.mirror.root.lu/ \
    ftp://ftp.vectranet.pl/gentoo/"

# cpuid2cpuflags
CPU_FLAGS_ARM="edsp neon thumb vfp vfpv3 vfpv4 vfp-d32 aes sha1 sha2 crc32 v4 v5 v6 v7 v8 thumb2" 
  1. add overlay using eselect
# emerge --ask app-eselect/eselect-repository
(chroot) hc4Mantic / # eselect repository add odroidc4 git https://github.com/svoop/odroidc4-overlay
--2023-11-05 04:31:36--  https://qa-reports.gentoo.org/output/repos/repositories.xml
Resolving qa-reports.gentoo.org... 151.101.1.91, 151.101.65.91, 151.101.129.91, ...
Connecting to qa-reports.gentoo.org|151.101.1.91|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 257980 (252K) [text/xml]
Saving to: ‘/root/.cache/eselect-repo/repositories.xml’

repositories.xml                       100%[============================================================================>] 251.93K   848KB/s    in 0.3s    

2023-11-05 04:31:43 (848 KB/s) - ‘/root/.cache/eselect-repo/repositories.xml’ saved [257980/257980]

Adding odroidc4 to /etc/portage/repos.conf/eselect-repo.conf ...
Repository odroidc4 added
(chroot) hc4Mantic / # emerge dev-vcs/git
(chroot) hc4Mantic / # emerge --sync odroidc4
>>> Syncing repository 'odroidc4' into '/var/db/repos/odroidc4'...
/usr/bin/git clone --depth 1 https://github.com/svoop/odroidc4-overlay .
Cloning into '.'...
remote: Enumerating objects: 23, done.
remote: Counting objects: 100% (23/23), done.
remote: Compressing objects: 100% (15/15), done.
remote: Total 23 (delta 2), reused 15 (delta 0), pack-reused 0
Receiving objects: 100% (23/23), 8.95 KiB | 4.47 MiB/s, done.
Resolving deltas: 100% (2/2), done.
=== Sync completed for odroidc4

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


Action: sync for repo: odroidc4, returned code = 0


(chroot) hc4Mantic / # ls /var/db/
Makefile  pkg/      repos/    
(chroot) hc4Mantic / # ls /var/db/repos/
gentoo  odroidc4
  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:

When you select a Gentoo profile during the installation of your Gentoo system, the profile typically includes a set of default USE flags that are already configured for you. These default USE flags are designed to be a good starting point based on the intended purpose of the profile.

  1. Allow licenses for packages

Each package in our Gentoo system defines what kind of license it uses. Setting what licenses we accept in our system is crucial to avoid problems installing free or binary redistributable packages. Also, to get installed automatically without asking us every time they get installed or updated.

You can read more about Gentoo licenses here.

Licenses acceptance is set in our /etc/portage/make.conf in the variable ACCEPT_LICENSE, like:

ACCEPT_LICENSE="-* @FREE @BINARY-REDISTRIBUTABLE"
  1. Timezone

We can use the tool tzselect to interactively select our country, and it will tell us what the value of /etc/timezone file should be.

(chroot) hc4Mantic / # date
Sun Nov  5 05:29:03 -00 2023
(chroot) hc4Mantic / # ls /usr/share/zoneinfo/Asia/Ta
Taipei    Tashkent  
(chroot) hc4Mantic / # ln -sf /usr/share/zoneinfo/Asia/Taipei /etc/localtime 
(chroot) hc4Mantic / # date
Sun Nov  5 13:30:15 CST 2023
  1. Configure locales
(chroot) livecd / # nano /etc/locale.gen 
(chroot) livecd / # locale-gen 
 * Generating 3 locales (this might take a while) with 4 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 ]
(chroot) livecd / # locale -a
C
C.utf8
POSIX
en_US.utf8
ja_JP.utf8
(chroot) hc4Mantic / # 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)
(chroot) hc4Mantic / # eselect locale set 4
Setting LANG to en_US.utf8 ...
!!! Section 'odroidc4' in repos.conf has location attribute set to nonexistent directory: '/var/db/repos/odroidc4'
Run ". /etc/profile" to update the variable in your shell.

(chroot) livecd / # env-update && source /etc/profile
>>> Regenerating /etc/ld.so.cache...
(chroot) livecd / # echo $LANG
en_US.utf8

(chroot) livecd / # echo $LC_ALL

  1. Installing external firmware

Linux kernel is an open-source project, but some hardware manufacturers don't like the idea of open-source the code of its firmware (or modules), releasing a compiled binary version of them. These binaries can't be included in the Linux kernel repository, and they are packed in a package called sys-kernel/linux-firmware.

So, before compiling the kernel, it is essential to know that some devices require additional firmware to make the system run properly. Second, these are more common than we think, from network adapters, wireless cards, graphic cards, and CPUs.

For the most common firmware requirements, we will install the sys-kernel/linux-firmware:

$ emerge --ask sys-kernel/linux-firmware `
...
>>> Completed (1 of 1) sys-kernel/linux-firmware-20230919::gentoo

 * Messages for package sys-kernel/linux-firmware-20230919:

 * Your configuration for sys-kernel/linux-firmware-20230919 has been saved in 
 * "/etc/portage/savedconfig/sys-kernel/linux-firmware-20230919" 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.

 * GNU info directory index is up-to-date.

 * IMPORTANT: 10 news items need reading for repository 'gentoo'.
 * Use eselect news read to view new items.
  1. get kernel source
(chroot) hc4Mantic / # emerge -av sys-kernel/odroidc4-sources

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


These are the packages that would be merged, in order:

Calculating dependencies... done!
Dependency resolution took 4.73 s.


!!! All ebuilds that could satisfy "sys-kernel/odroidc4-sources" have been masked.
!!! One of the following masked packages is required to complete your request:
- sys-kernel/odroidc4-sources-5.11.18::odroidc4 (masked by: ~arm64 keyword)
- sys-kernel/odroidc4-sources-5.11.14::odroidc4 (masked by: ~arm64 keyword)
- sys-kernel/odroidc4-sources-5.11.9::odroidc4 (masked by: ~arm64 keyword)

For more information, see the MASKED PACKAGES section in the emerge
man page or refer to the Gentoo Handbook.

(chroot) hc4Mantic / # emerge -av sys-kernel/odroidc4-sources --autounmask-write --autounmask

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


These are the packages that would be merged, in order:

Calculating dependencies... done!
Dependency resolution took 5.14 s.

[ebuild  N     ] dev-libs/elfutils-0.189-r4::gentoo  USE="bzip2 nls utils -debuginfod -lzma -static-libs -test -verify-sig -zstd" 8,929 KiB
[ebuild  N     ] virtual/libelf-3-r1:0/1::gentoo  0 KiB
[ebuild  N     ] app-arch/cpio-2.14::gentoo  USE="nls" 1,486 KiB
[ebuild  N     ] app-alternatives/cpio-0::gentoo  USE="gnu (split-usr) -libarchive" 0 KiB
[ebuild  N    ~] sys-kernel/odroidc4-sources-5.11.18:5.11.18::odroidc4  USE="-build -symlink" 185,148 KiB

Total: 5 packages (5 new), Size of downloads: 195,562 KiB

The following keyword changes are necessary to proceed:
 (see "package.accept_keywords" in the portage(5) man page for more details)
# required by sys-kernel/odroidc4-sources (argument)
=sys-kernel/odroidc4-sources-5.11.18 ~arm64

Would you like to add these changes to your config files? [Yes/No] 

Autounmask changes successfully written.

 * IMPORTANT: config file '/etc/portage/package.accept_keywords/zz-autounmask' needs updating.
 * See the CONFIGURATION FILES and CONFIGURATION FILES UPDATE TOOLS
 * sections of the emerge man page to learn how to update config files.

(chroot) hc4Mantic / # dispatch-conf
(chroot) hc4Mantic / # emerge -av sys-kernel/odroidc4-sources

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


These are the packages that would be merged, in order:

Calculating dependencies... done!
Dependency resolution took 4.89 s.

[ebuild  N     ] dev-libs/elfutils-0.189-r4::gentoo  USE="bzip2 nls utils -debuginfod -lzma -static-libs -test -verify-sig -zstd" 8,929 KiB
[ebuild  N     ] virtual/libelf-3-r1:0/1::gentoo  0 KiB
[ebuild  N     ] app-arch/cpio-2.14::gentoo  USE="nls" 1,486 KiB
[ebuild  N     ] app-alternatives/cpio-0::gentoo  USE="gnu (split-usr) -libarchive" 0 KiB
[ebuild  N    ~] sys-kernel/odroidc4-sources-5.11.18:5.11.18::odroidc4  USE="-build -symlink" 185,148 KiB

Total: 5 packages (5 new), Size of downloads: 195,562 KiB

Would you like to merge these packages? [Yes/No]
  1. try to compile kernel
(chroot) hc4Mantic / # cd /usr/src/
(chroot) hc4Mantic /usr/src # ls -l
total 4
drwxr-xr-x 25 root root 4096 11月  5 14:39 linux-5.11.18-odroidc4
(chroot) hc4Mantic /usr/src # eselect kernel list
Available kernel symlink targets:
  [1]   linux-5.11.18-odroidc4
(chroot) hc4Mantic /usr/src # eselect kernel set 1
(chroot) hc4Mantic /usr/src # ls -l
total 4
lrwxrwxrwx  1 root root   22 11月  5 14:40 linux -> linux-5.11.18-odroidc4
drwxr-xr-x 25 root root 4096 11月  5 14:39 linux-5.11.18-odroidc4

/mnt/gentoo/usr/share/genkernel/arch/arm64/generated-config ???