automate/010_grub-commandline_zfsboo...

30 lines
2.1 KiB
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bash
: <<!
"We hardcode the GRUB_CMDLINE_LINUX_DEFAULT options for zbm in 020_grub_zbm_payload.sh"
!
exit 1
# | Parameter | Purpose | Notes |
# | --------------------------- | -------------------------------------------------- | ----------------------------------------------------------------- |
# | zbm.prefer=<pool> | Tells ZBM which ZFS pool to import first | Highly recommended if you have multiple zpools or bootable clones |
# | zbm.import_delay=<seconds> | Adds a startup delay before auto-importing pools | Useful for slow disks or sparse device init |
# | zbm.readonly=1 | Forces all imports readonly | For emergency/recovery boot entries |
# | zbm.timeout=<sec> | Default menu timeout | Optional override of ZBMs own internal timeout |
# | zbm.skip=<boolean> | Skip pool discovery, assume youll import manually | Optional, advanced |
# | loglevel=<n> | Controls kernel verbosity | 4 is a balanced choice; 7 for deep debugging |
# | rd.vconsole.keymap=<keymap> | Keyboard layout for early TTY | Optional, good for nonUS systems |
# | rd.vconsole.font=<font> | Sets framebuffer console font (e.g. ter-124n) | Helps when small fonts are hard to read on hires screens |
# Define arguments to add
# Font sizes : ter-v32n ter-v28n ter-v24n ter-v20n ter-v14n
# Font sizes bold: ter-v32b ter-v28b ter-v24b ter-v20b ter-v14b
NEWARG=("rd.vconsole.font=ter-124n" "zbm.prefer=rpool" "loglevel=4" "zbm.import_delay=5")
# Loop through each argument and append to GRUB_CMDLINE_LINUX_DEFAULT
for arg in "${NEWARG[@]}"; do
sudo sed -i -E "s|^(GRUB_CMDLINE_LINUX_DEFAULT=\"[^\"]*)\"|\1 ${arg}\"|" /etc/default/grub
done
# Update GRUB
sudo update-grub