From 3e4e9657632a8a1351739abcfcfd70fd5b41c498 Mon Sep 17 00:00:00 2001 From: natemaia Date: Sun, 17 May 2020 14:46:01 -0700 Subject: [PATCH] Cleanup --- installer | 33 ++++++++++++--------------------- 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/installer b/installer index 9207585..7721b25 100755 --- a/installer +++ b/installer @@ -393,7 +393,7 @@ main() tput civis dialog --backtitle "$DIST Installer - $SYS - v$VER" --title " Prepare " \ --default-item $SEL --cancel-label 'Exit' --menu "$_prep" 0 0 0 \ - 1 "Device management" \ + 1 "Storage device management" \ 2 "* Mount partitions" \ 3 "* Select bootloader" \ 4 "* Username and password" \ @@ -862,9 +862,9 @@ dev_menu() [[ $txt ]] && back="Return to mounting" while :; do - dlg DEVMNG_OPT menu "Device Management" "\nSelect an operation from the list below.$txt" \ + dlg DEVMNG_OPT menu "Device Management" "\nHere you can perform some basic operations to modify system storage devices.\n$txt" \ 'view' 'View the device tree output from lsblk' \ - 'part' 'Change the partition layout of a device' \ + 'part' 'Modify the partition layout of a device' \ 'luks' 'Setup LUKS encryption on a partition or LVM' \ 'lvm' 'Setup logical volume management on partition(s)' \ 'Back' "$back" || return 0 @@ -1508,7 +1508,7 @@ select_filesystem() BTRFS=0 until [[ $fs ]]; do - dlg fs menu "File System" "$txt" $([[ $cur ]] && printf 'skip -') \ + dlg fs menu "File System" "$txt" $([[ $cur ]] && printf "skip 'Do not format this partition'") \ ext4 "The evolution of the most used Linux file system, successor to Ext3" \ ext3 "Third extended file system, successor to Ext2" \ ext2 "Second extended file system, unlike 3/4 it is not journaled and obsolete" \ @@ -3302,17 +3302,15 @@ system_identify() ############################################################################### # entry point -# enable some nicer colours in the linux console termcol -MISS="" +MISSING="" for i in dialog find parted curl arch-chroot; do - hash $i >/dev/null 2>&1 || MISS+="$i " + hash $i >/dev/null 2>&1 || MISSING+="$i " done -# ensure the required packages are installed and that we're running as root on x86_64 architecture -if [[ $MISS ]]; then - printf "This installer requires the following package(s) to be installed:\n\n\t%s" "$MISS" +if [[ $MISSING ]]; then + printf "This installer requires the following package(s) to be installed:\n\n\t%s" "$MISSING" die 1 elif (( UID != 0 )); then msg "Not Root" "\nThis installer must be run as root.\n\nExiting..\n" 2 @@ -3322,7 +3320,6 @@ elif ! grep -qm 1 ' lm ' /proc/cpuinfo; then die 1 fi -# trap ^C to perform cleanup trap 'printf "\n^C\n" && die 1' INT while getopts ":htl:Dnr:b:m:d:" OPT; do @@ -3347,28 +3344,26 @@ while getopts ":htl:Dnr:b:m:d:" OPT; do ;; \?) echo "invalid option: $OPTARG" - die 1 + die 2 ;; esac done -# verify mountpoint and distro name if [[ ! -d $MNT ]]; then msg "Invalid Mountpoint" "\nThe installer expects an existing directory for mounting.\n\nExiting..\n" 2 - die 1 + die 2 elif [[ -z $DIST ]]; then msg "Invalid Distribution" "\nThe distribution name cannot be empty.\n\nExiting..\n" 2 - die 1 + die 2 fi system_identify system_devices -# verify partitions for self mounted installs if [[ $NOMOUNT ]]; then if [[ -z $ROOT || ($SYS == 'UEFI' && -z $BOOT) ]]; then msg "Invalid Partitions" "$_errpart" 0 - die 1 + die 2 fi if [[ $BOOT ]]; then part_bootdev @@ -3376,7 +3371,6 @@ if [[ $NOMOUNT ]]; then fi fi -# linux console font setup if [[ $TERM == 'linux' ]]; then if [[ -f /tmp/font ]]; then FONT="$(< /tmp/font)" @@ -3396,7 +3390,6 @@ if [[ $TERM == 'linux' ]]; then fi fi -# welcome once if [[ ! -f /tmp/weld ]]; then msg "Welcome to the $DIST Installer" "\nThis will help you get $DIST installed and setup on your system.\n\nIf you are unsure about an option, the default or most common\nwill be mentioned or the first selected entry will be the default.\n\n\nMenu Navigation:\n\n - Select items with the arrow keys or the option number.\n - Use [Space] to toggle check boxes and [Enter] to accept.\n - Switch between fields using [Tab] or the arrow keys.\n - Use [Page Up] and [Page Down] to jump whole pages\n - Press the highlighted key of an option to select it.\n" touch /tmp/weld @@ -3410,7 +3403,6 @@ elif ! net_connect; then die 1 fi -# check for update once if [[ ! -f /tmp/new ]]; then msg "Installer Update" "\nChecking for newer installer versions.\n" 1 if curl -fsSL 'https://bitbucket.org/archlabslinux/installer/raw/master/installer' -o /tmp/new; then @@ -3418,7 +3410,6 @@ if [[ ! -f /tmp/new ]]; then cp /tmp/new /usr/bin/installer chmod +x /usr/bin/installer exec /usr/bin/installer "$@" - die fi else msg "Download Failed" "\nUnable to download the latest version, continuing with the current.\n" 2