Booster 是一個快速的initramfs生成器,類似於mkinitcpio和dracut。 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 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.
/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"錯誤
如果啟用了 strip
和 universal
,並出現類似 /usr/lib/modules/glue_helper.ko: pipe2: too many open files
的錯誤,則需要增加每個進程的打開文件限制。請參見Limits.conf#nofile。