Refactor work
This commit is contained in:
1 parent
4ded01b207
commit
76699b4de0
9 files changed
+730
-142
No files matched your search
+66
-19
@@ -30,21 +30,41 @@ rm -rf "$build_cache_dir/airootfs/etc/xdg/reflector"
|
||||
# Bring in our configs
|
||||
cp -r /configs/* $build_cache_dir/
|
||||
|
||||
# Setup Omarchy itself
|
||||
if [[ -d /omarchy ]]; then
|
||||
cp -rp /omarchy "$build_cache_dir/airootfs/root/omarchy"
|
||||
# Build omarchy-settings package locally
|
||||
# This package provides EVERYTHING needed for the ISO:
|
||||
# - User configs (/etc/skel/)
|
||||
# - System configs (/etc/)
|
||||
# - Plymouth theme
|
||||
# - Essential binaries (debug, upload-log)
|
||||
# - Install scripts (/usr/share/omarchy/install/)
|
||||
if [ -d "/omarchy-pkgs" ]; then
|
||||
echo "========================================="
|
||||
echo "Building omarchy-settings package locally"
|
||||
echo "========================================="
|
||||
source /builder/build-omarchy-packages.sh
|
||||
|
||||
# Add omarchy packages to ISO
|
||||
# omarchy-settings provides configs and will be installed in ISO
|
||||
# omarchy-installer provides install scripts and will be installed in ISO
|
||||
echo "omarchy-settings" >> "$build_cache_dir/packages.x86_64"
|
||||
echo "omarchy-installer" >> "$build_cache_dir/packages.x86_64"
|
||||
|
||||
# Copy built packages to offline mirror (for installation on target system)
|
||||
cp "$OMARCHY_SETTINGS_PKG" "$offline_mirror_dir/"
|
||||
cp "$OMARCHY_INSTALLER_PKG" "$offline_mirror_dir/"
|
||||
cp "$OMARCHY_PKG" "$offline_mirror_dir/"
|
||||
|
||||
echo "✓ omarchy-settings will be installed in ISO (configs, binaries)"
|
||||
echo "✓ omarchy-installer will be installed in ISO (install scripts, helpers)"
|
||||
echo "✓ All omarchy packages available in offline mirror for installation"
|
||||
echo "✓ No git clone needed - everything comes from packages!"
|
||||
else
|
||||
git clone -b $OMARCHY_INSTALLER_REF https://github.com/$OMARCHY_INSTALLER_REPO.git "$build_cache_dir/airootfs/root/omarchy"
|
||||
echo "ERROR: /omarchy-pkgs not mounted!"
|
||||
echo "The ISO build now requires omarchy-settings package."
|
||||
echo "Please set OMARCHY_PKGS_PATH or ensure ../omarchy-pkgs exists."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Make log uploader available in the ISO too
|
||||
mkdir -p "$build_cache_dir/airootfs/usr/local/bin/"
|
||||
cp "$build_cache_dir/airootfs/root/omarchy/bin/omarchy-upload-log" "$build_cache_dir/airootfs/usr/local/bin/omarchy-upload-log"
|
||||
|
||||
# Copy the Omarchy Plymouth theme to the ISO
|
||||
mkdir -p "$build_cache_dir/airootfs/usr/share/plymouth/themes/omarchy"
|
||||
cp -r "$build_cache_dir/airootfs/root/omarchy/default/plymouth/"* "$build_cache_dir/airootfs/usr/share/plymouth/themes/omarchy/"
|
||||
|
||||
# Download and verify Node.js binary for offline installation
|
||||
NODE_DIST_URL="https://nodejs.org/dist/latest"
|
||||
|
||||
@@ -67,19 +87,41 @@ mkdir -p "$build_cache_dir/airootfs/opt/packages/"
|
||||
cp "/tmp/$NODE_FILENAME" "$build_cache_dir/airootfs/opt/packages/"
|
||||
|
||||
# Add our additional packages to packages.x86_64
|
||||
arch_packages=(linux-t2 git gum jq openssl plymouth tzupdate omarchy-keyring)
|
||||
arch_packages=(linux-t2 git gum jq openssl plymouth tzupdate omarchy-keyring python-terminaltexteffects)
|
||||
printf '%s\n' "${arch_packages[@]}" >>"$build_cache_dir/packages.x86_64"
|
||||
|
||||
# Build list of all the packages needed for the offline mirror
|
||||
all_packages=($(cat "$build_cache_dir/packages.x86_64"))
|
||||
all_packages+=($(grep -v '^#' "$build_cache_dir/airootfs/root/omarchy/install/omarchy-base.packages" | grep -v '^$'))
|
||||
all_packages+=($(grep -v '^#' "$build_cache_dir/airootfs/root/omarchy/install/omarchy-other.packages" | grep -v '^$'))
|
||||
all_packages+=($(grep -v '^#' /builder/archinstall.packages | grep -v '^$'))
|
||||
# Start with packages.x86_64 but exclude locally-built packages
|
||||
all_packages=($(cat "$build_cache_dir/packages.x86_64" | grep -vE '^(omarchy|omarchy-settings|omarchy-installer)$'))
|
||||
|
||||
# Add omarchy package lists from source, excluding locally-built packages
|
||||
if [ -n "$OMARCHY_INSTALLER_SRC" ] && [ -d "$OMARCHY_INSTALLER_SRC" ]; then
|
||||
# Filter out locally-built packages and known problematic packages
|
||||
all_packages+=($(grep -v '^#' "$OMARCHY_INSTALLER_SRC/install/omarchy-base.packages" | grep -v '^$' | grep -vE '^(omarchy|omarchy-settings|omarchy-installer)$'))
|
||||
all_packages+=($(grep -v '^#' "$OMARCHY_INSTALLER_SRC/install/omarchy-other.packages" | grep -v '^$' | grep -vE '^qt5-remoteobjects$'))
|
||||
else
|
||||
echo "WARNING: Could not find omarchy package lists, offline mirror may be incomplete"
|
||||
fi
|
||||
|
||||
all_packages+=($(grep -v '^#' /builder/archinstall.packages | grep -v '^$' | grep -vE '^(omarchy|omarchy-settings|omarchy-installer)$'))
|
||||
|
||||
# Remove duplicates
|
||||
all_packages=($(printf '%s\n' "${all_packages[@]}" | sort -u))
|
||||
|
||||
# Download all the packages to the offline mirror inside the ISO
|
||||
# Use --needed to skip packages that are already in cache
|
||||
# Use --noconfirm to avoid interactive prompts
|
||||
mkdir -p /tmp/offlinedb
|
||||
pacman --config /configs/pacman-online.conf --noconfirm -Syw "${all_packages[@]}" --cachedir $offline_mirror_dir/ --dbpath /tmp/offlinedb
|
||||
repo-add --new "$offline_mirror_dir/offline.db.tar.gz" "$offline_mirror_dir/"*.pkg.tar.zst
|
||||
echo "Downloading ${#all_packages[@]} packages to offline mirror..."
|
||||
pacman --config /configs/pacman-online.conf --noconfirm -Syw "${all_packages[@]}" --cachedir $offline_mirror_dir/ --dbpath /tmp/offlinedb --needed
|
||||
|
||||
# Build repository database for the offline mirror
|
||||
# First, create the database from all downloaded packages
|
||||
echo "Building offline repository database..."
|
||||
repo-add "$offline_mirror_dir/offline.db.tar.gz" "$offline_mirror_dir/"*.pkg.tar.zst
|
||||
|
||||
# Note: Our locally built packages (omarchy, omarchy-settings) were copied earlier
|
||||
# and are now included in the repository database
|
||||
|
||||
# Create a symlink to the offline mirror instead of duplicating it.
|
||||
# mkarchiso needs packages at /var/cache/omarchy/mirror/offline in the container,
|
||||
@@ -91,6 +133,11 @@ ln -s "$offline_mirror_dir" "/var/cache/omarchy/mirror/offline"
|
||||
# same config when booted
|
||||
cp $build_cache_dir/pacman.conf "$build_cache_dir/airootfs/etc/pacman.conf"
|
||||
|
||||
# Create missing device-mapper udev rules file to silence mkinitcpio warning
|
||||
# This file was removed in recent device-mapper versions but mkinitcpio still references it
|
||||
mkdir -p /usr/lib/initcpio/udev
|
||||
touch /usr/lib/initcpio/udev/11-dm-initramfs.rules
|
||||
|
||||
# Finally, we assemble the entire ISO
|
||||
mkarchiso -v -w "$build_cache_dir/work/" -o "/out/" "$build_cache_dir/"
|
||||
|
||||
|
||||
Reference in new issue
Block a user