Skip to content

04-bootloader.sh

Interactive bootloader management for the MacBook Air 2020 running CachyOS with Limine. Provides boot status display, kernel cmdline updates, optional rEFInd installation, EFI boot order management, and a BTRFS snapshot boot guide.

Usage

bash
# Interactive menu
sudo bash scripts/04-bootloader.sh

# Direct subcommands
bash scripts/04-bootloader.sh status
sudo bash scripts/04-bootloader.sh cmdline
sudo bash scripts/04-bootloader.sh refind
sudo bash scripts/04-bootloader.sh bootorder
bash scripts/04-bootloader.sh snapshots

# Preview without changes
sudo bash scripts/04-bootloader.sh --dry-run
bash scripts/04-bootloader.sh --help
FlagDescription
--dry-runPreview all actions without modifying the system
--helpShow usage information and exit

Subcommands

CommandRootDescription
statusNoShow current boot config: Limine version, EFI entries, kernel, snapshots, cmdline
cmdlineYesUpdate /etc/kernel/cmdline with recommended MacBook Air 2020 parameters
refindYesInstall rEFInd as a secondary graphical boot picker alongside Limine
bootorderYesManage EFI boot order between CachyOS, macOS, and other OSes
snapshotsNoDisplay BTRFS snapshot boot guide and list current snapshots

Limine vs rEFInd

FeatureLimine (current)rEFInd
BTRFS snapshot bootingNative via limine-snapper-syncNot supported
Kernel auto-detectionVia limine-entry-toolAuto-scans ESP
Graphical boot menuText-basedGraphical with mouse
macOS dual-bootVia EFI variablesAuto-detects macOS
CachyOS integrationNativeManual config

The script recommends keeping Limine as primary and installing rEFInd as a secondary option accessible via the Option key at startup.

Boot Order Management

EFI boot entry IDs are detected dynamically from efibootmgr output — no hardcoded IDs. Options include:

  • Boot into macOS once (next boot only, then reverts)
  • Boot into CachyOS next
  • Set a permanent boot order
  • Show all EFI entries with details

BTRFS Snapshot Booting

To boot from a snapshot:

  1. Hold Space at the Limine splash screen
  2. Select CachyOS then Snapshots
  3. Choose a snapshot by date and description

To roll back permanently: sudo snapper rollback <number> then reboot.

Files Modified

PathPurpose
/etc/kernel/cmdlineKernel parameters (cmdline subcommand)
/boot/limine.confRegenerated by limine-entry-tool (not edited directly)
/boot/EFI/refind/refind.confrEFInd config (refind subcommand)

Prerequisites

  • efibootmgr (for boot order management)
  • limine-entry-tool (for cmdline regeneration)
  • snapper (for snapshot listing)

Source

View the full source on GitHub.