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

Configuration[编辑 | 编辑源代码]

Booster's generator configuration file is located at /etc/booster.yaml. If there is no configuration file then the default configuration (host-specific images, no network) is used.

The configuration file helps to override the default behaviour. See booster(1) § CONFIG FILE for detailed information.

Early module loading[编辑 | 编辑源代码]

There are situations when some kernel modules need to be loaded early, at initramfs stage.

For example, if you need to load the nvidia module, then use the following configuration setting:

/etc/booster.yaml
modules_force_load: nvidia

And then regenerate booster images.

Encryption[编辑 | 编辑源代码]

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

Regenerate booster images[编辑 | 编辑源代码]

Once you are done with configuring Booster, you need to update Booster images at /boot. An image can be generated manually with booster build booster-foo.img or using a convenience script /usr/lib/booster/regenerate_images that iterates over all installed kernels and generates a Booster image for each of them.

Boot loader configuration[编辑 | 编辑源代码]

Once the image is generated it is time to configure the boot loader.

rEFInd[编辑 | 编辑源代码]

If the configuration relies on automatic detection already, no additional configuration change is necessary. rEFInd supports initrd files named booster*.

If you specify the initramfs path manually, either in refind.conf or in manual boot stanzas, make sure to use the correct files names. I.e. booster-linux.img instead of initramfs-linux.img.

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

To enable the new initramfs image with systemd-boot simply create a new boot loader entry like this one:

/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

Where the root filesystem is referenced by UUID=08f83949-bcbb-47bb-bc17-089aaa59e17e. To find your root device UUID run blkid /dev/ROOTDEVICE.

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

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

如果 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

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