Add 4 configurable profiles (stable-cinnamon, stable-niri, mainline-cinnamon, mainline-niri) with a single unified build entry point. - iso/build.sh: replaces build-iso.sh / build-live-iso.sh / build-niri-live-iso.sh; accepts --profile and --type flags - iso/_inner-build-unified.sh: replaces the three _inner-build-*.sh scripts; branches on BUILD_TYPE / DESKTOP / KERNEL_PKG env vars - config/profiles/stable-niri/: new — linux (k6) + niri/Wayland/noctalia - config/profiles/mainline-cinnamon/: new — linux-mainline (k7) + Cinnamon/X11 - config/profiles/mainline-niri/packages.live.list: symlink added - config/profiles/stable-cinnamon/packages.live.list: symlink added - Makefile: PROFILE variable (default stable-cinnamon), shellcheck updated - installer/install.sh: respects DEFAULT_PROFILE env (set by live ISO) - tests/run-qemu-test.sh: passes PROFILE through to build and overlay Live ISOs embed the installer pre-configured for the same profile they were built with (DEFAULT_PROFILE in /etc/profile.d/).
125 lines
4.2 KiB
Bash
Executable File
125 lines
4.2 KiB
Bash
Executable File
#!/bin/bash
|
|
# Void Linux unattended-friendly installer for the XPS 17 (xps9700).
|
|
# Runs inside the Void live ISO. Reads /etc/installer-secrets.env for passwords
|
|
# and /usr/local/share/installer/install.conf for everything else.
|
|
|
|
set -Eeuo pipefail
|
|
|
|
# Resolve the real script path so this works whether invoked directly or via
|
|
# the /usr/local/sbin/install-void symlink.
|
|
INSTALLER_DIR="$(cd "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" && pwd)"
|
|
SHARE_DIR="${INSTALLER_SHARE_DIR:-/usr/local/share/installer}"
|
|
|
|
# shellcheck source=lib/common.sh
|
|
source "$INSTALLER_DIR/lib/common.sh"
|
|
|
|
# ---------- load config ----------
|
|
CONFIG_FILE="${CONFIG_FILE:-$SHARE_DIR/install.conf}"
|
|
[[ -r "$CONFIG_FILE" ]] || die "config file $CONFIG_FILE missing"
|
|
# shellcheck disable=SC1090
|
|
source "$CONFIG_FILE"
|
|
log "loaded config from $CONFIG_FILE"
|
|
|
|
# Drop-in overrides (used by the QEMU test harness).
|
|
if [[ -d "${CONFIG_FILE}.d" ]]; then
|
|
for f in "${CONFIG_FILE}.d"/*.conf; do
|
|
[[ -r "$f" ]] || continue
|
|
# shellcheck disable=SC1090
|
|
source "$f"
|
|
log "loaded override $f"
|
|
done
|
|
fi
|
|
|
|
PKG_LIST_FILE="${PKG_LIST_FILE:-$SHARE_DIR/packages.list}"
|
|
export PKG_LIST_FILE
|
|
[[ -r "$PKG_LIST_FILE" ]] || die "packages.list $PKG_LIST_FILE missing"
|
|
|
|
# ---------- profile ----------
|
|
# PROFILE can be set on the command line or in the environment.
|
|
# If not set, fall back to DEFAULT_PROFILE which the live ISO writes to
|
|
# /etc/profile.d/00-void-installer.sh so the embedded installer defaults to
|
|
# the same configuration the live session was built with.
|
|
PROFILE="${PROFILE:-${DEFAULT_PROFILE:-stable-cinnamon}}"
|
|
export PROFILE
|
|
PROJECT_DIR="${PROJECT_DIR:-$SHARE_DIR}"
|
|
PROFILES_DIR="${PROFILES_DIR:-$SHARE_DIR/profiles}"
|
|
export PROJECT_DIR PROFILES_DIR
|
|
# shellcheck source=lib/profiles.sh
|
|
source "$INSTALLER_DIR/lib/profiles.sh"
|
|
load_profile || die "could not load profile '${PROFILE}'"
|
|
# Profile may override the package list.
|
|
[[ -r "$PROFILE_PACKAGES_FILE" ]] && PKG_LIST_FILE="$PROFILE_PACKAGES_FILE"
|
|
log "using packages list: $PKG_LIST_FILE"
|
|
|
|
load_secrets
|
|
|
|
# ---------- pre-flight ----------
|
|
require_root
|
|
|
|
# Default DEFAULT_ROOT_PART/EFI from config; will be confirmed/overridden by TUI.
|
|
ROOT_PART="${ROOT_PART:-$DEFAULT_ROOT_PART}"
|
|
EFI_PART="${EFI_PART:-$DEFAULT_EFI_PART}"
|
|
TARGET="${TARGET:-/mnt}"
|
|
export TARGET
|
|
|
|
# ---------- modules ----------
|
|
# shellcheck source=lib/tui.sh
|
|
source "$INSTALLER_DIR/lib/tui.sh"
|
|
# shellcheck source=lib/partition.sh
|
|
source "$INSTALLER_DIR/lib/partition.sh"
|
|
# shellcheck source=lib/bootstrap.sh
|
|
source "$INSTALLER_DIR/lib/bootstrap.sh"
|
|
# shellcheck source=lib/grub.sh
|
|
source "$INSTALLER_DIR/lib/grub.sh"
|
|
# shellcheck source=lib/postinstall.sh
|
|
source "$INSTALLER_DIR/lib/postinstall.sh"
|
|
# shellcheck source=lib/customizations.sh
|
|
source "$INSTALLER_DIR/lib/customizations.sh"
|
|
|
|
# ---------- run ----------
|
|
banner() {
|
|
cat <<'EOF'
|
|
|
|
╔══════════════════════════════════════════════════════════════╗
|
|
║ Void Linux Installer (xps9700) ║
|
|
║ target: btrfs on a single partition, dual-boot Windows ║
|
|
║ desktop: cinnamon | docker | vscode | nvidia PRIME ║
|
|
╚══════════════════════════════════════════════════════════════╝
|
|
EOF
|
|
}
|
|
|
|
main() {
|
|
banner
|
|
log "starting installer (UNATTENDED=${UNATTENDED:-0}, TEST_MODE=${TEST_MODE:-0})"
|
|
|
|
tui_select_install_target
|
|
setup_filesystems
|
|
bootstrap_base
|
|
generate_fstab
|
|
mount_pseudo_fs
|
|
|
|
configure_system
|
|
configure_users
|
|
configure_ssh_config
|
|
configure_nvidia_prime
|
|
configure_zram
|
|
configure_nix
|
|
[[ "${DESKTOP:-cinnamon}" != "niri" ]] && install_vscode_real
|
|
install_customizations
|
|
enable_services
|
|
install_grub
|
|
reconfigure_all
|
|
|
|
unmount_target
|
|
|
|
ok "Installation complete."
|
|
log "Log file: $LOG_FILE"
|
|
if [[ "${TEST_MODE:-0}" != "1" && "${UNATTENDED:-0}" != "1" ]]; then
|
|
if confirm "Reboot now?"; then
|
|
systemctl reboot 2>/dev/null || reboot
|
|
fi
|
|
fi
|
|
}
|
|
|
|
main "$@"
|