From 76082b945d1633d00aef5422197fa950cf8ed287 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Tue, 19 Aug 2025 21:19:23 +0200 Subject: [PATCH] Put chroot provision into its own preflight --- install.sh | 14 +------------- install/preflight/chroot.sh | 12 ++++++++++++ 2 files changed, 13 insertions(+), 13 deletions(-) create mode 100644 install/preflight/chroot.sh diff --git a/install.sh b/install.sh index fca22a17..43726f36 100755 --- a/install.sh +++ b/install.sh @@ -6,19 +6,6 @@ export PATH="$HOME/.local/share/omarchy/bin:$PATH" OMARCHY_INSTALL=~/.local/share/omarchy/install -# Chroot installations have some differences -if ! cmp -s /proc/1/root/ / 2>/dev/null; then - export OMARCHY_CHROOT_INSTALL=1 -fi - -chrootable_systemctl_enable() { - if [ -n "${OMARCHY_CHROOT_INSTALL:-}" ]; then - sudo systemctl enable $1 - else - sudo systemctl enable --now $1 - fi -} - # Give people a chance to retry running the installation catch_errors() { echo -e "\n\e[31mOmarchy installation failed!\e[0m" @@ -41,6 +28,7 @@ show_subtext() { } # Install prerequisites +source $OMARCHY_INSTALL/preflight/chroot.sh source $OMARCHY_INSTALL/preflight/mirrorlist.sh source $OMARCHY_INSTALL/preflight/gum.sh source $OMARCHY_INSTALL/preflight/guard.sh diff --git a/install/preflight/chroot.sh b/install/preflight/chroot.sh new file mode 100644 index 00000000..37342d29 --- /dev/null +++ b/install/preflight/chroot.sh @@ -0,0 +1,12 @@ +# Chroot installations have some differences +if ! cmp -s /proc/1/root/ / 2>/dev/null; then + export OMARCHY_CHROOT_INSTALL=1 +fi + +chrootable_systemctl_enable() { + if [ -n "${OMARCHY_CHROOT_INSTALL:-}" ]; then + sudo systemctl enable $1 + else + sudo systemctl enable --now $1 + fi +}