More work on the installer, not quite ready yet, but at a good save point.

This commit is contained in:
Storm Dragon
2025-11-24 21:29:19 -05:00
parent 3df5017766
commit 855be1afcd
2 changed files with 79 additions and 67 deletions

View File

@@ -550,13 +550,19 @@ gather_system_info() {
log_info "=== System Configuration ==="
# Hostname
read -rp "Enter hostname for the new system: " hostname
echo "Enter hostname for the new system:"
read -r hostname
log_info "Hostname set to: $hostname"
# Root password
while true; do
read -rsp "Enter root password: " rootPassword
read -rsp "Confirm root password: " rootPasswordConfirm
echo ""
echo "Enter root password:"
read -rs rootPassword
echo ""
echo "Confirm root password:"
read -rs rootPasswordConfirm
echo ""
if [[ "$rootPassword" == "$rootPasswordConfirm" ]]; then
log_info "Root password set"
@@ -568,11 +574,14 @@ gather_system_info() {
# User accounts (loop until empty username)
log_info "=== User Account Setup ==="
echo ""
echo "Press Enter without typing a username when done adding users."
local userCount=0
while true; do
read -rp "Enter username (or press Enter to finish): " currentUser
echo ""
echo "Enter username (or press Enter to finish):"
read -r currentUser
# If empty, break out of loop
if [[ -z "$currentUser" ]]; then
@@ -603,8 +612,13 @@ gather_system_info() {
local currentPassword
local currentPasswordConfirm
while true; do
read -rsp "Enter password for $currentUser: " currentPassword
read -rsp "Confirm password for $currentUser: " currentPasswordConfirm
echo ""
echo "Enter password for $currentUser:"
read -rs currentPassword
echo ""
echo "Confirm password for $currentUser:"
read -rs currentPasswordConfirm
echo ""
if [[ "$currentPassword" == "$currentPasswordConfirm" ]]; then
break
@@ -615,7 +629,9 @@ gather_system_info() {
# Ask if user should have root privileges (wheel group)
local isAdmin
read -rp "Should $currentUser have root privileges (sudo access)? [y/N]: " isAdmin
echo ""
echo "Should $currentUser have root privileges (sudo access)? [y/N]:"
read -r isAdmin
if [[ "$isAdmin" =~ ^[Yy]$ ]]; then
isAdmin="yes"
echo "$currentUser will have sudo access."
@@ -664,9 +680,11 @@ gather_system_info() {
# Game manager installation (only if desktop environment selected)
if [[ "$desktopEnvironment" != "none" ]]; then
echo ""
echo "=== Optional Game Managers ==="
read -rp "Install linux-game-manager (native Linux games)? [y/N]: " lgmChoice
echo ""
echo "Install linux-game-manager (native Linux games)? [y/N]:"
read -r lgmChoice
if [[ "$lgmChoice" =~ ^[Yy]$ ]]; then
installLinuxGameManager="yes"
log_info "Linux Game Manager will be installed"
@@ -675,7 +693,9 @@ gather_system_info() {
log_info "Linux Game Manager will not be installed"
fi
read -rp "Install audiogame-manager (Windows games via Wine)? [y/N]: " agmChoice
echo ""
echo "Install audiogame-manager (Windows games via Wine)? [y/N]:"
read -r agmChoice
if [[ "$agmChoice" =~ ^[Yy]$ ]]; then
installAudiogameManager="yes"
log_info "Audiogame Manager will be installed"
@@ -686,7 +706,9 @@ gather_system_info() {
fi
# SSH configuration
read -rp "Enable SSH server (sshd) on boot? [y/N]: " sshChoice
echo ""
echo "Enable SSH server (sshd) on boot? [y/N]:"
read -r sshChoice
if [[ "$sshChoice" =~ ^[Yy]$ ]]; then
enableSsh="yes"
log_info "SSH server will be enabled"
@@ -701,30 +723,38 @@ gather_system_info() {
if command -v timedatectl >/dev/null 2>&1; then
currentTimezone=$(timedatectl show --property=Timezone --value 2>/dev/null || true)
if [[ -n "$currentTimezone" && "$currentTimezone" != "n/a" ]]; then
echo ""
echo "Detected timezone: $currentTimezone"
read -rp "Press Enter to use this timezone, or type a new one (e.g., America/New_York): " timezoneInput
echo "Press Enter to use this timezone, or type a new one (e.g., America/New_York):"
read -r timezoneInput
if [[ -n "$timezoneInput" ]]; then
timezone="$timezoneInput"
else
timezone="$currentTimezone"
fi
else
read -rp "Enter timezone (e.g., America/New_York): " timezone
echo ""
echo "Enter timezone (e.g., America/New_York):"
read -r timezone
fi
else
read -rp "Enter timezone (e.g., America/New_York): " timezone
echo ""
echo "Enter timezone (e.g., America/New_York):"
read -r timezone
fi
log_info "Timezone set to: $timezone"
echo ""
echo "Configuration summary:"
echo " Hostname: $hostname"
echo " Users: ${userNames[*]}"
echo " Desktop: $desktopEnvironment"
echo " SSH enabled: $enableSsh"
echo " Timezone: $timezone"
read -rp "Press Enter to continue with installation..."
echo ""
echo "Press Enter to continue with installation..."
read -r
}
#
@@ -1003,9 +1033,6 @@ sudo -iu $(printf %q "$username") bash <<'USER_CONFIG_EOF'
git config --global init.defaultBranch master
xdg-user-dirs-update
USER_CONFIG_EOF
if [[ -x /usr/share/fenrirscreenreader/tools/configure_pipewire.sh ]]; then
sudo -u $(printf %q "$username") /usr/share/fenrirscreenreader/tools/configure_pipewire.sh
fi
echo \"Created user: $username\"
"
done
@@ -1020,6 +1047,14 @@ pacman -Sy --noconfirm --needed ${stormuxPackages[*]} 2>/dev/null || true
"
fi
# Build pipewire configuration command for all users
local pipewireConfigCmd=""
for username in "${userNames[@]}"; do
pipewireConfigCmd+="
sudo -u $(printf %q "$username") /usr/share/fenrirscreenreader/tools/configure_pipewire.sh 2>/dev/null || true
"
done
# Run configuration in chroot using heredoc (like pi4 script)
if ! arch-chroot "$mountPoint" /bin/bash <<EOF
set -euo pipefail
@@ -1067,14 +1102,6 @@ echo "root:${rootPassword}" | chpasswd
echo '%wheel ALL=(ALL) ALL' > /etc/sudoers.d/wheel
chmod 440 /etc/sudoers.d/wheel
# Enable pipewire globally
systemctl --global enable pipewire.service pipewire-pulse.service
# Configure pipewire for Fenrir screen reader
if [[ -x /usr/share/fenrirscreenreader/tools/configure_pipewire.sh ]]; then
/usr/share/fenrirscreenreader/tools/configure_pipewire.sh
fi
# Disable systemd-networkd in favor of NetworkManager
systemctl disable systemd-networkd.service systemd-networkd.socket 2>/dev/null || true
@@ -1093,16 +1120,9 @@ if [[ "${enableSsh}" == "yes" ]]; then
echo "SSH server enabled"
fi
# Enable display manager based on desktop environment
if [[ "${desktopEnvironment}" == "i3" ]] || [[ "${desktopEnvironment}" == "mate" ]]; then
# Configure nodm for automatic login
sed -i "s/{user}/\${userNames[0]}/g" /etc/nodm.conf
systemctl enable nodm.service
fi
# Setup desktop environment configurations
if [[ "${desktopEnvironment}" == "i3" ]]; then
firstUser="\${userNames[0]}"
firstUser="${userNames[0]}"
# Create git directory for better organization
mkdir -p /home/\$firstUser/git
@@ -1126,7 +1146,7 @@ if [[ "${desktopEnvironment}" == "i3" ]]; then
cd - > /dev/null || exit 1
fi
elif [[ "${desktopEnvironment}" == "mate" ]]; then
firstUser="\${userNames[0]}"
firstUser="${userNames[0]}"
# Create .xinitrc for MATE
cat > /home/\$firstUser/.xinitrc <<'XINITRC_MATE_EOF'
@@ -1202,6 +1222,28 @@ pacman-key --lsign-key 73580DE2EDDFA6D6 2>/dev/null || true
# Install Stormux-specific packages (built dynamically before chroot)
$stormuxPackagesCmd
# Enable pipewire globally for all users (creates symlinks in /etc/systemd/user/)
systemctl --global enable pipewire.service pipewire-pulse.service wireplumber.service
# Configure pipewire for Fenrir screen reader (run as root first)
if [[ -x /usr/share/fenrirscreenreader/tools/configure_pipewire.sh ]]; then
/usr/share/fenrirscreenreader/tools/configure_pipewire.sh 2>/dev/null || true
fi
# Configure pipewire for each user (built dynamically before chroot)
$pipewireConfigCmd
# Configure nodm for automatic login (only after nodm package is installed)
if [[ "${desktopEnvironment}" == "i3" ]] || [[ "${desktopEnvironment}" == "mate" ]]; then
if [[ -f /etc/nodm.conf ]]; then
sed -i "s/{user}/${userNames[0]}/g" /etc/nodm.conf
systemctl enable nodm.service
echo "Display manager (nodm) configured for ${userNames[0]}"
else
echo "Warning: /etc/nodm.conf not found, skipping nodm configuration"
fi
fi
# Create system-wide accessibility configuration
cat > /etc/profile.d/stormux-accessibility.sh <<'PROFILE_EOF'
#!/bin/sh
@@ -1289,36 +1331,6 @@ EOF
# Post-installation tasks
#
install_helper_scripts() {
log_info "=== Installing Helper Scripts ==="
log_info "Installing configure-stormux script"
# Check if configure-stormux exists on live system
if [[ -f /usr/local/bin/configure-stormux ]]; then
cp /usr/local/bin/configure-stormux "$mountPoint/usr/local/bin/"
chmod +x "$mountPoint/usr/local/bin/configure-stormux"
log_info "configure-stormux copied from live system"
else
# Create a basic version that downloads the full version
cat > "$mountPoint/usr/local/bin/configure-stormux" <<'EOF'
#!/usr/bin/env bash
# Configure Stormux - Post-installation configuration script
echo "Downloading latest configure-stormux script..."
cd /tmp || exit 1
wget -q https://git.stormux.org/storm/configure-stormux/raw/branch/master/configure-stormux.sh -O configure-stormux
chmod +x configure-stormux
./configure-stormux
EOF
chmod +x "$mountPoint/usr/local/bin/configure-stormux"
log_info "configure-stormux stub created"
fi
log_info "Helper scripts installed"
log_info "Helper scripts installation complete"
}
install_game_managers() {
# Only run if at least one game manager is selected
if [[ "$installLinuxGameManager" == "no" && "$installAudiogameManager" == "no" ]]; then

View File

@@ -136,7 +136,7 @@ udftools
usb_modeswitch
usbmuxd
usbutils
vim
vi
virtualbox-guest-utils-nox
vpnc
w3m-git