跳转到内容

Booster

来自 Arch Linux 中文维基

本文或本节需要翻译。要贡献翻译,请访问简体中文翻译团队

附注: 需要翻译。(在 Talk:Booster# 中讨论)

Booster 是一个快速的initramfs生成器,类似于mkinitcpiodracut。 Booster 的灵感来源于"distri" 项目,旨在创建小而快的启动映像。

Booster 提供了 /usr/bin/booster 用户空间工具,以生成 initramfs 映像。生成的映像默认位于 /boot/

安装[编辑 | 编辑源代码]

安装 booster。软件包安装钩子会生成 initramfs 镜像,每个已安装的内核生成一个镜像(例如 linux, {linux-lts)。镜像文件位于 /boot 目录下:

$ ls -lh /boot/booster*
-rwxr-xr-x 1 root root 4.0M Dec 16 16:20 /boot/booster-linux.img

也可以手动创建镜像:

$ booster build mybooster.img

配置[编辑 | 编辑源代码]

Booster 配置文件位于 /etc/booster.yaml。如果文件为空,那么booster将会使用默认配置 (host-specific images, no network)。配置详见 booster(1) § CONFIG FILE

早期加载内核模块[编辑 | 编辑源代码]

有时,一些内核模块需要在 initramfs 阶段加载。

例如,当你需要加载 nvidia 模块时,可以在配置文件中采取以下设置:

/etc/booster.yaml
modules_force_load: nvidia

然后#重新生成 booster 镜像

加密[编辑 | 编辑源代码]

Booster supports LUKS based full-disk encryption out-of-the-box like Clevis. The generator does not need any extra configuration. Yet, for the initramfs you need to append information about the LUKS partition where the root resides. This is done with either rd.luks.uuid=LUKSUUID or rd.luks.name=LUKSUUID=LUKSNAME kernel parameter that need to be specified in the boot loader configuration file. LUKSUUID specifies the UUID of the encrypted LUKS partition that needs to be unlocked by Booster. The booster(1) § UUID parameters manual recommends that the UUID does not contain any quotes. LUKSNAME specifies name of the unlocked partition (as in /dev/mapper/LUKSNAME). See booster(1) § BOOT TIME KERNEL PARAMETERS for related options.

No image rebuild is required. Once the boot loader configuration is done, reboot the computer. After that you will see a Enter passphrase for YOURROOT: prompt at boot time asking for a password for the encrypted root partition.

systemd style binding[编辑 | 编辑源代码]

Booster also supports partitions bound with systemd such as systemd-fido2 and systemd-tpm2.

If you use `systemd-fido2` then please install libfido2 package and add fido2-assert to the image using following configuration:

/etc/booster.yaml
extra_files: fido2-assert

Regenerate the booster images. Booster will detect this configuration during boot and use the present YubiKey to unlock the drive.

注意:Before commit 1b65577, it has been reported Booster may not load some necessary kernel modules early enough to unlock encrypted partitions with a FIDO2 key. In this case, add the following modules to be forcibly loaded:
/etc/booster.yaml
modules_force_load: usbhid,hid_sensor_hub
extra_files: fido2-assert

重新生成 booster 镜像[编辑 | 编辑源代码]

完成 Booster 配置后,需要更新 /boot 中的 Booster 镜像。可以使用 booster build booster-foo.img 手动生成镜像,也可以使用便捷脚本 /usr/lib/booster/regenerate_images 遍历所有已安装的内核,为每个内核生成 Booster 镜像。

引导加载程序配置[编辑 | 编辑源代码]

生成映像后,就该配置引导加载程序了。

rEFInd[编辑 | 编辑源代码]

如果配置已经依赖于自动检测],则无需额外更改配置。rEFInd 支持 initrd 文件命名为 booster*

如果在refind.conf 手动启动项中手动指定 initramfs 路径,请确保使用正确的文件名。例如,booster-linux.img 而不是 initramfs-linux.img

systemd-boot[编辑 | 编辑源代码]

要使用 systemd-boot 启用新的 initramfs 映像,只需像这样创建一个新的引导加载器条目:

/boot/loader/entries/booster.conf
title Arch Linux with booster
linux /vmlinuz-linux
initrd /booster-linux.img
options root=UUID=08f83949-bcbb-47bb-bc17-089aaa59e17e rw

根文件系统在 UUID=08f83949-bcbb-47bb-bc17-089aaa59e17e。运行 blkid /dev/ROOTDEVICE 查找您的根设备 UUID。

问题解决[编辑 | 编辑源代码]

调试[编辑 | 编辑源代码]

如果 Booster 出现问题,不能按预期运行,请启用调试信息输出,以提供更多信息说明发生了什么:

  • 对于生成器,有一个 -debug 命令行参数: booster -debug
  • 对于 init,有一个 boost.debug 内核参数

如果您认为这是 Booster 本身的问题,那么请在 GitHub 上提交ticket

Booster生成器出现 "too many open files"错误[编辑 | 编辑源代码]

如果启用了 stripuniversal,并出现类似 /usr/lib/modules/glue_helper.ko: pipe2: too many open files 的错误,则需要增加每个进程的打开文件限制。请参见Limits.conf#nofile

参见[编辑 | 编辑源代码]