Skip to content

Gracefully handle installations on ZFS file systems#5938

Open
berenddeboer wants to merge 8 commits into
basecamp:devfrom
berenddeboer:feat/omarchy-on-zfs-pr
Open

Gracefully handle installations on ZFS file systems#5938
berenddeboer wants to merge 8 commits into
basecamp:devfrom
berenddeboer:feat/omarchy-on-zfs-pr

Conversation

@berenddeboer
Copy link
Copy Markdown

Summary

  • Recognize ZFS as a supported existing root filesystem during install preflight.
  • Preserve an existing [archzfs] pacman repo when Omarchy replaces pacman config.
  • Use ZFS-aware Limine/mkinitcpio hooks on ZFS roots while keeping Snapper setup on Btrfs roots.
  • Embed /etc/hostid in the ZFS initramfs so imported pools continue to boot reliably.
  • Skip Btrfs-only hibernation setup on non-Btrfs roots.
  • Create omarchy-* ZFS snapshots for ZFS roots and retain the newest five snapshots; keep the existing Snapper snapshot path for non-ZFS roots.

This does not enable or install ZFS. It only keeps Omarchy from rejecting or breaking an already configured ZFS-root system, preserves the ZFS boot requirements, and lets Omarchy's snapshot command create root dataset snapshots on those systems.

Tests

  • Installed on standard Arch with ZFS: working.
  • Installed on patched omarchy-iso repo: working, PR here.
  • Installed and running in actual Dell XPS 14 2026.
  • Tested on CachyOS: not working without this patch and still not working with this patch due to unrelated reasons.

ISO

A full test ISO is available here: https://www.berenddeboer.net/tmp/omarchy-2026.05.14-x86_64-master.iso

Replaces #5637.

berenddeboer and others added 8 commits May 20, 2026 08:36
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
ZFS root pools record a hostid, and UKIs rebuilt without /etc/hostid can fail to import the pool during early boot. Add a ZFS-only mkinitcpio drop-in so limine-mkinitcpio includes the installed system hostid before generating boot artifacts.
Copilot AI review requested due to automatic review settings May 21, 2026 22:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR refactors pacman configuration into a reusable helper and expands install/runtime support to ZFS alongside Btrfs, including Limine/mkinitcpio and snapshot behavior updates.

Changes:

  • Centralize pacman config/mirrorlist application into use_omarchy_pacman_config and reuse it in preflight/post-install.
  • Allow ZFS as a supported root filesystem in install guards and adjust Limine/mkinitcpio hooks accordingly.
  • Extend omarchy-snapshot to create ZFS snapshots when the root filesystem is ZFS.

Reviewed changes

Copilot reviewed 6 out of 8 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
install/preflight/pacman.sh Uses the new pacman helper function during online install preflight.
install/preflight/guard.sh Permits ZFS root alongside Btrfs for snapshot-capable installs.
install/post-install/pacman.sh Reuses the centralized pacman config helper.
install/login/limine-snapper.sh Adds ZFS-specific mkinitcpio hooks and gates snapper/limine-snapper-sync logic to Btrfs; adjusts Limine config file access via sudo.
install/helpers/pacman.sh Introduces use_omarchy_pacman_config, preserving existing [archzfs] repo config.
install/helpers/all.sh Sources the new pacman helper as part of helper bootstrap.
bin/omarchy-snapshot Adds ZFS snapshot creation/retention logic; keeps snapper flow for non-ZFS.
bin/omarchy-hibernation-setup Skips hibernation setup unless root is Btrfs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread install/helpers/pacman.sh

if [[ -f /etc/pacman.conf ]]; then
archzfs_repo=$(awk '
/^\[/ { in_archzfs = ($0 == "[archzfs]") }
Comment thread install/helpers/pacman.sh
Comment on lines +12 to +13
sudo cp -f "$OMARCHY_PATH/default/pacman/pacman-$mirror.conf" /etc/pacman.conf
sudo cp -f "$OMARCHY_PATH/default/pacman/mirrorlist-$mirror" /etc/pacman.d/mirrorlist
Comment on lines +24 to 33
if sudo test -f /boot/EFI/arch-limine/limine.conf; then
limine_config="/boot/EFI/arch-limine/limine.conf"
elif [[ -f /boot/EFI/BOOT/limine.conf ]]; then
elif sudo test -f /boot/EFI/BOOT/limine.conf; then
limine_config="/boot/EFI/BOOT/limine.conf"
elif [[ -f /boot/EFI/limine/limine.conf ]]; then
elif sudo test -f /boot/EFI/limine/limine.conf; then
limine_config="/boot/EFI/limine/limine.conf"
elif [[ -f /boot/limine/limine.conf ]]; then
elif sudo test -f /boot/limine/limine.conf; then
limine_config="/boot/limine/limine.conf"
elif [[ -f /boot/limine.conf ]]; then
elif sudo test -f /boot/limine.conf; then
limine_config="/boot/limine.conf"
fi

CMDLINE=$(grep "^[[:space:]]*cmdline:" "$limine_config" | head -1 | sed 's/^[[:space:]]*cmdline:[[:space:]]*//')
CMDLINE=$(sudo grep "^[[:space:]]*cmdline:" "$limine_config" | head -1 | sed 's/^[[:space:]]*cmdline:[[:space:]]*//')
Comment thread install/helpers/all.sh
Comment on lines 1 to 5
source $OMARCHY_INSTALL/helpers/chroot.sh
source $OMARCHY_INSTALL/helpers/pacman.sh
source $OMARCHY_INSTALL/helpers/presentation.sh
source $OMARCHY_INSTALL/helpers/errors.sh
source $OMARCHY_INSTALL/helpers/logging.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants