Refactor ISO build for the package-backed install flow

The ISO no longer carries a cp -r'd copy of the omarchy git checkout
into /root/omarchy and the target /home/$user/.local/share/omarchy.
Instead it builds omarchy-installer + omarchy-settings + omarchy +
omarchy-limine from mounted source trees (${OMARCHY_INSTALLER_PATH:-
../omarchy-installer} and ${OMARCHY_PKGS_PATH:-../omarchy-pkgs}),
drops them in the offline mirror, and pacstraps omarchy-installer
during the target install — which deps-in the other three.

- builder/build-omarchy-packages.sh: new. Builds the four packages
  inside the ISO build container using each PKGBUILD's OMARCHY_SRC
  override (introduced in Chunk 2). Creates a 'builder' user because
  makepkg refuses to run as root. Drops the resulting .pkg.tar.zst
  files into the offline-mirror directory.

- builder/build-iso.sh: drop the git clone / -v omarchy mount path;
  call build-omarchy-packages.sh first; filter out the locally-built
  package names from the rest-of-mirror download so we don't try to
  fetch them from the network mirror.

- configs/airootfs/root/.automated_script.sh: replace the install_omarchy
  cp-and-source dance with 'arch-chroot pacman -S omarchy-installer'
  followed by 'OMARCHY_INSTALL_MODE=offline omarchy-install'. Drop the
  big chown/chmod block that was setting up the cloned tree.
  use_omarchy_helpers extracts the installer's helpers/ tree directly
  from the offline-mirror's omarchy-installer-*.pkg.tar.zst so the live
  ISO has access to gum-styled logging before pacstrap.

- bin/omarchy-iso-make: always mount omarchy-installer and omarchy-pkgs
  (paths configurable via OMARCHY_INSTALLER_PATH / OMARCHY_PKGS_PATH;
  default to ../omarchy-installer and ../omarchy-pkgs). --local-source
  is now a back-compat no-op.
This commit is contained in:
Ryan Hughes committed 2026-05-20 21:29:40 -04:00
1 parent 023cd14f2a
commit 9f4e5feef0
4 files changed
+190 -166

No files matched your search

+15 -6
View File
@@ -16,7 +16,9 @@ while [[ $# -gt 0 ]]; do
shift
;;
--local-source)
LOCAL_SOURCE=1
# Kept as a flag for back-compat (older callers passed it); the ISO
# build now always builds from local omarchy-installer + omarchy-pkgs
# checkouts.
OMARCHY_MIRROR=edge
shift
;;
@@ -54,6 +56,16 @@ OMARCHY_INSTALLER_REPO="${OMARCHY_INSTALLER_REPO:-basecamp/omarchy}"
OMARCHY_INSTALLER_REF="${OMARCHY_INSTALLER_REF:-master}"
OMARCHY_MIRROR="${OMARCHY_MIRROR:-stable}"
# Source paths for the local package builds. The ISO builder pacstraps
# locally-built omarchy* packages from /omarchy-installer and /omarchy-pkgs,
# so these must point at checkouts of those repos.
OMARCHY_INSTALLER_PATH="${OMARCHY_INSTALLER_PATH:-$BUILD_ROOT/../omarchy-installer}"
OMARCHY_PKGS_PATH="${OMARCHY_PKGS_PATH:-$BUILD_ROOT/../omarchy-pkgs}"
[[ -d $OMARCHY_INSTALLER_PATH ]] || { echo "Error: omarchy-installer checkout not found at $OMARCHY_INSTALLER_PATH" >&2; exit 1; }
[[ -d $OMARCHY_PKGS_PATH ]] || { echo "Error: omarchy-pkgs checkout not found at $OMARCHY_PKGS_PATH" >&2; exit 1; }
OMARCHY_INSTALLER_PATH=$(realpath "$OMARCHY_INSTALLER_PATH")
OMARCHY_PKGS_PATH=$(realpath "$OMARCHY_PKGS_PATH")
DOCKER_ARGS=(
--rm
--privileged
@@ -67,13 +79,10 @@ DOCKER_ARGS=(
-v "$BUILD_ROOT/archiso:/archiso:ro"
-v "$BUILD_ROOT/builder:/builder:ro"
-v "$BUILD_ROOT/configs:/configs:ro"
-v "$OMARCHY_INSTALLER_PATH:/omarchy-installer:ro"
-v "$OMARCHY_PKGS_PATH:/omarchy-pkgs:ro"
)
# Use local source of Omarchy from $OMARCHY_PATH instead of git checkout
if [[ -n "${LOCAL_SOURCE-}" ]]; then
DOCKER_ARGS+=(-v "$OMARCHY_PATH:/omarchy: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
DOCKER_ARGS+=(-v "/var/cache/pacman/pkg:/var/cache/pacman/pkg")