Β§2023-10-27

  • [systemd/systemd-boot}(https://wiki.gentoo.org/wiki/Systemd/systemd-boot)

systemd-boot, formerly known as gummiboot (rubber dinghy), is a minimal UEFI boot manager.

ΒΆFeatures

  • Bootloader integration with systemd provided by the bootctl command.
  • Ability to select next boot.
  • Easy and simple configuration files which can be generated automatically.
  • Auto add Windows and EFI firmware setup entries.
  • Change timeout, default entry, edit command line options on the fly from the boot menu.

ΒΆ Installation

systemd-boot is included within sys-apps/systemd and, for users of non-systemd-init systems, sys-apps/systemd-utils.

ΒΆ make menuconfig Because systemd-boot can only load EFI executables, the desired kernel must support EFI stub (CONFIG_EFI_STUB=y):

  • KERNEL Enable EFI stub support (CONFIG_EFI_STUB)
Processor type and features  --->
    [*] EFI runtime service support
    [*]   EFI stub support
    [*]     EFI mixed-mode support
Kernel
  • [ ] EFI stub support: This option represents whether or not to include support for the EFI stub loader in the Linux kernel. The EFI stub loader allows the Linux kernel to be loaded directly from an EFI system partition, which is useful for systems with UEFI firmware. In this configuration snippet, this option is not selected, meaning that EFI stub support is disabled in the kernel.

  • [ ] EFI mixed-mode support: This option is related to UEFI mixed mode support, which is a feature that allows systems with UEFI firmware to run in both UEFI and legacy BIOS modes. When this option is selected, it enables support for mixed-mode booting. Mixed-mode booting allows you to boot both UEFI and legacy BIOS operating systems on the same system. In the provided snippet, this option is not selected, indicating that mixed-mode support is disabled in the kernel.

  • if both options are selected, the kernel will support EFI stub loading, and it will also support UEFI mixed-mode booting, making it versatile for different types of UEFI and legacy BIOS systems.

ΒΆsystemd

For versions of systemd >= 254, emerge sys-apps/systemd with the boot USE flag enabled:

emerge --ask app-portage/gentoolkit

(chroot) x8664Arch /usr/src/linux-6.1.57-gentoo # equery --quiet list systemd
sys-apps/systemd-253.11

root #mkdir -p /etc/portage/package.use root #echo "sys-apps/systemd boot" >> /etc/portage/package.use/systemd root #emerge --ask --oneshot --verbose sys-apps/systemd

> --oneshot: This option tells Portage to treat the specified package as a one-time installation, meaning that it won't be added to your system's world file. The world file is a record of installed packages that Portage keeps for managing your system.

¶ Make sure the system is booted with efi support

```bash
(chroot) h2Jammy / # ls /sys/firmware/efi/efivars
Boot0000-8be4df61-93ca-11d2-aa0d-00e098032b8c           ConOut-8be4df61-93ca-11d2-aa0d-00e098032b8c                         MemoryOverwriteRequestControlLock-bb983ccf-151d-40e1-a07b-4a17be168292  SSRAMBASE-9cfa1ece-4488-49be-9a4b-e9b511826577
Boot0001-8be4df61-93ca-11d2-aa0d-00e098032b8c           ConOutDev-8be4df61-93ca-11d2-aa0d-00e098032b8c                      MokListRT-605dab50-e046-4300-abb6-3dd810dd8b23                          SbatLevelRT-605dab50-e046-4300-abb6-3dd810dd8b23
Boot0002-8be4df61-93ca-11d2-aa0d-00e098032b8c           DefaultBootOrder-45cf35f6-0d6e-4d04-856a-0370a5b16f53               MokListTrustedRT-605dab50-e046-4300-abb6-3dd810dd8b23                   SecureBoot-8be4df61-93ca-11d2-aa0d-00e098032b8c
Boot0003-8be4df61-93ca-11d2-aa0d-00e098032b8c           DeploymentModeNv-97e8965f-c761-4f48-b6e4-9ffa9cb2a2d6               MokListXRT-605dab50-e046-4300-abb6-3dd810dd8b23                         SetUpdateCountVar-81c76078-bfde-4368-9790-570914c01a65
Boot0004-8be4df61-93ca-11d2-aa0d-00e098032b8c           EPCBIOS-c60aa7f6-e8d6-4956-8ba1-fe26298f5e87                        MonotonicCounter-01368881-c4ad-4b1d-b631-d57a8ec8db6b                   SetupMode-8be4df61-93ca-11d2-aa0d-00e098032b8c
Boot0005-8be4df61-93ca-11d2-aa0d-00e098032b8c           EfiTime-9d0da369-540b-46f8-85a0-2b5f2c301e15                        OA3MSDMvariable-01368881-c4ad-4b1d-b631-d57a8ec8db6b                    SignatureSupport-8be4df61-93ca-11d2-aa0d-00e098032b8c
Boot0006-8be4df61-93ca-11d2-aa0d-00e098032b8c           ErrOut-8be4df61-93ca-11d2-aa0d-00e098032b8c                         OsIndications-8be4df61-93ca-11d2-aa0d-00e098032b8c                      SmbiosEntryPointTable-4b3082a3-80c6-4d7e-9cd0-583917265df1
Boot0007-8be4df61-93ca-11d2-aa0d-00e098032b8c           ErrOutDev-8be4df61-93ca-11d2-aa0d-00e098032b8c                      OsIndicationsSupported-8be4df61-93ca-11d2-aa0d-00e098032b8c             SmbiosScratchBuffer-4b3082a3-80c6-4d7e-9cd0-583917265df1
Boot0008-8be4df61-93ca-11d2-aa0d-00e098032b8c           FPDT_Volatile-01368881-c4ad-4b1d-b631-d57a8ec8db6b                  PK-8be4df61-93ca-11d2-aa0d-00e098032b8c                                 SmbiosV3EntryPointTable-4b3082a3-80c6-4d7e-9cd0-583917265df1
Boot0009-8be4df61-93ca-11d2-aa0d-00e098032b8c           IBBROBBBase-ec87d643-eba4-4bb5-a1e5-3f3e36b20da9                    PKDefault-8be4df61-93ca-11d2-aa0d-00e098032b8c                          Timeout-8be4df61-93ca-11d2-aa0d-00e098032b8c
Boot000B-8be4df61-93ca-11d2-aa0d-00e098032b8c           ItkBiosModVar-3812723d-7e48-4e29-bc27-f5a39ac94ef1                  PlatformInfo-19ad5244-fd6b-4e5c-826a-414646d6da6a                       VendorKeys-8be4df61-93ca-11d2-aa0d-00e098032b8c
BootCurrent-8be4df61-93ca-11d2-aa0d-00e098032b8c        KEK-8be4df61-93ca-11d2-aa0d-00e098032b8c                            PlatformLang-8be4df61-93ca-11d2-aa0d-00e098032b8c                       WriteOnceStatus-4b3082a3-80c6-4d7e-9cd0-583917265df1
BootOptionSupport-8be4df61-93ca-11d2-aa0d-00e098032b8c  KEKDefault-8be4df61-93ca-11d2-aa0d-00e098032b8c                     PlatformLangCodes-8be4df61-93ca-11d2-aa0d-00e098032b8c                  db-d719b2cb-3d3a-4596-a3bc-dad00e67656f
BootOrder-8be4df61-93ca-11d2-aa0d-00e098032b8c          LoaderSystemToken-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f              PlatformRelatedInfo-fd72b1b5-5391-4c6a-bdfd-9f59a7880a21                dbDefault-8be4df61-93ca-11d2-aa0d-00e098032b8c
ConIn-8be4df61-93ca-11d2-aa0d-00e098032b8c              MaximumTableSize-4b3082a3-80c6-4d7e-9cd0-583917265df1               SLP20Magic-41282ef2-9b5a-4eb7-95d8-d9cd7bdce367                         dbx-d719b2cb-3d3a-4596-a3bc-dad00e67656f
ConInDev-8be4df61-93ca-11d2-aa0d-00e098032b8c           MemoryOverwriteRequestControl-e20939be-32d4-41be-a150-897f85d49829  SOFTWAREGUARDSTATUS-9cb2e73f-7325-40f4-a484-659bb344c3cd                dbxDefault-8be4df61-93ca-11d2-aa0d-00e098032b8c

ΒΆ Note

bootctl will attempt to automatically identify an ESP mounted at /efi, /boot, or /boot/efi (in that order). If the ESP is mounted elsewhere, pass the --esp-path option to specify the appropriate location.

I prefer using /boot/efi

(chroot) h2Jammy / # mkdir /boot/efi
(chroot) h2Jammy / # mount /dev/sdb1 /boot/efi
(chroot) h2Jammy / # bootctl install
Created "/boot/efi/EFI/systemd".
Created "/boot/efi/EFI/BOOT".
Created "/boot/efi/EFI/Linux".
Copied "/usr/lib/systemd/boot/efi/systemd-bootx64.efi" to "/boot/efi/EFI/systemd/systemd-bootx64.efi".
Copied "/usr/lib/systemd/boot/efi/systemd-bootx64.efi" to "/boot/efi/EFI/BOOT/BOOTX64.EFI".
Random seed file /boot/efi/loader/random-seed successfully written (32 bytes).
Created EFI boot entry "Linux Boot Manager".

/boot/
β”œβ”€β”€ efi
β”‚   β”œβ”€β”€ EFI
β”‚   β”‚   β”œβ”€β”€ BOOT
β”‚   β”‚   β”‚   └── BOOTX64.EFI
β”‚   β”‚   β”œβ”€β”€ gentoo
β”‚   β”‚   β”‚   └── grubx64.efi
β”‚   β”‚   β”œβ”€β”€ Linux
β”‚   β”‚   └── systemd
β”‚   β”‚       └── systemd-bootx64.efi
β”‚   β”œβ”€β”€ gentoo
β”‚   β”‚   └── 6.1.57-gentoo-x86_64
β”‚   β”‚       β”œβ”€β”€ initrd
β”‚   β”‚       └── linux
β”‚   └── loader
β”‚       β”œβ”€β”€ entries
β”‚       β”‚   └── gentoo-6.1.57-gentoo-x86_64.conf
β”‚       β”œβ”€β”€ entries.srel
β”‚       β”œβ”€β”€ loader.conf
β”‚       └── random-seed
β”œβ”€β”€ initramfs-6.1.57-gentoo-x86_64.img
β”œβ”€β”€ System.map-6.1.57-gentoo-x86_64
└── vmlinuz-6.1.57-gentoo-x86_64

11 directories, 12 files
  • Main configuration for systemd-boot is done in file /loader/loader.conf of the EFI System Partition (ESP).
(chroot) h2Jammy / # cat /boot/efi/loader/entries/gentoo-6.1.57-gentoo-x86_64.conf 
# Boot Loader Specification type#1 entry
# File created by /usr/lib/kernel/install.d/90-loaderentry.install (systemd 253)
# title      Gentoo Linux
# version    6.1.57-gentoo-x86_64
# sort-key   gentoo
# options    root=UUID=f8023652-925e-46ef-8d10-e6c74d620beb ro quiet splash vt.handoff=7
# linux      /gentoo/6.1.57-gentoo-x86_64/linux
# initrd     /gentoo/6.1.57-gentoo-x86_64/initrd

# Boot Loader Specification type#1 entry
# File created by /usr/lib/kernel/install.d/90-loaderentry.install (systemd 253)
title      Gentoo Linux
version    6.1.57-gentoo-x86_64
sort-key   gentoo
options    root=UUID=4a47f5a1-b321-4b88-8342-b6753403a93c ro quiet splash vt.handoff=7
linux      /vmlinuz-6.1.57-gentoo-x86_64
initrd     /initramfs-6.1.57-gentoo-x86_64.img
  • EFI PE32+ executable files (including kernel EFI stubs) and initramfs files can be placed anywhere in the ESP.
(chroot) h2Jammy / # sudo mouont /dev/sdb1 /boot/efi
bash: sudo: command not found
(chroot) h2Jammy / #  mount /dev/sdb1 /boot/efi
(chroot) h2Jammy / # tree boot/
boot/
β”œβ”€β”€ efi
β”‚   β”œβ”€β”€ EFI
β”‚   β”‚   β”œβ”€β”€ BOOT
β”‚   β”‚   β”‚   └── BOOTX64.EFI
β”‚   β”‚   β”œβ”€β”€ gentoo
β”‚   β”‚   β”‚   └── grubx64.efi
β”‚   β”‚   β”œβ”€β”€ Linux
β”‚   β”‚   └── systemd
β”‚   β”‚       └── systemd-bootx64.efi
β”‚   β”œβ”€β”€ gentoo
β”‚   β”‚   └── 6.1.57-gentoo-x86_64
β”‚   β”‚       β”œβ”€β”€ initrd
β”‚   β”‚       └── linux
β”‚   └── loader
β”‚       β”œβ”€β”€ entries
β”‚       β”‚   └── gentoo-6.1.57-gentoo-x86_64.conf
β”‚       β”œβ”€β”€ entries.srel
β”‚       β”œβ”€β”€ loader.conf
β”‚       └── random-seed
β”œβ”€β”€ initramfs-6.1.57-gentoo-x86_64.img
β”œβ”€β”€ System.map-6.1.57-gentoo-x86_64
└── vmlinuz-6.1.57-gentoo-x86_64

11 directories, 12 files
(chroot) h2Jammy / # grub-install --efi-directory=/boot/efi
Installing for x86_64-efi platform.
Installation finished. No error reported.
(chroot) h2Jammy / # tree boot/
boot/
β”œβ”€β”€ efi
β”‚   β”œβ”€β”€ EFI
β”‚   β”‚   β”œβ”€β”€ BOOT
β”‚   β”‚   β”‚   └── BOOTX64.EFI
β”‚   β”‚   β”œβ”€β”€ gentoo
β”‚   β”‚   β”‚   └── grubx64.efi
β”‚   β”‚   β”œβ”€β”€ Linux
β”‚   β”‚   └── systemd
β”‚   β”‚       └── systemd-bootx64.efi
β”‚   β”œβ”€β”€ gentoo
β”‚   β”‚   └── 6.1.57-gentoo-x86_64
β”‚   β”‚       β”œβ”€β”€ initrd
β”‚   β”‚       └── linux
β”‚   └── loader
β”‚       β”œβ”€β”€ entries
β”‚       β”‚   └── gentoo-6.1.57-gentoo-x86_64.conf
β”‚       β”œβ”€β”€ entries.srel
β”‚       β”œβ”€β”€ loader.conf
β”‚       └── random-seed
β”œβ”€β”€ grub
β”‚   β”œβ”€β”€ fonts
β”‚   β”‚   └── unicode.pf2
β”‚   β”œβ”€β”€ grubenv
β”‚   β”œβ”€β”€ locale
β”‚   β”‚   β”œβ”€β”€ ast.mo
β”‚   β”‚   β”œβ”€β”€ ca.mo
β”‚   β”‚   β”œβ”€β”€ da.mo
β”‚   β”‚   β”œβ”€β”€ de_CH.mo
β”‚   β”‚   β”œβ”€β”€ de@hebrew.mo
β”‚   β”‚   β”œβ”€β”€ de.mo
β”‚   β”‚   β”œβ”€β”€ en@arabic.mo
β”‚   β”‚   β”œβ”€β”€ en@cyrillic.mo
β”‚   β”‚   β”œβ”€β”€ en@greek.mo
β”‚   β”‚   β”œβ”€β”€ en@hebrew.mo
β”‚   β”‚   β”œβ”€β”€ en@piglatin.mo
β”‚   β”‚   β”œβ”€β”€ en@quot.mo
β”‚   β”‚   β”œβ”€β”€ eo.mo
β”‚   β”‚   β”œβ”€β”€ es.mo
β”‚   β”‚   β”œβ”€β”€ fi.mo
β”‚   β”‚   β”œβ”€β”€ fr.mo
β”‚   β”‚   β”œβ”€β”€ gl.mo
β”‚   β”‚   β”œβ”€β”€ hr.mo
β”‚   β”‚   β”œβ”€β”€ hu.mo
β”‚   β”‚   β”œβ”€β”€ id.mo
β”‚   β”‚   β”œβ”€β”€ it.mo
β”‚   β”‚   β”œβ”€β”€ ja.mo
β”‚   β”‚   β”œβ”€β”€ ko.mo
β”‚   β”‚   β”œβ”€β”€ lg.mo
β”‚   β”‚   β”œβ”€β”€ lt.mo
β”‚   β”‚   β”œβ”€β”€ nb.mo
β”‚   β”‚   β”œβ”€β”€ nl.mo
β”‚   β”‚   β”œβ”€β”€ pa.mo
β”‚   β”‚   β”œβ”€β”€ pl.mo
β”‚   β”‚   β”œβ”€β”€ pt_BR.mo
β”‚   β”‚   β”œβ”€β”€ pt.mo
β”‚   β”‚   β”œβ”€β”€ ro.mo
β”‚   β”‚   β”œβ”€β”€ ru.mo
β”‚   β”‚   β”œβ”€β”€ sl.mo
β”‚   β”‚   β”œβ”€β”€ sr.mo
β”‚   β”‚   β”œβ”€β”€ sv.mo
β”‚   β”‚   β”œβ”€β”€ tr.mo
β”‚   β”‚   β”œβ”€β”€ uk.mo
β”‚   β”‚   β”œβ”€β”€ vi.mo
β”‚   β”‚   β”œβ”€β”€ zh_CN.mo
β”‚   β”‚   └── zh_TW.mo
β”‚   β”œβ”€β”€ themes
β”‚   β”‚   └── starfield
β”‚   β”‚       β”œβ”€β”€ blob_w.png
β”‚   β”‚       β”œβ”€β”€ boot_menu_c.png
β”‚   β”‚       β”œβ”€β”€ boot_menu_e.png
β”‚   β”‚       β”œβ”€β”€ boot_menu_ne.png
β”‚   β”‚       β”œβ”€β”€ boot_menu_n.png
β”‚   β”‚       β”œβ”€β”€ boot_menu_nw.png
β”‚   β”‚       β”œβ”€β”€ boot_menu_se.png
β”‚   β”‚       β”œβ”€β”€ boot_menu_s.png
β”‚   β”‚       β”œβ”€β”€ boot_menu_sw.png
β”‚   β”‚       β”œβ”€β”€ boot_menu_w.png
β”‚   β”‚       β”œβ”€β”€ COPYING.CC-BY-SA-3.0
β”‚   β”‚       β”œβ”€β”€ dejavu_10.pf2
β”‚   β”‚       β”œβ”€β”€ dejavu_12.pf2
β”‚   β”‚       β”œβ”€β”€ dejavu_14.pf2
β”‚   β”‚       β”œβ”€β”€ dejavu_16.pf2
β”‚   β”‚       β”œβ”€β”€ dejavu_bold_14.pf2
β”‚   β”‚       β”œβ”€β”€ README
β”‚   β”‚       β”œβ”€β”€ slider_c.png
β”‚   β”‚       β”œβ”€β”€ slider_n.png
β”‚   β”‚       β”œβ”€β”€ slider_s.png
β”‚   β”‚       β”œβ”€β”€ starfield.png
β”‚   β”‚       β”œβ”€β”€ terminal_box_c.png
β”‚   β”‚       β”œβ”€β”€ terminal_box_e.png
β”‚   β”‚       β”œβ”€β”€ terminal_box_ne.png
β”‚   β”‚       β”œβ”€β”€ terminal_box_n.png
β”‚   β”‚       β”œβ”€β”€ terminal_box_nw.png
β”‚   β”‚       β”œβ”€β”€ terminal_box_se.png
β”‚   β”‚       β”œβ”€β”€ terminal_box_s.png
β”‚   β”‚       β”œβ”€β”€ terminal_box_sw.png
β”‚   β”‚       β”œβ”€β”€ terminal_box_w.png
β”‚   β”‚       └── theme.txt
β”‚   └── x86_64-efi
β”‚       β”œβ”€β”€ acpi.mod
β”‚       β”œβ”€β”€ adler32.mod
β”‚       β”œβ”€β”€ affs.mod
β”‚       β”œβ”€β”€ afs.mod
β”‚       β”œβ”€β”€ afsplitter.mod
β”‚       β”œβ”€β”€ ahci.mod
β”‚       β”œβ”€β”€ all_video.mod
β”‚       β”œβ”€β”€ aout.mod
β”‚       β”œβ”€β”€ appleldr.mod
β”‚       β”œβ”€β”€ archelp.mod
β”‚       β”œβ”€β”€ ata.mod
β”‚       β”œβ”€β”€ at_keyboard.mod
β”‚       β”œβ”€β”€ backtrace.mod
β”‚       β”œβ”€β”€ bfs.mod
β”‚       β”œβ”€β”€ bitmap.mod
β”‚       β”œβ”€β”€ bitmap_scale.mod
β”‚       β”œβ”€β”€ blocklist.mod
β”‚       β”œβ”€β”€ boot.mod
β”‚       β”œβ”€β”€ bsd.mod
β”‚       β”œβ”€β”€ bswap_test.mod
β”‚       β”œβ”€β”€ btrfs.mod
β”‚       β”œβ”€β”€ bufio.mod
β”‚       β”œβ”€β”€ cat.mod
β”‚       β”œβ”€β”€ cbfs.mod
β”‚       β”œβ”€β”€ cbls.mod
β”‚       β”œβ”€β”€ cbmemc.mod
β”‚       β”œβ”€β”€ cbtable.mod
β”‚       β”œβ”€β”€ cbtime.mod
β”‚       β”œβ”€β”€ chain.mod
β”‚       β”œβ”€β”€ cmdline_cat_test.mod
β”‚       β”œβ”€β”€ cmp.mod
β”‚       β”œβ”€β”€ cmp_test.mod
β”‚       β”œβ”€β”€ command.lst
β”‚       β”œβ”€β”€ configfile.mod
β”‚       β”œβ”€β”€ core.efi
β”‚       β”œβ”€β”€ cpio_be.mod
β”‚       β”œβ”€β”€ cpio.mod
β”‚       β”œβ”€β”€ cpuid.mod
β”‚       β”œβ”€β”€ crc64.mod
β”‚       β”œβ”€β”€ cryptodisk.mod
β”‚       β”œβ”€β”€ crypto.lst
β”‚       β”œβ”€β”€ crypto.mod
β”‚       β”œβ”€β”€ cs5536.mod
β”‚       β”œβ”€β”€ ctz_test.mod
β”‚       β”œβ”€β”€ datehook.mod
β”‚       β”œβ”€β”€ date.mod
β”‚       β”œβ”€β”€ datetime.mod
β”‚       β”œβ”€β”€ diskfilter.mod
β”‚       β”œβ”€β”€ disk.mod
β”‚       β”œβ”€β”€ div.mod
β”‚       β”œβ”€β”€ div_test.mod
β”‚       β”œβ”€β”€ dm_nv.mod
β”‚       β”œβ”€β”€ echo.mod
β”‚       β”œβ”€β”€ efifwsetup.mod
β”‚       β”œβ”€β”€ efi_gop.mod
β”‚       β”œβ”€β”€ efinet.mod
β”‚       β”œβ”€β”€ efi_uga.mod
β”‚       β”œβ”€β”€ ehci.mod
β”‚       β”œβ”€β”€ elf.mod
β”‚       β”œβ”€β”€ eval.mod
β”‚       β”œβ”€β”€ exfat.mod
β”‚       β”œβ”€β”€ exfctest.mod
β”‚       β”œβ”€β”€ ext2.mod
β”‚       β”œβ”€β”€ extcmd.mod
β”‚       β”œβ”€β”€ f2fs.mod
β”‚       β”œβ”€β”€ fat.mod
β”‚       β”œβ”€β”€ file.mod
β”‚       β”œβ”€β”€ fixvideo.mod
β”‚       β”œβ”€β”€ font.mod
β”‚       β”œβ”€β”€ fshelp.mod
β”‚       β”œβ”€β”€ fs.lst
β”‚       β”œβ”€β”€ functional_test.mod
β”‚       β”œβ”€β”€ gcry_arcfour.mod
β”‚       β”œβ”€β”€ gcry_blowfish.mod
β”‚       β”œβ”€β”€ gcry_camellia.mod
β”‚       β”œβ”€β”€ gcry_cast5.mod
β”‚       β”œβ”€β”€ gcry_crc.mod
β”‚       β”œβ”€β”€ gcry_des.mod
β”‚       β”œβ”€β”€ gcry_dsa.mod
β”‚       β”œβ”€β”€ gcry_idea.mod
β”‚       β”œβ”€β”€ gcry_md4.mod
β”‚       β”œβ”€β”€ gcry_md5.mod
β”‚       β”œβ”€β”€ gcry_rfc2268.mod
β”‚       β”œβ”€β”€ gcry_rijndael.mod
β”‚       β”œβ”€β”€ gcry_rmd160.mod
β”‚       β”œβ”€β”€ gcry_rsa.mod
β”‚       β”œβ”€β”€ gcry_seed.mod
β”‚       β”œβ”€β”€ gcry_serpent.mod
β”‚       β”œβ”€β”€ gcry_sha1.mod
β”‚       β”œβ”€β”€ gcry_sha256.mod
β”‚       β”œβ”€β”€ gcry_sha512.mod
β”‚       β”œβ”€β”€ gcry_tiger.mod
β”‚       β”œβ”€β”€ gcry_twofish.mod
β”‚       β”œβ”€β”€ gcry_whirlpool.mod
β”‚       β”œβ”€β”€ geli.mod
β”‚       β”œβ”€β”€ gettext.mod
β”‚       β”œβ”€β”€ gfxmenu.mod
β”‚       β”œβ”€β”€ gfxterm_background.mod
β”‚       β”œβ”€β”€ gfxterm_menu.mod
β”‚       β”œβ”€β”€ gfxterm.mod
β”‚       β”œβ”€β”€ gptsync.mod
β”‚       β”œβ”€β”€ grub.efi
β”‚       β”œβ”€β”€ gzio.mod
β”‚       β”œβ”€β”€ halt.mod
β”‚       β”œβ”€β”€ hashsum.mod
β”‚       β”œβ”€β”€ hdparm.mod
β”‚       β”œβ”€β”€ hello.mod
β”‚       β”œβ”€β”€ help.mod
β”‚       β”œβ”€β”€ hexdump.mod
β”‚       β”œβ”€β”€ hfs.mod
β”‚       β”œβ”€β”€ hfspluscomp.mod
β”‚       β”œβ”€β”€ hfsplus.mod
β”‚       β”œβ”€β”€ http.mod
β”‚       β”œβ”€β”€ iorw.mod
β”‚       β”œβ”€β”€ iso9660.mod
β”‚       β”œβ”€β”€ jfs.mod
β”‚       β”œβ”€β”€ jpeg.mod
β”‚       β”œβ”€β”€ json.mod
β”‚       β”œβ”€β”€ keylayouts.mod
β”‚       β”œβ”€β”€ keystatus.mod
β”‚       β”œβ”€β”€ ldm.mod
β”‚       β”œβ”€β”€ legacycfg.mod
β”‚       β”œβ”€β”€ legacy_password_test.mod
β”‚       β”œβ”€β”€ linux16.mod
β”‚       β”œβ”€β”€ linux.mod
β”‚       β”œβ”€β”€ loadbios.mod
β”‚       β”œβ”€β”€ loadenv.mod
β”‚       β”œβ”€β”€ loopback.mod
β”‚       β”œβ”€β”€ lsacpi.mod
β”‚       β”œβ”€β”€ lsefimmap.mod
β”‚       β”œβ”€β”€ lsefi.mod
β”‚       β”œβ”€β”€ lsefisystab.mod
β”‚       β”œβ”€β”€ lsmmap.mod
β”‚       β”œβ”€β”€ ls.mod
β”‚       β”œβ”€β”€ lspci.mod
β”‚       β”œβ”€β”€ lssal.mod
β”‚       β”œβ”€β”€ luks2.mod
β”‚       β”œβ”€β”€ luks.mod
β”‚       β”œβ”€β”€ lvm.mod
β”‚       β”œβ”€β”€ lzopio.mod
β”‚       β”œβ”€β”€ macbless.mod
β”‚       β”œβ”€β”€ macho.mod
β”‚       β”œβ”€β”€ mdraid09_be.mod
β”‚       β”œβ”€β”€ mdraid09.mod
β”‚       β”œβ”€β”€ mdraid1x.mod
β”‚       β”œβ”€β”€ memdisk.mod
β”‚       β”œβ”€β”€ memrw.mod
β”‚       β”œβ”€β”€ minicmd.mod
β”‚       β”œβ”€β”€ minix2_be.mod
β”‚       β”œβ”€β”€ minix2.mod
β”‚       β”œβ”€β”€ minix3_be.mod
β”‚       β”œβ”€β”€ minix3.mod
β”‚       β”œβ”€β”€ minix_be.mod
β”‚       β”œβ”€β”€ minix.mod
β”‚       β”œβ”€β”€ mmap.mod
β”‚       β”œβ”€β”€ moddep.lst
β”‚       β”œβ”€β”€ modinfo.sh
β”‚       β”œβ”€β”€ morse.mod
β”‚       β”œβ”€β”€ mpi.mod
β”‚       β”œβ”€β”€ msdospart.mod
β”‚       β”œβ”€β”€ mul_test.mod
β”‚       β”œβ”€β”€ multiboot2.mod
β”‚       β”œβ”€β”€ multiboot.mod
β”‚       β”œβ”€β”€ nativedisk.mod
β”‚       β”œβ”€β”€ net.mod
β”‚       β”œβ”€β”€ newc.mod
β”‚       β”œβ”€β”€ nilfs2.mod
β”‚       β”œβ”€β”€ normal.mod
β”‚       β”œβ”€β”€ ntfscomp.mod
β”‚       β”œβ”€β”€ ntfs.mod
β”‚       β”œβ”€β”€ odc.mod
β”‚       β”œβ”€β”€ offsetio.mod
β”‚       β”œβ”€β”€ ohci.mod
β”‚       β”œβ”€β”€ part_acorn.mod
β”‚       β”œβ”€β”€ part_amiga.mod
β”‚       β”œβ”€β”€ part_apple.mod
β”‚       β”œβ”€β”€ part_bsd.mod
β”‚       β”œβ”€β”€ part_dfly.mod
β”‚       β”œβ”€β”€ part_dvh.mod
β”‚       β”œβ”€β”€ part_gpt.mod
β”‚       β”œβ”€β”€ partmap.lst
β”‚       β”œβ”€β”€ part_msdos.mod
β”‚       β”œβ”€β”€ part_plan.mod
β”‚       β”œβ”€β”€ part_sun.mod
β”‚       β”œβ”€β”€ part_sunpc.mod
β”‚       β”œβ”€β”€ parttool.lst
β”‚       β”œβ”€β”€ parttool.mod
β”‚       β”œβ”€β”€ password.mod
β”‚       β”œβ”€β”€ password_pbkdf2.mod
β”‚       β”œβ”€β”€ pata.mod
β”‚       β”œβ”€β”€ pbkdf2.mod
β”‚       β”œβ”€β”€ pbkdf2_test.mod
β”‚       β”œβ”€β”€ pcidump.mod
β”‚       β”œβ”€β”€ pgp.mod
β”‚       β”œβ”€β”€ play.mod
β”‚       β”œβ”€β”€ png.mod
β”‚       β”œβ”€β”€ priority_queue.mod
β”‚       β”œβ”€β”€ probe.mod
β”‚       β”œβ”€β”€ procfs.mod
β”‚       β”œβ”€β”€ progress.mod
β”‚       β”œβ”€β”€ raid5rec.mod
β”‚       β”œβ”€β”€ raid6rec.mod
β”‚       β”œβ”€β”€ random.mod
β”‚       β”œβ”€β”€ rdmsr.mod
β”‚       β”œβ”€β”€ read.mod
β”‚       β”œβ”€β”€ reboot.mod
β”‚       β”œβ”€β”€ regexp.mod
β”‚       β”œβ”€β”€ reiserfs.mod
β”‚       β”œβ”€β”€ relocator.mod
β”‚       β”œβ”€β”€ romfs.mod
β”‚       β”œβ”€β”€ scsi.mod
β”‚       β”œβ”€β”€ search_fs_file.mod
β”‚       β”œβ”€β”€ search_fs_uuid.mod
β”‚       β”œβ”€β”€ search_label.mod
β”‚       β”œβ”€β”€ search.mod
β”‚       β”œβ”€β”€ serial.mod
β”‚       β”œβ”€β”€ setjmp.mod
β”‚       β”œβ”€β”€ setjmp_test.mod
β”‚       β”œβ”€β”€ setpci.mod
β”‚       β”œβ”€β”€ sfs.mod
β”‚       β”œβ”€β”€ shift_test.mod
β”‚       β”œβ”€β”€ signature_test.mod
β”‚       β”œβ”€β”€ sleep.mod
β”‚       β”œβ”€β”€ sleep_test.mod
β”‚       β”œβ”€β”€ smbios.mod
β”‚       β”œβ”€β”€ spkmodem.mod
β”‚       β”œβ”€β”€ squash4.mod
β”‚       β”œβ”€β”€ strtoull_test.mod
β”‚       β”œβ”€β”€ syslinuxcfg.mod
β”‚       β”œβ”€β”€ tar.mod
β”‚       β”œβ”€β”€ terminal.lst
β”‚       β”œβ”€β”€ terminal.mod
β”‚       β”œβ”€β”€ terminfo.mod
β”‚       β”œβ”€β”€ test_blockarg.mod
β”‚       β”œβ”€β”€ testload.mod
β”‚       β”œβ”€β”€ test.mod
β”‚       β”œβ”€β”€ testspeed.mod
β”‚       β”œβ”€β”€ tftp.mod
β”‚       β”œβ”€β”€ tga.mod
β”‚       β”œβ”€β”€ time.mod
β”‚       β”œβ”€β”€ tpm.mod
β”‚       β”œβ”€β”€ trig.mod
β”‚       β”œβ”€β”€ tr.mod
β”‚       β”œβ”€β”€ true.mod
β”‚       β”œβ”€β”€ udf.mod
β”‚       β”œβ”€β”€ ufs1_be.mod
β”‚       β”œβ”€β”€ ufs1.mod
β”‚       β”œβ”€β”€ ufs2.mod
β”‚       β”œβ”€β”€ uhci.mod
β”‚       β”œβ”€β”€ usb_keyboard.mod
β”‚       β”œβ”€β”€ usb.mod
β”‚       β”œβ”€β”€ usbms.mod
β”‚       β”œβ”€β”€ usbserial_common.mod
β”‚       β”œβ”€β”€ usbserial_ftdi.mod
β”‚       β”œβ”€β”€ usbserial_pl2303.mod
β”‚       β”œβ”€β”€ usbserial_usbdebug.mod
β”‚       β”œβ”€β”€ usbtest.mod
β”‚       β”œβ”€β”€ video_bochs.mod
β”‚       β”œβ”€β”€ video_cirrus.mod
β”‚       β”œβ”€β”€ video_colors.mod
β”‚       β”œβ”€β”€ video_fb.mod
β”‚       β”œβ”€β”€ videoinfo.mod
β”‚       β”œβ”€β”€ video.lst
β”‚       β”œβ”€β”€ video.mod
β”‚       β”œβ”€β”€ videotest_checksum.mod
β”‚       β”œβ”€β”€ videotest.mod
β”‚       β”œβ”€β”€ wrmsr.mod
β”‚       β”œβ”€β”€ xfs.mod
β”‚       β”œβ”€β”€ xnu.mod
β”‚       β”œβ”€β”€ xnu_uuid.mod
β”‚       β”œβ”€β”€ xnu_uuid_test.mod
β”‚       β”œβ”€β”€ xzio.mod
β”‚       β”œβ”€β”€ zfscrypt.mod
β”‚       β”œβ”€β”€ zfsinfo.mod
β”‚       β”œβ”€β”€ zfs.mod
β”‚       └── zstd.mod
β”œβ”€β”€ initramfs-6.1.57-gentoo-x86_64.img
β”œβ”€β”€ System.map-6.1.57-gentoo-x86_64
└── vmlinuz-6.1.57-gentoo-x86_64

17 directories, 362 files
(chroot) h2Jammy / #

ΒΆ

(chroot) x8664Arch / # grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-6.1.57-gentoo-x86_64
Found initrd image: /boot/initramfs-6.1.57-gentoo-x86_64.img
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
Adding boot menu entry for UEFI Firmware Settings ...
done

(chroot) x8664Arch / # cat /boot/grub/grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_gpt
insmod ext2
set root='hd1,gpt3'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt3 --hint-efi=hd1,gpt3 --hint-baremetal=ahci1,gpt3  4a47f5a1-b321-4b88-8342-b6753403a93c
else
  search --no-floppy --fs-uuid --set=root 4a47f5a1-b321-4b88-8342-b6753403a93c
fi
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=en_US
  insmod gettext
fi
terminal_output gfxterm
if [ x$feature_timeout_style = xy ] ; then
  set timeout_style=menu
  set timeout=5
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
  set timeout=5
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Gentoo GNU/Linux' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-4a47f5a1-b321-4b88-8342-b6753403a93c' {
	load_video
	if [ "x$grub_platform" = xefi ]; then
		set gfxpayload=keep
	fi
	insmod gzio
	insmod part_gpt
	insmod ext2
	set root='hd1,gpt3'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt3 --hint-efi=hd1,gpt3 --hint-baremetal=ahci1,gpt3  4a47f5a1-b321-4b88-8342-b6753403a93c
	else
	  search --no-floppy --fs-uuid --set=root 4a47f5a1-b321-4b88-8342-b6753403a93c
	fi
	echo	'Loading Linux 6.1.57-gentoo-x86_64 ...'
	linux	/boot/vmlinuz-6.1.57-gentoo-x86_64 root=UUID=4a47f5a1-b321-4b88-8342-b6753403a93c ro  
	echo	'Loading initial ramdisk ...'
	initrd	/boot/initramfs-6.1.57-gentoo-x86_64.img
}
submenu 'Advanced options for Gentoo GNU/Linux' $menuentry_id_option 'gnulinux-advanced-4a47f5a1-b321-4b88-8342-b6753403a93c' {
	menuentry 'Gentoo GNU/Linux, with Linux 6.1.57-gentoo-x86_64' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-6.1.57-gentoo-x86_64-advanced-4a47f5a1-b321-4b88-8342-b6753403a93c' {
		load_video
		if [ "x$grub_platform" = xefi ]; then
			set gfxpayload=keep
		fi
		insmod gzio
		insmod part_gpt
		insmod ext2
		set root='hd1,gpt3'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt3 --hint-efi=hd1,gpt3 --hint-baremetal=ahci1,gpt3  4a47f5a1-b321-4b88-8342-b6753403a93c
		else
		  search --no-floppy --fs-uuid --set=root 4a47f5a1-b321-4b88-8342-b6753403a93c
		fi
		echo	'Loading Linux 6.1.57-gentoo-x86_64 ...'
		linux	/boot/vmlinuz-6.1.57-gentoo-x86_64 root=UUID=4a47f5a1-b321-4b88-8342-b6753403a93c ro  
		echo	'Loading initial ramdisk ...'
		initrd	/boot/initramfs-6.1.57-gentoo-x86_64.img
	}
	menuentry 'Gentoo GNU/Linux, with Linux 6.1.57-gentoo-x86_64 (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-6.1.57-gentoo-x86_64-recovery-4a47f5a1-b321-4b88-8342-b6753403a93c' {
		load_video
		if [ "x$grub_platform" = xefi ]; then
			set gfxpayload=keep
		fi
		insmod gzio
		insmod part_gpt
		insmod ext2
		set root='hd1,gpt3'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt3 --hint-efi=hd1,gpt3 --hint-baremetal=ahci1,gpt3  4a47f5a1-b321-4b88-8342-b6753403a93c
		else
		  search --no-floppy --fs-uuid --set=root 4a47f5a1-b321-4b88-8342-b6753403a93c
		fi
		echo	'Loading Linux 6.1.57-gentoo-x86_64 ...'
		linux	/boot/vmlinuz-6.1.57-gentoo-x86_64 root=UUID=4a47f5a1-b321-4b88-8342-b6753403a93c ro single 
		echo	'Loading initial ramdisk ...'
		initrd	/boot/initramfs-6.1.57-gentoo-x86_64.img
	}
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###

### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_uefi-firmware ###
menuentry 'UEFI Firmware Settings' $menuentry_id_option 'uefi-firmware' {
	fwsetup
}
### END /etc/grub.d/30_uefi-firmware ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg
fi
### END /etc/grub.d/41_custom ###
¶ set up alexlai

(chroot) h2Jammy / # useradd -u 1026 -m -G wheel,video alexlai (chroot) h2Jammy / # passwd alexlai (chroot) h2Jammy / # passwd root


¶dhcpcd

```bash
(chroot) h2Jammy / # emerge net-misc/dhcpc
(chroot) h2Jammy / # emerge net-misc/openssh

Booting From grub>

This is how to set the boot files and boot the system from the grub> prompt. We know from running the ls command that there is a Linux root filesystem on (hd0,1), and you can keep searching until you verify where /boot/grub is. Then run these commands, using your own root partition, kernel, and initrd image:

grub> ls
(hd0) (hd0,gpt3) (hd0,gpt2) (hd0,gpt1) (hd1) (hd1,gpt3)) (hd1,gpt2)) (hd1,gpt1)
grub> set root=(hd1,gpt3)
grub> linux /boot/vmlinuz-6.1.57-genyoo-x86_64 root=/dev/sdb3
grub> initrd /boot/initramfs-6.1.57-genyoo-x86_64.img
grub> boot

The first line sets the partition that the root filesystem is on. The second line tells GRUB the location of the kernel you want to use. Start typing /boot/vmli, and then use tab-completion to fill in the rest. Type root=/dev/sdX to set the location of the root filesystem. Yes, this seems redundant, but if you leave this out you’ll get a kernel panic. How do you know the correct partition? hd0,1 = /dev/sda1. hd1,1 = /dev/sdb1. hd3,2 = /dev/sdd2. I think you can extrapolate the rest.

The third line sets the initrd file, which must be the same version number as the kernel.

The fourth line boots your system.
Return to Top