Make --local-source the opt-in; default to network omarchy mirror

The previous version made the local build the only path. Convention is
the opposite: omarchy-iso-make pulls released omarchy* packages from
the omacom-pkgs.org mirror by default, and only builds from local
checkouts when explicitly asked via --local-source.

- bin/omarchy-iso-make: only mount /omarchy-installer + /omarchy-pkgs
  when --local-source is set. Default has neither mount.
- builder/build-iso.sh: skip build-omarchy-packages.sh when no local
  source. Don't filter the omarchy* names out of the pacman -Syw list
  in network mode (so they get downloaded from the mirror). With
  --local-source, the four package names are stripped after assembly
  so we don't re-fetch what we just built.
- For the package-list source: with /omarchy-installer mounted, read
  omarchy-base.packages from the checkout. Without it, briefly pull
  the published omarchy package, extract the .packages files from it
  to /tmp, and use those.
This commit is contained in:
Ryan Hughes committed 2026-05-20 21:34:49 -04:00
1 parent 9f4e5feef0
commit b8df9d3f50
2 files changed
+45 -24

No files matched your search

+18 -15
View File
@@ -16,9 +16,7 @@ while [[ $# -gt 0 ]]; do
shift
;;
--local-source)
# Kept as a flag for back-compat (older callers passed it); the ISO
# build now always builds from local omarchy-installer + omarchy-pkgs
# checkouts.
LOCAL_SOURCE=1
OMARCHY_MIRROR=edge
shift
;;
@@ -56,16 +54,6 @@ 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
@@ -79,10 +67,25 @@ 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"
)
# --local-source: build the omarchy* packages from local omarchy-installer +
# omarchy-pkgs checkouts (mounted into the container) instead of pulling them
# from the omarchy network mirror. Useful for testing in-flight changes
# before they're released through pkgs.omarchy.org.
if [[ -n "${LOCAL_SOURCE-}" ]]; then
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+=(
-v "$OMARCHY_INSTALLER_PATH:/omarchy-installer:ro"
-v "$OMARCHY_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
DOCKER_ARGS+=(-v "/var/cache/pacman/pkg:/var/cache/pacman/pkg")
+27 -9
View File
@@ -34,10 +34,13 @@ rm -rf "$build_cache_dir/airootfs/etc/xdg/reflector"
cp -r /configs/* "$build_cache_dir/"
echo "$OMARCHY_MIRROR" > "$build_cache_dir/airootfs/root/omarchy_mirror"
# Build omarchy* packages from the mounted source trees and drop them in the
# offline mirror. The .automated_script.sh later pacstraps omarchy-installer
# (which deps-in omarchy + omarchy-settings + omarchy-limine) from there.
bash /builder/build-omarchy-packages.sh "$offline_mirror_dir"
# When --local-source is in effect, build omarchy* from the mounted source
# trees and drop them in the offline mirror. Otherwise pacman -Syw below
# downloads the published versions from the omarchy network mirror.
if [[ -d /omarchy-installer && -d /omarchy-pkgs ]]; then
bash /builder/build-omarchy-packages.sh "$offline_mirror_dir"
LOCAL_OMARCHY_BUILD=1
fi
# Node.js binary for offline mise install.
NODE_DIST_URL="https://nodejs.org/dist/latest"
@@ -54,17 +57,32 @@ arch_packages=(linux-t2 git gum jq openssl plymouth tzupdate omarchy-keyring lvm
printf '%s\n' "${arch_packages[@]}" >> "$build_cache_dir/packages.x86_64"
# Build the offline mirror: everything pacstrap might want during the target
# install. The omarchy* packages we just built are already in the mirror;
# this pacman -Syw downloads the rest from the live network mirror.
# install. With --local-source, the omarchy* packages we just built are
# already in the mirror and we filter them out below. Without it, pacman -Syw
# pulls the published omarchy* from the network mirror like any other package.
if [[ -d /omarchy-installer ]]; then
base_pkg_lists=(/omarchy-installer/install/omarchy-base.packages /omarchy-installer/install/omarchy-other.packages)
else
# Pull the same package lists out of the freshly-downloaded omarchy package
# so we don't need a local checkout in the non-local-source path.
pacman --config /configs/pacman-online-${OMARCHY_MIRROR}.conf --noconfirm -Sw omarchy --cachedir /tmp --dbpath /tmp/offlinedb-bootstrap >/dev/null
omarchy_pkg=$(ls /tmp/omarchy-*.pkg.tar.zst | head -1)
mkdir -p /tmp/omarchy-pkglists
bsdtar -xf "$omarchy_pkg" -C /tmp/omarchy-pkglists usr/share/omarchy/install/omarchy-base.packages usr/share/omarchy/install/omarchy-other.packages
base_pkg_lists=(/tmp/omarchy-pkglists/usr/share/omarchy/install/omarchy-base.packages /tmp/omarchy-pkglists/usr/share/omarchy/install/omarchy-other.packages)
fi
declare -a all_packages
mapfile -t all_packages < <(
{
cat "$build_cache_dir/packages.x86_64"
grep -hv '^#\|^$' /omarchy-installer/install/omarchy-base.packages /omarchy-installer/install/omarchy-other.packages
grep -hv '^#\|^$' "${base_pkg_lists[@]}"
grep -hv '^#\|^$' /builder/archinstall.packages
# Always include the omarchy meta-package set so the target install can
# find omarchy-installer in the offline mirror.
printf 'omarchy\nomarchy-settings\nomarchy-installer\nomarchy-limine\n'
} |
# Filter out our locally-built packages (they're already in the mirror).
grep -vE '^(omarchy|omarchy-settings|omarchy-installer|omarchy-limine)$' |
$([[ -n ${LOCAL_OMARCHY_BUILD:-} ]] && echo "grep -vE ^(omarchy|omarchy-settings|omarchy-installer|omarchy-limine)$" || echo cat) |
sort -u
)