Skip to content

Gentoo Linux

Gentoo Background

I tried Gentoo once, and I fell in love!

How, why, when? Gentooooooooowiiie :)

When I told a friend that I would like to try Gentoo, the year was then 
2008 then the person said that I will go back to Debian because I 
will get tired of compiling code and doing everything from scratch all the time.

That person was wrong ;)

For 20 years I have been part of the Gentoo Community and in this part 
I have intended to post everything that I have created around gentoo 
and also various contributions from myself Gentoo

Respect to everyone that has been sharing your knowledge during the years, 
now im trying to give back what i've learned during the years :)

List what package files belong to

#!/bin/bash
# Author: wuseman@bugcrowdninja.com
# License: WTFPL <http://www.wtfpl.net/>
# Same as `equery b <bin_file>` but 98% faster 
# `equery b ffprobe` = 12.912s
# `wbelongsto ffprobe = 0.078s

find_package() {
  target_file="$1"
  pkg_dirs=$(rg -l "$target_file" /var/db/pkg/*/*/CONTENTS)
  for pkg_dir in $pkg_dirs; do
    pkg_name=$(basename $(dirname "$pkg_dir"))
    actual_path=$(rg "$target_file" "$pkg_dir" | awk '{print $2}' | grep -E "^(/usr/bin/|/bin/|/usr/sbin/|/sbin/)")
    
    if [ -n "$actual_path" ]; then
      echo -e " * Searching for \e[92m$target_file\e[0m ..."
      echo -e "\e[92m\e[1m$pkg_name\e[0m (\e[97m\e[1m$actual_path\e[0m)"
      return
    fi
  done
  echo -e " * Searching for \e[92m$target_file\e[0m ..."
  echo -e "\e[91m\e[1mFile does not belong to any package\e[0m"
}

export -f find_package

printf "%s\n" "$@" | xargs -P 4 -I {} bash -c 'find_package "$@"' _ {}

Equal to eselect kernel list

kernel-config list

Show current kernel in use

kernel-config show

Check the running kernel configuration for strict /dev/mem restrictions:

zgrep STRICT_DEVMEM /proc/config.gz

If enabled, the output will include:

CONFIG_STRICT_DEVMEM=y
CONFIG_IO_STRICT_DEVMEM=y

To unlock this feature so we can read memory we must set above to n

CONFIG_STRICT_DEVMEM=n
CONFIG_IO_STRICT_DEVMEM=n

Some kernels allow us to disable devmem protection from kernel commandline

GRUB_CMDLINE_LINUX="strict_devmem=0"
grub-mkconfig -o /boot/grub/grub.cfg

Print useflag description

quse -D  -pnet-misc/remmina
equery u net-misc/remmina

Rebuild modules everytime kernel was upgraded/downgraded

emerge @module-rebuild

Sync Portage Tree

if which eix &> /dev/null; then
  eix-sync
  eix-update
else
  emerge --sync
fi

Re-emerge all ebuilds with missing files

emerge -av1 `qlist --installed --nocolor | uniq \
| while read cp; do 
  qlist --exact $cp | while read file; do 
    test -e $file || { echo $cp; \
    echo "$cp: missing $file (and maybe more)" 1>&2; 
    break; 
  }; 
  done; 
done`

Print useflags NOT in use

eix --print-all-useflags | grep -o "\-.*" | grep -v "_" | grep -v "+"

Print last time emerge was used

grep "emerge on" /var/log/emerge.log | cut -d: -f2- | tr '[:upper:]' '[:lower:]' | sed 's/ started/Last used/g' | tail -n 1

Print all packages that is installed from custom overlays

eix -c --installed-overlay

Modules short with description

modinfo $(cut -d' ' -f1 /proc/modules) | sed '/^dep/s/$/\n/; /^file\|^desc\|^dep/!d'

Print current installed distro

awk -F= '/^NAME/{gsub(/[[:space:]]/, "", $2); print tolower($2); exit}' /etc/os-release

View emerge log by date in humand friendly time

awk -F: '{print strftime("%Y-%m-%d -> %X --> ", $1),$2}' /var/log/emerge.log

Find the right intel-ucode firmware for Intel GPU

