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 "For more configuration options, run configure-stormux," echo "To run the Stormux installer, type install-stormux"
echo "or you may configure your system manually."
echo echo
echo "Thank you for choosing Stormux." echo "Thank you for choosing Stormux."
exit 0 exit 0
fi

View File

@@ -1352,7 +1352,6 @@ 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 ║"
@@ -1500,7 +1499,3 @@ main() {
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 "$@"