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| Flag | Description |
|---|---|
--dry-run | Preview all actions without modifying the system |
--help | Show usage information and exit |
Subcommands
| Command | Root | Description |
|---|---|---|
status | No | Show current boot config: Limine version, EFI entries, kernel, snapshots, cmdline |
cmdline | Yes | Update /etc/kernel/cmdline with recommended MacBook Air 2020 parameters |
refind | Yes | Install rEFInd as a secondary graphical boot picker alongside Limine |
bootorder | Yes | Manage EFI boot order between CachyOS, macOS, and other OSes |
snapshots | No | Display BTRFS snapshot boot guide and list current snapshots |
Limine vs rEFInd
| Feature | Limine (current) | rEFInd |
|---|---|---|
| BTRFS snapshot booting | Native via limine-snapper-sync | Not supported |
| Kernel auto-detection | Via limine-entry-tool | Auto-scans ESP |
| Graphical boot menu | Text-based | Graphical with mouse |
| macOS dual-boot | Via EFI variables | Auto-detects macOS |
| CachyOS integration | Native | Manual 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:
- Hold Space at the Limine splash screen
- Select CachyOS then Snapshots
- Choose a snapshot by date and description
To roll back permanently: sudo snapper rollback <number> then reboot.
Files Modified
| Path | Purpose |
|---|---|
/etc/kernel/cmdline | Kernel parameters (cmdline subcommand) |
/boot/limine.conf | Regenerated by limine-entry-tool (not edited directly) |
/boot/EFI/refind/refind.conf | rEFInd 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.