Unify ISO install orchestration

Drive installs through the common ISO pipeline, carry install intent in configurator JSON, and finalize Limine boot setup from the ISO.
This commit is contained in:
Ryan Hughes committed 2026-05-25 12:50:31 -04:00
1 parent 660edcb3af
commit c50d0bc299
17 files changed
+958 -814

No files matched your search

+1 -1
View File
@@ -65,7 +65,7 @@ logs=(
"pacman-key: populating archlinux keyring"
"mount: /mnt ready"
"pacstrap: installing linux btrfs-progs limine"
"pacman: installing omarchy-installer"
"pacman: installing omarchy"
"useradd: creating ryan with /etc/skel defaults"
"limine-update: generating omarchy_linux.efi"
"snapper: creating root config"
+7 -19
View File
@@ -3,25 +3,13 @@ set -euo pipefail
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cleanup() {
[[ -n "${mock_omarchy_install:-}" ]] && rm -rf "$(dirname "$mock_omarchy_install")"
}
trap cleanup EXIT
if [[ -z "${OMARCHY_INSTALL:-}" ]]; then
if [[ -r /root/omarchy/install/helpers/all.sh ]]; then
export OMARCHY_INSTALL=/root/omarchy/install
else
mock_root="$(mktemp -d)"
mock_omarchy_install="$mock_root/install"
mkdir -p "$mock_omarchy_install/helpers"
cat >"$mock_omarchy_install/helpers/all.sh" <<'EOF'
PADDING_LEFT=0
PADDING_LEFT_SPACES=""
clear_logo() { clear; }
EOF
export OMARCHY_INSTALL="$mock_omarchy_install"
fi
if [[ -z "${OMARCHY_PATH:-}" ]]; then
for candidate in "$repo_root/../omarchy-installer" "$repo_root/../omarchy" /usr/share/omarchy; do
if [[ -f "$candidate/logo.txt" ]]; then
export OMARCHY_PATH="$candidate"
break
fi
done
fi
exec bash "$repo_root/configs/airootfs/root/configurator" dry "$@"
+20 -45
View File
@@ -1,11 +1,9 @@
#!/bin/bash
# Abort if anything fails
set -e
# Parse command line arguments
NO_CACHE=""
LOCAL_INSTALLER_PATH=""
LOCAL_OMARCHY_PATH=""
LOCAL_PKGS_PATH=""
while [[ $# -gt 0 ]]; do
case $1 in
@@ -22,42 +20,38 @@ while [[ $# -gt 0 ]]; do
shift
;;
--local-source)
# --local-source <installer-checkout> <pkgs-checkout>
# Builds omarchy* from the two checkouts and bundles them in the ISO's
# offline mirror instead of pulling published versions from the omarchy
# network mirror.
LOCAL_INSTALLER_PATH="${2:-}"
LOCAL_OMARCHY_PATH="${2:-}"
LOCAL_PKGS_PATH="${3:-}"
if [[ -z $LOCAL_INSTALLER_PATH || -z $LOCAL_PKGS_PATH ]]; then
echo "Error: --local-source requires two args: <installer-checkout> <pkgs-checkout>" >&2
if [[ -z $LOCAL_OMARCHY_PATH || -z $LOCAL_PKGS_PATH ]]; then
echo "Error: --local-source requires two args: <omarchy-checkout> <pkgs-checkout>" >&2
exit 1
fi
OMARCHY_MIRROR=edge
OMARCHY_ISO_REF=local
shift 3
;;
--dev)
OMARCHY_INSTALLER_REF=dev
OMARCHY_ISO_REF=dev
OMARCHY_MIRROR=edge
shift
;;
--rc)
OMARCHY_ISO_REF=rc
OMARCHY_MIRROR=rc
OMARCHY_INSTALLER_REF=rc
shift
;;
*)
echo "Unknown option: $1"
echo "Usage: $0 [--no-cache] [--no-boot-offer] [--debug] [--dev|--rc] [--local-source <installer-checkout> <pkgs-checkout>]"
echo "Usage: $0 [--no-cache] [--no-boot-offer] [--debug] [--dev|--rc] [--local-source <omarchy-checkout> <pkgs-checkout>]"
exit 1
;;
esac
done
# Validate local-source paths up front (before any sudo / network work).
if [[ -n $LOCAL_INSTALLER_PATH ]]; then
[[ -d $LOCAL_INSTALLER_PATH ]] || { echo "Error: installer checkout not found at $LOCAL_INSTALLER_PATH" >&2; exit 1; }
[[ -d $LOCAL_PKGS_PATH ]] || { echo "Error: pkgs checkout not found at $LOCAL_PKGS_PATH" >&2; exit 1; }
LOCAL_INSTALLER_PATH=$(realpath "$LOCAL_INSTALLER_PATH")
if [[ -n $LOCAL_OMARCHY_PATH ]]; then
[[ -d $LOCAL_OMARCHY_PATH ]] || { echo "Error: Omarchy checkout not found at $LOCAL_OMARCHY_PATH" >&2; exit 1; }
[[ -d $LOCAL_PKGS_PATH ]] || { echo "Error: pkgs checkout not found at $LOCAL_PKGS_PATH" >&2; exit 1; }
LOCAL_OMARCHY_PATH=$(realpath "$LOCAL_OMARCHY_PATH")
LOCAL_PKGS_PATH=$(realpath "$LOCAL_PKGS_PATH")
fi
@@ -96,27 +90,21 @@ lint_file_permissions() {
lint_file_permissions
# Clear out old packages
sudo rm -rf /var/cache/pacman/pkg/*
# Ensure we have the submodule checked out
git submodule update --init --recursive --jobs=8
# Prepare build repo
BUILD_SCRIPT="builder/build-iso.sh"
BUILD_ROOT=$(realpath "${BASH_SOURCE[0]%/*}/..")
BUILD_RELEASE_PATH="$BUILD_ROOT/release"
mkdir -p "$BUILD_RELEASE_PATH"
OMARCHY_INSTALLER_REPO="${OMARCHY_INSTALLER_REPO:-basecamp/omarchy}"
OMARCHY_INSTALLER_REF="${OMARCHY_INSTALLER_REF:-master}"
OMARCHY_ISO_REF="${OMARCHY_ISO_REF:-stable}"
OMARCHY_MIRROR="${OMARCHY_MIRROR:-stable}"
DOCKER_ARGS=(
--rm
--privileged
-e "OMARCHY_INSTALLER_REPO=$OMARCHY_INSTALLER_REPO"
-e "OMARCHY_INSTALLER_REF=$OMARCHY_INSTALLER_REF"
-e "OMARCHY_ISO_REF=$OMARCHY_ISO_REF"
-e "OMARCHY_MIRROR=$OMARCHY_MIRROR"
-e "OMARCHY_INSTALL_DEBUG=${OMARCHY_INSTALL_DEBUG:-}"
-e "HOST_UID=$(id -u)"
@@ -128,43 +116,30 @@ DOCKER_ARGS=(
-v "$BUILD_ROOT/configs:/configs:ro"
)
# Mount the local checkouts when --local-source was passed (paths already
# validated/resolved above).
if [[ -n $LOCAL_INSTALLER_PATH ]]; then
if [[ -n $LOCAL_OMARCHY_PATH ]]; then
DOCKER_ARGS+=(
-v "$LOCAL_INSTALLER_PATH:/omarchy-installer:ro"
-v "$LOCAL_OMARCHY_PATH:/omarchy-source:ro"
-v "$LOCAL_PKGS_PATH:/omarchy-pkgs:ro"
)
fi
# Use local pacman cache if you already have one on host to speed up repeat runs
if [ -d "/var/cache/pacman/pkg" ]; then
if [[ -d /var/cache/pacman/pkg ]]; then
DOCKER_ARGS+=(-v "/var/cache/pacman/pkg:/var/cache/pacman/pkg")
fi
# Mount the build cache directory where packages are downloaded. Keyed by
# channel so stable/edge/rc don't pollute each other but the cache persists
# across days (different channels have different package sets; days don't).
# omarchy* packages always rebuild fresh inside the container regardless of
# what's in the cache (build-omarchy-packages.sh nukes its work dir and the
# final mv overwrites the cached .pkg.tar.zst). --no-cache bypasses the mount
# entirely if you want a truly clean download.
if [[ -z "$NO_CACHE" ]]; then
if [[ -z $NO_CACHE ]]; then
OFFLINE_REPO_BUILD_CACHE_DIR="$HOME/.cache/omarchy/iso_${OMARCHY_MIRROR}/airootfs/var/cache/omarchy"
mkdir -p "$OFFLINE_REPO_BUILD_CACHE_DIR"
DOCKER_ARGS+=(-v "$OFFLINE_REPO_BUILD_CACHE_DIR:/var/cache/airootfs/var/cache/omarchy")
fi
# Run the builder with assembled args
docker run "${DOCKER_ARGS[@]}" archlinux/archlinux:latest /$BUILD_SCRIPT
# Move as install ref
latest_iso=$(\ls -t "$BUILD_RELEASE_PATH"/*.iso | head -n1)
iso_ref="${latest_iso%.*}-$OMARCHY_INSTALLER_REF.iso"
iso_ref="${latest_iso%.*}-$OMARCHY_ISO_REF.iso"
mv -f "$latest_iso" "$iso_ref"
# Offer to boot the new build
if [[ -z "$NO_BOOT_OFFER" ]]; then
if [[ -z "${NO_BOOT_OFFER:-}" ]]; then
echo
gum confirm "Boot $iso_ref?" && omarchy-iso-boot "$iso_ref"
fi
+6 -6
View File
@@ -1,7 +1,7 @@
#!/bin/bash
MAKE_ARGS=()
INSTALLER_REF=master
ISO_REF=stable
RELEASE_SUFFIX=""
while [[ $# -gt 0 ]]; do
@@ -12,7 +12,7 @@ while [[ $# -gt 0 ]]; do
;;
--rc)
MAKE_ARGS+=("$1")
INSTALLER_REF=rc
ISO_REF=rc
RELEASE_SUFFIX="-rc"
shift
;;
@@ -42,21 +42,21 @@ BUILD_RELEASE_PATH="$BUILD_ROOT/release"
# Make ISOs
if [[ ! " ${MAKE_ARGS[*]} " =~ " --no-make " ]]; then
echo -e "\e[32mMaking $INSTALLER_REF ISO\e[0m"
echo -e "\e[32mMaking $ISO_REF ISO\e[0m"
omarchy-iso-make --no-cache --no-boot-offer "${MAKE_ARGS[@]}"
else
echo -e "\e[31mSkipping remaking ISOs\e[0m"
fi
# Sign and upload ISO
latest_iso=$(\ls -t "$BUILD_RELEASE_PATH"/*x86_64-"$INSTALLER_REF".iso | head -n1)
latest_iso=$(\ls -t "$BUILD_RELEASE_PATH"/*x86_64-"$ISO_REF".iso | head -n1)
release_iso="$BUILD_RELEASE_PATH/omarchy-$BUILD_VERSION$RELEASE_SUFFIX.iso"
cp "$latest_iso" "$release_iso"
echo -e "\e[32mSigning $INSTALLER_REF ISO\e[0m"
echo -e "\e[32mSigning $ISO_REF ISO\e[0m"
omarchy-iso-sign "$release_iso"
iso_sha=$(sha256sum "$release_iso")
echo -e "\e[32mSHA256 for $INSTALLER_REF ISO: $iso_sha\e[0m"
echo -e "\e[32mSHA256 for $ISO_REF ISO: $iso_sha\e[0m"
omarchy-iso-upload "$release_iso"