Improve messages for x86_64, replace configure stormux with the installer.

This commit is contained in:
Storm Dragon
2025-11-23 00:24:46 -05:00
parent 1964121c8c
commit c31612ca51
2 changed files with 141 additions and 195 deletions

View File

@@ -9,21 +9,11 @@ fi
trap cleanup EXIT trap cleanup EXIT
cleanup() { cleanup() {
popd &> /dev/null
if ! [[ -x /opt/configure-stormux/configure-stormux.sh ]]; then
echo "Initial setup is not complete." echo "Initial setup is not complete."
echo "To continue setup, please run:" echo "To continue setup, please run:"
echo "sudo configure-stormux" echo "sudo configure-stormux"
fi
} }
if [[ -x /opt/configure-stormux/configure-stormux.sh ]]; then
pushd /opt/configure-stormux
./configure-stormux.sh
exit 0
fi
# Volume calibration is now handled in stormux_first_boot.sh # Volume calibration is now handled in stormux_first_boot.sh
export DIALOGOPTS='--insecure --no-lines --visit-items' export DIALOGOPTS='--insecure --no-lines --visit-items'
@@ -36,7 +26,7 @@ set_timezone() {
region=$(dialog --backtitle "Please select your Region" \ region=$(dialog --backtitle "Please select your Region" \
--no-tags \ --no-tags \
--menu "Use up and down arrows or page-up and page-down to navigate the list, and press 'Enter' to make your selection." 0 0 0 \ --menu "Use up and down arrows or page-up and page-down to navigate the list, and press 'Enter' to make your selection." 0 0 0 \
$(for i in ${regions[@]} ; do echo "$i";echo "$i";done) --stdout) $(for i in "${regions[@]}" ; do echo "$i";echo "$i";done) --stdout)
mapfile -t cities < <(timedatectl --no-pager list-timezones | grep "$region" | cut -d '/' -f2 | sort -u) mapfile -t cities < <(timedatectl --no-pager list-timezones | grep "$region" | cut -d '/' -f2 | sort -u)
@@ -45,13 +35,13 @@ set_timezone() {
city=$(dialog --backtitle "Please select a city near you" \ city=$(dialog --backtitle "Please select a city near you" \
--no-tags \ --no-tags \
--menu "Use up and down arrow or page-up and page-down to navigate the list." 0 0 10 \ --menu "Use up and down arrow or page-up and page-down to navigate the list." 0 0 10 \
$(for i in ${cities[@]} ; do echo "$i";echo "$i";done) --stdout) $(for i in "${cities[@]}" ; do echo "$i";echo "$i";done) --stdout)
# Set the timezone # Set the timezone
if [[ -f /etc/localtime ]]; then if [[ -f /etc/localtime ]]; then
rm /etc/localtime rm /etc/localtime
fi fi
ln -sf /usr/share/zoneinfo/${region}/${city} /etc/localtime ln -sf /usr/share/zoneinfo/"${region}"/"${city}" /etc/localtime
timedatectl set-ntp true timedatectl set-ntp true
} }
# Offer to switch fenrir layout. # Offer to switch fenrir layout.
@@ -65,29 +55,6 @@ if [[ "${continue,}" == "y" ]];then
systemctl restart fenrirscreenreader.service systemctl restart fenrirscreenreader.service
fi fi
# Check for possible resize
diskSource="$(df --output='source' / | tail -1)"
diskSize="$(df -h --output='size' / | tail -1 | tr -cd '[:digit:].')"
diskSize=${diskSize%.*}
if [[ $diskSize -le 7 ]]; then
echo "$diskSource is only $diskSize gigs, which means it probably needs to be resized. Would you like to do this now?"
echo "Press y for yes or n for no followed by enter."
read -r continue
continue="${continue::1}"
if [[ "${continue,}" == "y" ]];then
# Extract base device name (handles mmcblk0p2, nvme0n1p2, sda2, etc.)
if [[ "$diskSource" =~ (.*[0-9]+)p[0-9]+$ ]]; then
# Handle mmcblk0p2, nvme0n1p2 style
diskDevice="${BASH_REMATCH[1]}"
else
# Handle sda2, sdb3 style
diskDevice="$(echo "$diskSource" | sed 's/[0-9]*$//')"
fi
echo "Yes" | sudo "${sudoFlags[@]}" parted ---pretend-input-tty "$diskDevice" resizepart 2 100%
sudo "${sudoFlags[@]}" resize2fs -f "$diskSource"
fi
fi
if ! ping -c1 stormux.org &> /dev/null ; then if ! ping -c1 stormux.org &> /dev/null ; then
echo "No internet connection detected. Press enter to open NetworkManager." echo "No internet connection detected. Press enter to open NetworkManager."
read -r continue read -r continue
@@ -103,39 +70,23 @@ if ping -qc1 -W 1 stormux.org &> /dev/null; then
echo "Current date and time: $date_time" echo "Current date and time: $date_time"
# set date and time # set date and time
date -s "$date_time" date -s "$date_time"
echo "If your Pi does not have a CMOS battery and is powered off regularly, it may take a while for the time to be set correctly after boot."
echo "Stormux provides a service to sync the time after internet connection is established."
read -rp "Would you like the time to sync as soon as the Pi connects to the internet? " answer
answer="${answer:0:1}"
if [[ "${answer,,}" == "y" ]]; then
systemctl enable time_sync_at_boot.service
else
echo "Time sync at boot skipped."
echo "If you change your mind later, simply type:"
echo "sudo systemctl enable time_sync_at_boot.service"
fi
set_timezone set_timezone
else else
echo "Please connect to the internet and run ${0##*/} again." echo "Please connect to the internet and run ${0##*/} again."
exit 1 exit 1
fi fi
echo "Installing configure-stormux..."
git -C /opt clone -q https://git.stormux.org/storm/configure-stormux || exit 1
echo echo
echo "Initial setup is complete." echo "Initial setup is complete."
echo echo
echo "The default passwords are stormux for the stormux user" read -rp "Would you like to run the Stormux installer? [y/N]: " answer
echo "and root for the root user. It is highly recommended to change them." answer="${answer:0:1}"
echo "To change the password for stormux, run:" if [[ "${answer,,}" == "y" ]]; then
echo "passwd" install-stormux
echo "To change the password for root, run:" else
echo "sudo passwd" echo
echo echo "To run the Stormux installer, type install-stormux"
echo "For more configuration options, run configure-stormux," echo
echo "or you may configure your system manually." echo "Thank you for choosing Stormux."
echo exit 0
echo "Thank you for choosing Stormux." fi
exit 0

