installer: reduce offline finalizer work

This commit is contained in:
Ryan Hughes
2026-06-04 18:35:01 -04:00
parent 724f46f145
commit b29747a54b
8 changed files with 70 additions and 27 deletions
+6 -4
View File
@@ -38,8 +38,10 @@ if [[ -f $MKINITCPIO_CONF ]] && grep -q "^HOOKS+=(resume)$" "$MKINITCPIO_CONF";
if [[ -n $RESUME_OFFSET ]]; then
echo "Fixing empty resume_offset ($RESUME_OFFSET)"
sudo sed -i "s/resume_offset=\"$/resume_offset=$RESUME_OFFSET\"/" "$RESUME_DROP_IN"
sudo sed -i "s/resume_offset=\"$/resume_offset=$RESUME_OFFSET\"/" /etc/default/limine
$NO_REBUILD || sudo limine-mkinitcpio
if ! $NO_REBUILD; then
sudo sed -i "s/resume_offset=\"$/resume_offset=$RESUME_OFFSET\"/" /etc/default/limine
sudo limine-mkinitcpio
fi
fi
fi
echo "Hibernation is already set up"
@@ -100,7 +102,7 @@ if [[ ! -f $RESUME_DROP_IN ]]; then
if [[ -n $RESUME_OFFSET ]]; then
sudo mkdir -p /etc/limine-entry-tool.d
echo "KERNEL_CMDLINE[default]+=\" resume=$RESUME_DEVICE resume_offset=$RESUME_OFFSET\"" | sudo tee "$RESUME_DROP_IN" >/dev/null
sudo tee -a /etc/default/limine < "$RESUME_DROP_IN" >/dev/null
$NO_REBUILD || sudo tee -a /etc/default/limine < "$RESUME_DROP_IN" >/dev/null
else
echo "Warning: Could not determine resume offset for $SWAP_FILE" >&2
fi
@@ -113,7 +115,7 @@ if grep -q "\[s2idle\]" /sys/power/mem_sleep 2>/dev/null; then
echo "Enabling ACPI RTC alarm for s2idle suspend"
sudo mkdir -p /etc/limine-entry-tool.d
echo 'KERNEL_CMDLINE[default]+=" rtc_cmos.use_acpi_alarm=1"' | sudo tee "$LIMINE_DROP_IN" >/dev/null
sudo tee -a /etc/default/limine < "$LIMINE_DROP_IN" >/dev/null
$NO_REBUILD || sudo tee -a /etc/default/limine < "$LIMINE_DROP_IN" >/dev/null
fi
fi
+13 -9
View File
@@ -154,7 +154,9 @@ echo "$THEME_NAME" >"$HOME/.config/omarchy/current/theme.name"
# the theme hooks run.
colors_payload=$([[ -f $CURRENT_THEME_PATH/colors.toml ]] && base64 -w 0 "$CURRENT_THEME_PATH/colors.toml")
shell_payload=$([[ -f $CURRENT_THEME_PATH/shell.toml ]] && base64 -w 0 "$CURRENT_THEME_PATH/shell.toml")
if [[ $OMARCHY_THEME_SKIP_BACKGROUND == "1" ]]; then
if [[ ${OMARCHY_THEME_OFFLINE:-} == "1" ]]; then
: # No shell/session bus exists during ISO chroot finalization.
elif [[ $OMARCHY_THEME_SKIP_BACKGROUND == "1" ]]; then
shell_ipc shell applyTheme "$colors_payload" "$shell_payload" || true
else
set_theme_background
@@ -181,13 +183,15 @@ post_theme_commands=(
omarchy-theme-set-keyboard
)
run_parallel "${post_theme_commands[@]}"
if [[ ${OMARCHY_THEME_OFFLINE:-} != "1" ]]; then
run_parallel "${post_theme_commands[@]}"
# Call hook on theme set
omarchy-hook theme-set "$THEME_NAME" >/dev/null
# Call hook on theme set
omarchy-hook theme-set "$THEME_NAME" >/dev/null
# Warm selector caches after the theme is applied. The shell hot-reloads theme
# colors/backgrounds, so keep the running instance alive and preload the picker
# rows/selection to avoid first-open carousel settling after a theme change.
omarchy-theme-switcher --preload >/dev/null 2>&1
omarchy-theme-bg-cache >/dev/null 2>&1 &
# Warm selector caches after the theme is applied. The shell hot-reloads theme
# colors/backgrounds, so keep the running instance alive and preload the picker
# rows/selection to avoid first-open carousel settling after a theme change.
omarchy-theme-switcher --preload >/dev/null 2>&1
omarchy-theme-bg-cache >/dev/null 2>&1 &
fi
+18 -1
View File
@@ -39,6 +39,23 @@ else
} >"$SYSTEM_INFO"
fi
same_or_prefix_log() {
local a="$1" b="$2" size_a size_b min_size
[[ -s $a && -s $b ]] || return 1
cmp -s "$a" "$b" && return 0
size_a=$(stat -c '%s' "$a" 2>/dev/null) || return 1
size_b=$(stat -c '%s' "$b" 2>/dev/null) || return 1
if (( size_a < size_b )); then
min_size=$size_a
else
min_size=$size_b
fi
(( min_size > 0 )) || return 1
cmp -n "$min_size" "$a" "$b" >/dev/null 2>&1
}
case "$LOG_TYPE" in
install)
# In the live ISO before reboot, the target system is mounted at /mnt so the
@@ -58,7 +75,7 @@ install)
cat "$LIVE_OMARCHY_LOG" >>"$TEMP_LOG"
fi
if [[ -s $TARGET_OMARCHY_LOG ]] && ! cmp -s "$LIVE_OMARCHY_LOG" "$TARGET_OMARCHY_LOG" 2>/dev/null; then
if [[ -s $TARGET_OMARCHY_LOG ]] && ! same_or_prefix_log "$LIVE_OMARCHY_LOG" "$TARGET_OMARCHY_LOG"; then
printf '\n========================================\nTARGET OMARCHY INSTALL LOG (%s)\n========================================\n\n' "$TARGET_OMARCHY_LOG" >>"$TEMP_LOG"
cat "$TARGET_OMARCHY_LOG" >>"$TEMP_LOG"
fi
+8 -2
View File
@@ -9,8 +9,14 @@ mkdir -p ~/.config/omarchy/themes
sudo mkdir -p /etc/chromium/policies/managed
sudo chmod a+rw /etc/chromium/policies/managed
# Set initial theme
omarchy-theme-set "Tokyo Night"
# Set initial theme. Offline ISO installs only need the user's theme files and
# symlinks seeded; there is no running desktop/session bus in the chroot, so
# skip shell IPC, dconf, app retint hooks, and background transition work.
if install_mode_is offline; then
OMARCHY_THEME_OFFLINE=1 OMARCHY_THEME_SKIP_BACKGROUND=1 omarchy-theme-set "Tokyo Night"
else
omarchy-theme-set "Tokyo Night"
fi
rm -rf ~/.config/chromium/SingletonLock # otherwise archiso will own the chromium singleton
# Set specific app links for current theme
+3 -1
View File
@@ -1,4 +1,6 @@
run_logged $OMARCHY_INSTALL/login/default-keyring.sh
run_logged $OMARCHY_INSTALL/login/sddm.sh
run_logged $OMARCHY_INSTALL/login/hibernation.sh
if install_mode_is online; then
run_logged $OMARCHY_INSTALL/login/hibernation.sh
fi
run_logged $OMARCHY_INSTALL/login/limine-snapper.sh
+14 -10
View File
@@ -133,19 +133,23 @@ EOF
LIMINE_CONFIGURED=true
fi
echo "Re-enabling mkinitcpio hooks..."
# Restore legacy hook moves from older offline installer paths. Current ISO
# installs mask/unmask hooks in the orchestrator, so these files usually do not
# exist; stay quiet unless there is real cleanup to do.
if [[ -f /usr/share/libalpm/hooks/90-mkinitcpio-install.hook.disabled || -f /usr/share/libalpm/hooks/60-mkinitcpio-remove.hook.disabled ]]; then
echo "Re-enabling mkinitcpio hooks..."
# Restore the specific mkinitcpio pacman hooks
if [[ -f /usr/share/libalpm/hooks/90-mkinitcpio-install.hook.disabled ]]; then
sudo mv /usr/share/libalpm/hooks/90-mkinitcpio-install.hook.disabled /usr/share/libalpm/hooks/90-mkinitcpio-install.hook
if [[ -f /usr/share/libalpm/hooks/90-mkinitcpio-install.hook.disabled ]]; then
sudo mv /usr/share/libalpm/hooks/90-mkinitcpio-install.hook.disabled /usr/share/libalpm/hooks/90-mkinitcpio-install.hook
fi
if [[ -f /usr/share/libalpm/hooks/60-mkinitcpio-remove.hook.disabled ]]; then
sudo mv /usr/share/libalpm/hooks/60-mkinitcpio-remove.hook.disabled /usr/share/libalpm/hooks/60-mkinitcpio-remove.hook
fi
echo "mkinitcpio hooks re-enabled"
fi
if [[ -f /usr/share/libalpm/hooks/60-mkinitcpio-remove.hook.disabled ]]; then
sudo mv /usr/share/libalpm/hooks/60-mkinitcpio-remove.hook.disabled /usr/share/libalpm/hooks/60-mkinitcpio-remove.hook
fi
echo "mkinitcpio hooks re-enabled"
# Final sanity check: assert the Limine config and UKI actually contain what
# they need to boot. Run AFTER snapper setup and hook re-enable so a
# validation failure doesn't leave the system half-configured.
+1
View File
@@ -72,6 +72,7 @@ libqalculate
libreoffice-fresh
llvm
localsend
lua51
luarocks
man-db
mariadb-libs
+7
View File
@@ -2,6 +2,13 @@
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
# omarchy-settings skips this override until cups-browsed is actually present
# to avoid pacman creating cups-browsed.conf.pacnew during ISO package install.
if [[ -f $OMARCHY_PATH/etc-overrides/cups-cups-browsed.conf && -d /etc/cups ]]; then
sudo cp -f "$OMARCHY_PATH/etc-overrides/cups-cups-browsed.conf" /etc/cups/cups-browsed.conf
sudo rm -f /etc/cups/cups-browsed.conf.pacnew
fi
if lspci -nn | grep -q "106b:180[12]"; then
cat <<EOF | sudo tee -a /etc/pacman.conf >/dev/null