iucode_tool -S -l /lib/firmware/intel-ucode/*

Preventing a specific package from being updated during @world upgrades

echo "sys-kernel/gentoos-sources" > /etc/portage/package.mask/gentoo-sources

A near-perfect Gentoo upgrade workflow

# 1. Sync tree (fast + reliable)
eix-sync

# 2. Read important notices
eselect news read

# 3. Update local metadata indexes (optional but useful)
eix-update

# 4. Deep system upgrade
emerge -avuDN --with-bdeps=y --keep-going @world

# 5. Handle preserved libraries immediately
emerge @preserved-rebuild

# 6. Update configuration files
dispatch-conf

# 7. Rebuild broken reverse deps (only if needed)
revdep-rebuild

# 8. Clean up old packages
emerge --depclean

# 9. Rebuild after depclean if needed
revdep-rebuild

# 10. Clean distfiles safely
eclean-dist -d

Create an alias for above example of upgrading Gentoo Linux

alias gentoo-upgrade='
eix-sync &&
eselect news read &&
emerge -avuDN --with-bdeps=y --keep-going @world &&
emerge @preserved-rebuild &&
dispatch-conf &&
emerge --depclean &&
revdep-rebuild &&
eclean-dist -d
'

Genkernel

Configure dropbear in initramfs

  • Install net-misc/dropbear
emerge --ask net-misc/dropbear
  • Create/Copy authorized_keys file to /etc/dropbear/authorized_keys
cat ~/.ssh/authorized_keys > /etc/dropbear/authorized_keys
  • Set SSH Enable in /etc/genkernel.conf or use --ssh with genkernel command
sed -i 's/SSH="yes"/SSH="no"/g' /etc/genkernel.conf

Include Firmware files in /etc/genkernel.conf

FIRMWARE_INSTALL="yes"
FIRMWARE="yes"
FIRMWARE_DIR="/lib/firmware"
FIRMWARE_FILES="i915/skl_dmc_ver1_27.bin, rtlwifi/rtl8192eu_nic.bin, regulatory.db, regulatory.db.p7s, intel-ucode/06-5e-08"

Include microcode in /etc/genkernel.conf

MICROCODE="ALL"
MICROCODE_INITRAMFS="yes"

Print in percent of all available packages in tree we installed

installed_count=$(eix --only-names -I | wc -l)
total_count=$(eix --only-names | wc -l)
percentage=$(printf "%.2f" "$(bc <<< "scale=2; $installed_count / $total_count * 100")")
printf "%s%% of 100%% packages from Gentoo Linux is installed\n" "$percentage"

For view bluetooth percentage in bluetoothctl and plasma-desktop tray icon

sed -i 's/experimental=false/experimental=true' /etc/bluetooth/main.conf
bluetoothctl info
  Device 14:3F:A6:15:93:43 (public)
        Name: WH-1000XM4
        Alias: WH-1000XM4
        Class: 0x00240404
        Icon: audio-headset
        Paired: yes
        Bonded: yes
        Trusted: yes
        Blocked: no
        Connected: yes
        LegacyPairing: no
        UUID: Vendor specific           (00000000-deca-fade-deca)
        UUID: Headset                   (00001108-0000-1000-8000)
        UUID: Audio Sink                (0000110b-0000-1000-8000)
        UUID: A/V Remote Control Target (0000110c-0000-1000-8000)
        UUID: Advanced Audio Distribu.. (0000110d-0000-1000-8000)
        UUID: A/V Remote Control        (0000110e-0000-1000-8000)
        UUID: Handsfree                 (0000111e-0000-1000-8000)
        UUID: PnP Information           (00001200-0000-1000-8000)
        UUID: Vendor specific           (81c2e72a-0591-443e-a1ff)
        UUID: Vendor specific           (8901dfa8-5c7e-4d8f-9f0c)
        UUID: Vendor specific           (931c7e8a-540f-4686-b798)
        UUID: Vendor specific           (96cc203e-5068-46ad-b32d)
        UUID: Vendor specific           (b9b213ce-eeab-49e4-8fd9)
        UUID: Vendor specific           (f8d1fbe4-7966-4334-8024)
        Modalias: usb:v054Cp0D58d
        Battery Percentage: 0x32 (50)

Enabling static-user for qemu-arm-static

Ensure that qemu is installed with the static-user flag to obtain the static component.

echo "app-emulation/qemu <other_usre_flags> static-user" >> /etc/portage/package.use/qemu

Mullvad Browser and Tor Browser requires

This will solve Couldn't load XPCOM. issues for tor browser

echo "x11-misc/appmenu-gtk-module wayland" > /etc/portage/package.use/appmeny-gtk-module
echo ">=x11-libs/gtk+-3.24.38 wayland\nx11-libs/gtk wayland" >> /etc/portage/package.use/gtk 

Video Editor

cat << "EOF" > /etc/portage/package.use/avidemux
media-libs/avidemux-plugins a52 aac alsa fontconfig gui lame libsamplerate nvenc opengl opus oss pulseaudio truetype twolame vdpau vorbis vpx x264 x265  xv xvidmedia-libs/avidemux-core nls nvenc sdl vaapi vdpau xc    
media-video/avidemux gui nls opengl sdl vaapi vdpau xv    
>=media-libs/avidemux-core-2.8.1-r1 vdpau vaapi nvenc
EOF   
emerge media-video/avidemux

It's possible to do the same operations using the command line

avidemux \ 
    --load input.avi \
    --vcd-res \
    --video-process \
    --video-codec VCD \
    --save /tmp/videocd.m1v \
    --audio-process \
    --audio-normalize \
    --audio-downample \
    --audio-codec MP2 \
    --audio-bitrate 224 \
    --save-uncompressed-audio \
    /tmp/video4you.mp2 \
    --quit

Bindfmt for Qemu

:python3.11:M::\xa7\x0d\x0d\x0a::/usr/bin/python3.11:
:qemu-aarch64:M::\x7f\x45\x4c\x46\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/libexec/qemu-binfmt/aarch64-binfmt-P:OCPF
:qemu-alpha:M::\x7f\x45\x4c\x46\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x26\x90:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/libexec/qemu-binfmt/alpha-binfmt-P:OCPF
:qemu-arm:M::\x7f\x45\x4c\x46\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/libexec/qemu-binfmt/arm-binfmt-P:OCPF
:qemu-armeb:M::\x7f\x45\x4c\x46\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/libexec/qemu-binfmt/armeb-binfmt-P:OCPF
:qemu-cris:M::\x7f\x45\x4c\x46\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x4c\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/libexec/qemu-binfmt/cris-binfmt-P:OCPF
:qemu-hexagon:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xa4\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/libexec/qemu-binfmt/hexagon-binfmt-P:OCPF
:qemu-hppa:M::\x7f\x45\x4c\x46\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x0f:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/libexec/qemu-binfmt/hppa-binfmt-P:OCPF
:qemu-loongarch64:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x02\x01:\xff\xff\xff\xff\xff\xff\xff\xfc\x00\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/libexec/qemu-binfmt/loongarch64-binfmt-P:OCPF
:qemu-m68k:M::\x7f\x45\x4c\x46\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x04:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/libexec/qemu-binfmt/m68k-binfmt-P:OCPF
:qemu-microblaze:M::\x7f\x45\x4c\x46\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\xba\xab:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/libexec/qemu-binfmt/microblaze-binfmt-P:OCPF
:qemu-mips64:M::\x7f\x45\x4c\x46\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/libexec/qemu-binfmt/mips64-binfmt-P:OCPF
:qemu-mips64el:M::\x7f\x45\x4c\x46\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\x00\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/libexec/qemu-binfmt/mips64el-binfmt-P:OCPF
:qemu-mips:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00:\xff\xff\xff\xff\xff\xff\xff\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20:/usr/libexec/qemu-binfmt/mips-binfmt-P:OCPF
:qemu-mipsel:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00:\xff\xff\xff\xff\xff\xff\xff\x00\x00\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00:/usr/libexec/qemu-binfmt/mipsel-binfmt-P:OCPF
:qemu-mipsn32:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20:\xff\xff\xff\xff\xff\xff\xff\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20:/usr/libexec/qemu-binfmt/mipsn32-binfmt-P:OCPF
:qemu-mipsn32el:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00:\xff\xff\xff\xff\xff\xff\xff\x00\x00\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00:/usr/libexec/qemu-binfmt/mipsn32el-binfmt-P:OCPF
:qemu-ppc64:M::\x7f\x45\x4c\x46\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x15:\xff\xff\xff\xff\xff\xff\xff\xfc\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/libexec/qemu-binfmt/ppc64-binfmt-P:OCPF
:qemu-ppc64le:M::\x7f\x45\x4c\x46\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x15\x00:\xff\xff\xff\xff\xff\xff\xff\xfc\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\x00:/usr/libexec/qemu-binfmt/ppc64le-binfmt-P:OCPF
:qemu-ppc:M::\x7f\x45\x4c\x46\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x14:\xff\xff\xff\xff\xff\xff\xff\xfc\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/libexec/qemu-binfmt/ppc-binfmt-P:OCPF
:qemu-riscv32:M::\x7f\x45\x4c\x46\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xf3\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/libexec/qemu-binfmt/riscv32-binfmt-P:OCPF
:qemu-riscv64:M::\x7f\x45\x4c\x46\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xf3\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/libexec/qemu-binfmt/riscv64-binfmt-P:OCPF
:qemu-s390x:M::\x7f\x45\x4c\x46\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x16:\xff\xff\xff\xff\xff\xff\xff\xfc\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/libexec/qemu-binfmt/s390x-binfmt-P:OCPF
:qemu-sh4:M::\x7f\x45\x4c\x46\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a\x00:\xff\xff\xff\xff\xff\xff\xff\xfc\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/libexec/qemu-binfmt/sh4-binfmt-P:OCPF
:qemu-sh4eb:M::\x7f\x45\x4c\x46\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a:\xff\xff\xff\xff\xff\xff\xff\xfc\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/libexec/qemu-binfmt/sh4eb-binfmt-P:OCPF
:qemu-sparc32plus:M::\x7f\x45\x4c\x46\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x12:\xff\xff\xff\xff\xff\xff\xff\xfc\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/libexec/qemu-binfmt/sparc32plus-binfmt-P:OCPF
:qemu-sparc64:M::\x7f\x45\x4c\x46\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2b:\xff\xff\xff\xff\xff\xff\xff\xfc\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/libexec/qemu-binfmt/sparc64-binfmt-P:OCPF
:qemu-sparc:M::\x7f\x45\x4c\x46\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x02:\xff\xff\xff\xff\xff\xff\xff\xfc\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/libexec/qemu-binfmt/sparc-binfmt-P:OCPF
:qemu-xtensa:M::\x7f\x45\x4c\x46\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x5e\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/libexec/qemu-binfmt/xtensa-binfmt-P:OCPF
:qemu-xtensaeb:M::\x7f\x45\x4c\x46\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x5e:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/libexec/qemu-binfmt/xtensaeb-binfmt-P:OCPF

Genkernel Initramfs

Avoid showing the following decryption command at boot

vim /usr/share/genkernel/defaults/initrd.scripts

Generate a new initramfs

genkernel --install initramfs

Version-restricted package installation

Install an exact version of sys-kernel/gentoos-sources

Operator Meaning
= Exactly this version
~ Any revision of this version
< Strictly lower than
<= Lower than or equal
> Strictly greater than
>= Greater than or equal
:* Any slot
:slot Specific slot
:= Slot-operator dependency

Install a specific version using the = operator

emerge --ask =sys-kernel/gentoo-sources-6.18.0

Same version, any revision

  • Matches:

  • 6.18.0

  • 6.18.0-r1
  • 6.18.0-r2
    emerge --ask ~sys-kernel/gentoo-sources-6.18.0
    

Allow any revision of a version

emerge --ask ~sys-kernel/gentoo-sources-6.18.0

Install a version lower than 6.18.0

emerge --ask '<sys-kernel/gentoo-sources-6.18.0'

Install version 6.18.0 or lower

emerge --ask '<=sys-kernel/gentoo-sources-6.18.0'

Install version newer than 6.18.0

emerge --ask '>sys-kernel/gentoo-sources-6.18.0'

Install version 6.18.0 or newer

emerge --ask '>=sys-kernel/gentoo-sources-6.18.0'

Install a specific slot

emerge --ask sys-kernel/gentoo-sources:6.18

Follow slot changes automatically

emerge --ask sys-libs/zlib:=

Mask a Specific Kernel Version (Prevent Upgrades)

echo ">sys-kernel/gentoo-sources-6.18.0" > /etc/portage/package.mask/gentoo-sources

Accept an Unstable Kernel Version on Stable Systems

echo "=sys-kernel/gentoo-sources-6.18.0 ~amd64" > /etc/portage/package.accept_keywords/gentoo-sources

Hide the encryption command at initramfs level using genkernel initramfs

Screenshot

Edit /usr/share/genkernel/defaults/initrd.scripts that holds the value on line number 1239

vim /usr/share/genkernel/defaults/initrd.scripts

Now search for: Using the following decryption command: cryptsetup ....

Comment out the line: good_msg "Using the following decryption command: ${1}" ${CRYPT_SILENT} and replace it with: good_msg Unknown cryptsetup method to unlock the device" ${CRYPT_SILENT} and we are ready to go, here is a screenshot how it looks during boot now instead of the above and default one

Update the `good_msg´ to the following line, here is where you should find it and how it should looks for you

crypt_filter() {
    local ask_pass=${2}
#    good_msg "Using the following decryption command: ${1}" ${CRYPT_SILENT}
     good_msg "Unknown cryptsetup method to unlock the device" ${CRYPT_SILENT}
   
    if [ "${CRYPT_SILENT}" = '1' ]
    then
        eval run ${1}
    elif [ "${PLYMOUTH}" = '1' ] && [ ${ask_pass} -eq 1 ]
    then
        local ply_cmd_file="$(mktemp -t 'ply_cmd.XXXXXX' 2>/dev/null)"
        printf '#!/bin/sh\n%s\n' "${1}" > "${ply_cmd_file}"
        run chmod 500 "${ply_cmd_file}"
        plymouthRun ask-for-password --prompt "Enter LUKS passphrase" \
            --number-of-tries=3 --command="${ply_cmd_file}"
        res=$?
        run rm "${ply_cmd_file}" >/dev/null 2>&1
        return ${res}
    else
        splash 'verbose' >/dev/null &
        eval run ${1}
        res=$?
        if [ ${res} -eq 0 ]
        then
            splash set_msg 'Disk unlocked.'
        fi
        return ${res}
    fi  
}   

Screenshot

List what package files belong to

#!/bin/bash
#
#---------------------------------------------------
#
# Script Description
#
# Same as `equery b <bin_file>` but 98% faster 
# `equery b ffprobe` = 12.912s
# `wbelongsto ffprobe = 0.078s
#
#---------------------------------------------------

find_package() {
  target_file="$1"
  pkg_dirs=$(rg -l "$target_file" /var/db/pkg/*/*/CONTENTS)
  for pkg_dir in $pkg_dirs; do
    pkg_name=$(basename $(dirname "$pkg_dir"))
    actual_path=$(rg "$target_file" "$pkg_dir" | awk '{print $2}' | grep -E "^(/usr/bin/|/bin/|/usr/sbin/|/sbin/)")
    
    if [ -n "$actual_path" ]; then
      echo -e " * Searching for \e[92m$target_file\e[0m ..."
      echo -e "\e[92m\e[1m$pkg_name\e[0m (\e[97m\e[1m$actual_path\e[0m)"
      return
    fi
  done
  echo -e " * Searching for \e[92m$target_file\e[0m ..."
  echo -e "\e[91m\e[1mFile does not belong to any package\e[0m"
}

export -f find_package

printf "%s\n" "$@" | xargs -P 4 -I {} bash -c 'find_package "$@"' _ {}

SDDM Xsetup – Set Primary Display with xrandr

cat << "EOF" > /usr/share/sddm/scripts/Xsetup
#!/bin/sh
# Xsetup - run as root before the login dialog appears

export DISPLAY=:0

# Optional: wait for X to initialize
sleep 1

# Set DP3 as primary
xrandr --output DP3 --primary --mode 1920x1080 --pos 0x0 --rotate normal || true
EOF

Happy Hacking!