View File

@@ -1352,47 +1352,46 @@ cleanup_and_unmount() {
# Main installation flow # Main installation flow
# #
main() { echo ""
echo "" echo "╔════════════════════════════════════════════╗"
echo "╔════════════════════════════════════════════╗" echo "║ Stormux Installer for Arch Linux ║"
echo "║ Stormux Installer for Arch Linux ║" echo "║ Accessibility-First System Installation ║"
echo "║ Accessibility-First System Installation ║" echo "╚════════════════════════════════════════════╝"
echo "╚════════════════════════════════════════════╝" echo ""
echo ""
log_info "=== Stormux Installer Started ===" log_info "=== Stormux Installer Started ==="
log_info "Installation log: $logFile" log_info "Installation log: $logFile"
# Pre-flight checks # Pre-flight checks
if ! preflight_checks; then if ! preflight_checks; then
log_error "Pre-flight checks failed" log_error "Pre-flight checks failed"
exit 1 exit 1
fi fi
# Disk selection # Disk selection
echo "=== Disk Selection ===" echo "=== Disk Selection ==="
echo "" echo ""
if ! select_disk targetDisk "Select target disk for Stormux installation:"; then if ! select_disk targetDisk "Select target disk for Stormux installation:"; then
log_error "Target disk selection cancelled" log_error "Target disk selection cancelled"
echo "Installation cancelled." echo "Installation cancelled."
exit 1 exit 1
fi fi
if ! confirm_disk_destruction "$targetDisk"; then if ! confirm_disk_destruction "$targetDisk"; then
log_error "Disk destruction not confirmed" log_error "Disk destruction not confirmed"
echo "Installation cancelled." echo "Installation cancelled."
exit 1 exit 1
fi fi
# Partition layout selection # Partition layout selection
if ! select_partition_layout; then if ! select_partition_layout; then
log_error "Partition layout selection cancelled" log_error "Partition layout selection cancelled"
echo "Installation cancelled." echo "Installation cancelled."
exit 1 exit 1
fi fi
# If separate disk layout, select home disk # If separate disk layout, select home disk
if [[ "$partitionLayout" == "separate_disk" ]]; then if [[ "$partitionLayout" == "separate_disk" ]]; then
echo "" echo ""
if ! select_disk homeDisk "Select disk for /home partition:"; then if ! select_disk homeDisk "Select disk for /home partition:"; then
log_error "Home disk selection cancelled" log_error "Home disk selection cancelled"
@@ -1405,102 +1404,98 @@ main() {
echo "Installation cancelled." echo "Installation cancelled."
exit 1 exit 1
fi fi
fi fi
# Gather system information # Gather system information
if ! gather_system_info; then if ! gather_system_info; then
log_error "System information gathering failed" log_error "System information gathering failed"
exit 1 exit 1
fi fi
# Partition disks # Partition disks
if ! partition_disks; then if ! partition_disks; then
log_error "Disk partitioning failed" log_error "Disk partitioning failed"
echo "ERROR: Disk partitioning failed" echo "ERROR: Disk partitioning failed"
play_sound error play_sound error
exit 1 exit 1
fi fi
# Create filesystems # Create filesystems
if ! create_filesystems; then if ! create_filesystems; then
log_error "Filesystem creation failed" log_error "Filesystem creation failed"
echo "ERROR: Filesystem creation failed" echo "ERROR: Filesystem creation failed"
play_sound error play_sound error
exit 1 exit 1
fi fi
# Mount filesystems # Mount filesystems
if ! mount_filesystems; then if ! mount_filesystems; then
log_error "Filesystem mounting failed" log_error "Filesystem mounting failed"
echo "ERROR: Filesystem mounting failed" echo "ERROR: Filesystem mounting failed"
play_sound error play_sound error
exit 1 exit 1
fi fi
# Install base system # Install base system
if ! install_base_system; then if ! install_base_system; then
log_error "Base system installation failed" log_error "Base system installation failed"
cleanup_and_unmount cleanup_and_unmount
exit 1 exit 1
fi fi
# Install audio configurations # Install audio configurations
if ! install_audio_configs; then if ! install_audio_configs; then
log_error "Audio configuration failed" log_error "Audio configuration failed"
cleanup_and_unmount cleanup_and_unmount
exit 1 exit 1
fi fi
# Configure system # Configure system
if ! configure_system; then if ! configure_system; then
log_error "System configuration failed" log_error "System configuration failed"
cleanup_and_unmount cleanup_and_unmount
exit 1 exit 1
fi fi
# Install bootloader # Install bootloader
if ! install_bootloader; then if ! install_bootloader; then
log_error "Bootloader installation failed" log_error "Bootloader installation failed"
cleanup_and_unmount cleanup_and_unmount
exit 1 exit 1
fi fi
# Install helper scripts # Install helper scripts
if ! install_helper_scripts; then if ! install_helper_scripts; then
log_warning "Helper script installation had issues (non-fatal)" log_warning "Helper script installation had issues (non-fatal)"
fi fi
# Cleanup and unmount # Cleanup and unmount
cleanup_and_unmount cleanup_and_unmount
# Success message # Success message
echo "" echo ""
echo "╔════════════════════════════════════════════╗" echo "╔════════════════════════════════════════════╗"
echo "║ Installation Complete Successfully! ║" echo "║ Installation Complete Successfully! ║"
echo "╚════════════════════════════════════════════╝" echo "╚════════════════════════════════════════════╝"
echo "" echo ""
echo "Next steps:" echo "Next steps:"
echo " 1. Remove the installation media" echo " 1. Remove the installation media"
echo " 2. Reboot your system" echo " 2. Reboot your system"
echo " 3. Log in with one of your user accounts: ${userNames[*]}" echo " 3. Log in with one of your user accounts: ${userNames[*]}"
if [[ "$desktopEnvironment" == "i3" ]]; then if [[ "$desktopEnvironment" == "i3" ]]; then
echo " 4. Your i3 desktop is configured with I38 for accessibility" echo " 4. Your i3 desktop is configured with I38 for accessibility"
echo " - I38 source is available in ~/git/I38 for customization" echo " - I38 source is available in ~/git/I38 for customization"
echo " - Press Alt+Shift+F1 for I38 help after login" echo " - Press Alt+Shift+F1 for I38 help after login"
echo " 5. Run 'configure-stormux' for additional setup" echo " 5. Run 'configure-stormux' for additional setup"
else else
echo " 4. Run 'configure-stormux' for additional setup" echo " 4. Run 'configure-stormux' for additional setup"
fi fi
echo "" echo ""
echo "Installation log saved to: $logFile" echo "Installation log saved to: $logFile"
echo "" echo ""
log_info "=== Stormux Installer Completed Successfully ===" log_info "=== Stormux Installer Completed Successfully ==="
read -rp "Press Enter to exit..." read -rp "Press Enter to exit..."
}
# Run main installation
main "$@"