diff --git a/install/config/mise-work.sh b/install/config/mise-work.sh index 2dfcc0c2..c6e5ff94 100644 --- a/install/config/mise-work.sh +++ b/install/config/mise-work.sh @@ -10,7 +10,7 @@ EOF mise trust ~/Work/.mise.toml -if install_mode_is iso-chroot; then +if install_mode_is offline; then NODE_TARBALL=$(find /opt/packages -name "node-v*-linux-x64.tar.gz" -type f 2>/dev/null | head -n1) NODE_VERSION=$(basename "$NODE_TARBALL" | sed 's/node-v\(.*\)-linux-x64.tar.gz/\1/') diff --git a/install/helpers/chroot.sh b/install/helpers/chroot.sh index ad98802b..96430ede 100644 --- a/install/helpers/chroot.sh +++ b/install/helpers/chroot.sh @@ -1,6 +1,6 @@ -# In iso-chroot mode systemd isn't running, so skip --now and just enable. +# In offline (ISO chroot) mode systemd isn't running, so skip --now. chrootable_systemctl_enable() { - if install_mode_is iso-chroot; then + if install_mode_is offline; then sudo systemctl enable $1 else sudo systemctl enable --now $1 diff --git a/install/helpers/errors.sh b/install/helpers/errors.sh index 9b560c43..96b75f56 100644 --- a/install/helpers/errors.sh +++ b/install/helpers/errors.sh @@ -104,8 +104,7 @@ catch_errors() { while true; do options=() - # Retry only makes sense for online flows (git clone or package install). - if install_mode_is online-git || install_mode_is online-package; then + if install_mode_is online; then options+=("Retry installation") fi diff --git a/install/helpers/mode.sh b/install/helpers/mode.sh index f1c61af0..06dbb8fb 100644 --- a/install/helpers/mode.sh +++ b/install/helpers/mode.sh @@ -1,14 +1,18 @@ -# OMARCHY_INSTALL_MODE is one of: iso-chroot, online-package, online-git -# Back-compat shims honor the older OMARCHY_CHROOT_INSTALL and -# OMARCHY_ONLINE_INSTALL flags during transition. +# OMARCHY_INSTALL_MODE is one of: online, offline +# online - bootstrap installed omarchy-* packages from the omacom-pkgs.org +# repo on an existing Arch system, then ran install.sh. +# offline - ISO build: archinstall pacstrapped the bundled mirror; install.sh +# runs in the chroot before the user's first boot. +# Legacy OMARCHY_CHROOT_INSTALL and OMARCHY_ONLINE_INSTALL still work as +# shims during transition. detect_install_mode() { if [[ -n ${OMARCHY_INSTALL_MODE:-} ]]; then case $OMARCHY_INSTALL_MODE in - iso-chroot|online-package|online-git) ;; + online|offline) ;; *) echo "Error: invalid OMARCHY_INSTALL_MODE=$OMARCHY_INSTALL_MODE" >&2 - echo " must be one of: iso-chroot, online-package, online-git" >&2 + echo " must be one of: online, offline" >&2 exit 1 ;; esac @@ -17,13 +21,11 @@ detect_install_mode() { fi if [[ -n ${OMARCHY_CHROOT_INSTALL:-} ]]; then - export OMARCHY_INSTALL_MODE=iso-chroot + export OMARCHY_INSTALL_MODE=offline elif [[ -n ${OMARCHY_ONLINE_INSTALL:-} ]]; then - export OMARCHY_INSTALL_MODE=online-git - elif [[ ${OMARCHY_PATH:-} == /usr/share/omarchy ]]; then - export OMARCHY_INSTALL_MODE=online-package + export OMARCHY_INSTALL_MODE=online else - export OMARCHY_INSTALL_MODE=online-git + export OMARCHY_INSTALL_MODE=online fi } @@ -32,22 +34,17 @@ install_mode_is() { } # Synchronize the legacy vars to the canonical mode so callers that still -# check OMARCHY_CHROOT_INSTALL / OMARCHY_ONLINE_INSTALL agree with us -# (including unsetting contradictory ones). +# check OMARCHY_CHROOT_INSTALL / OMARCHY_ONLINE_INSTALL agree with us. export_legacy_mode_flags() { case ${OMARCHY_INSTALL_MODE:-} in - iso-chroot) + offline) export OMARCHY_CHROOT_INSTALL=1 unset OMARCHY_ONLINE_INSTALL ;; - online-git) + online) export OMARCHY_ONLINE_INSTALL=true unset OMARCHY_CHROOT_INSTALL ;; - online-package) - unset OMARCHY_CHROOT_INSTALL - unset OMARCHY_ONLINE_INSTALL - ;; esac } diff --git a/install/packaging/all.sh b/install/packaging/all.sh index 766bce17..87bf21c7 100644 --- a/install/packaging/all.sh +++ b/install/packaging/all.sh @@ -1,9 +1,3 @@ -# online-package mode has omarchy + omarchy-base.packages already installed -# via pacman, so skip the base package install. -if ! install_mode_is online-package; then - run_logged $OMARCHY_INSTALL/packaging/base.sh -fi - run_logged $OMARCHY_INSTALL/packaging/fonts.sh run_logged $OMARCHY_INSTALL/packaging/nvim.sh run_logged $OMARCHY_INSTALL/packaging/icons.sh diff --git a/install/post-install/finished.sh b/install/post-install/finished.sh index 612c469a..c8f930d9 100644 --- a/install/post-install/finished.sh +++ b/install/post-install/finished.sh @@ -29,7 +29,7 @@ if gum confirm --padding "0 0 0 $((PADDING_LEFT + 32))" --show-help=false --defa # Clear screen to hide any shutdown messages clear - if install_mode_is iso-chroot; then + if install_mode_is offline; then touch /var/tmp/omarchy-install-completed exit 0 else diff --git a/install/preflight/all.sh b/install/preflight/all.sh index ccd1a801..67d28c22 100644 --- a/install/preflight/all.sh +++ b/install/preflight/all.sh @@ -1,19 +1,12 @@ source $OMARCHY_INSTALL/preflight/guard.sh source $OMARCHY_INSTALL/preflight/begin.sh run_logged $OMARCHY_INSTALL/preflight/show-env.sh - -# online-git is the only mode that bootstraps pacman config; iso-chroot has -# archinstall do it; online-package starts with pacman already configured. -if install_mode_is online-git; then - run_logged $OMARCHY_INSTALL/preflight/pacman.sh -fi - run_logged $OMARCHY_INSTALL/preflight/migrations.sh -# first-run-mode and disable-mkinitcpio are only meaningful when we're -# bringing a system up from scratch (boot.sh or ISO). online-package mode -# is bolting Omarchy onto an existing Arch install — neither applies. -if ! install_mode_is online-package; then +# Offline (ISO chroot) bootstraps a system from scratch and needs the +# first-run-mode sudoers shim plus the temporary mkinitcpio hook freeze. +# Online installs run on an existing system that already has its own users. +if install_mode_is offline; then run_logged $OMARCHY_INSTALL/preflight/first-run-mode.sh run_logged $OMARCHY_INSTALL/preflight/disable-mkinitcpio.sh fi diff --git a/install/preflight/pacman.sh b/install/preflight/pacman.sh deleted file mode 100644 index d65a9645..00000000 --- a/install/preflight/pacman.sh +++ /dev/null @@ -1,17 +0,0 @@ -if install_mode_is online-git; then - # Install build tools - omarchy-pkg-add base-devel - - # Configure pacman - sudo cp -f $OMARCHY_PATH/default/pacman/pacman-${OMARCHY_MIRROR:-stable}.conf /etc/pacman.conf - sudo cp -f $OMARCHY_PATH/default/pacman/mirrorlist-${OMARCHY_MIRROR:-stable} /etc/pacman.d/mirrorlist - - sudo pacman-key --recv-keys 40DFB630FF42BCFFB047046CF0134EE680CAC571 --keyserver keys.openpgp.org - sudo pacman-key --lsign-key 40DFB630FF42BCFFB047046CF0134EE680CAC571 - - sudo pacman -Sy - omarchy-pkg-add omarchy-keyring - - # Refresh all repos - sudo pacman -Syyuu --noconfirm -fi