# globals {
# immutable values
-readonly VER="1.7.13" # Installer version
+readonly VER="1.7.14" # Installer version
readonly DIST="ArchLabs" # Linux distributor
readonly LIVE="liveuser" # Live session user
readonly MNT="/mnt/install" # Install mountpoint
8) src $srcdir/dutch.trans && LOC="nl_NL.UTF-8" ;;
9) src $srcdir/hungarian.trans && LOC="hu_HU.UTF-8" FONT="lat2-16" ;;
10) src $srcdir/chinese.trans && LOC="zh_CN.UTF-8" ;;
- *) die 0
+ *) die
esac
sed -i "s/#en_US.UTF-8/en_US.UTF-8/" /etc/locale.gen
tput civis
local exitstr
- [[ $DEBUG == true ]] && exitstr="View Log & Shutdown" || exitstr="Exit & Reboot"
+ [[ $DEBUG == true ]] && exitstr="View Log & Exit" || exitstr="Exit"
SELECTED=$(dialog --cr-wrap --stdout --backtitle "$BT" \
--title " $_EditTitle " --default-item $SELECTED --menu "$_EditBody" 0 0 0 \
"9" "${BOOTLDR^}" "10" "Pacman.conf" "11" "${LOGIN_TYPE^}")
if [[ ! $SELECTED || $SELECTED -eq 1 ]]; then
- [[ $DEBUG == true ]] && { more /tmp/debug-log; die 'shutdown -h now'; }
- die 'systemctl -i reboot'
+ [[ $DEBUG == true ]] && more /tmp/debug-log
+ die
else
local existing_files=""
for f in $(printf "%s" "${EDIT_FILES[$SELECTED]}"); do
6) configure_system_settings || SELECTED=5 ;;
7) display_system_settings ;;
8) install ;;
- *) yesno "$_CloseInst" "$_CloseInstBody" "Exit" "Back" && die 0
+ *) yesno "$_CloseInst" "$_CloseInstBody" "Exit" "Back" && die
esac
}
return 0
}
-unmount_install_partitions() {
- swapoff -a
- if [[ -d $MNT ]]; then
- umount -R $MNT # >/dev/null 2>&1
- fi
-}
-
select_swap() {
# Ask user to select partition or create swapfile
tput civis
--menu "${msg}$_DevSelBody" 0 0 0 $SYS_DEVS)"; then
return 1
fi
- else
- msg="\nNo available devices to use$([[ $1 == 'boot' ]] && printf " for bootloader")."
- msgbox "$_ErrTitle" "$msg\n$_Exit"
- die 1
+ elif [[ $DEV_COUNT -lt 1 && $1 != 'boot' ]]; then
+ msgbox "$_ErrTitle" "\nNo available devices to use.\n$_Exit"; die 1
fi
# if the device selected was for bootloader, set the BOOT_DEVICE
}
die() {
- tput cnorm
- if [[ -d $MNT ]] && cd; then
- fuser -km $MNT
- unmount_install_partitions
- if ! [[ $1 =~ [0-9] ]]; then
- fuser -km /run/archiso/bootmnt
- umount -l /run/archiso/bootmnt
- fi
- fi
- [[ $1 =~ [0-9] ]] && exit $1 || $1
+ local exitcode=0
+ (( $# == 0 )) || exitcode=$1
+ tput cnorm; unmount_install_partitions; exit $exitcode
}
sigint() {
infobox "$_ErrTitle" "$_NoNetwork" 3
fi
fi
+ else
+ export HAS_NETWORK=true
fi
return 0
}
msg="$([[ $err == "" ]] && printf "%s" "$msg")\n$_ErrChoice"
if [[ -e /tmp/debug-log && $TERM == 'linux' ]]; then
msg="$([[ $err == "" ]] && printf "%s" "$msg")\n$_ErrChoiceConsole"
- yesno "$_ErrTitle" "$msg" "Exit & Open Log" "Ignore & Continue" && { more /tmp/debug-log; die 0; }
+ yesno "$_ErrTitle" "$msg" "Exit & Open Log" "Ignore & Continue" && { more /tmp/debug-log; die; }
else
- yesno "$_ErrTitle" "$msg" "Exit & Shutdown" "Ignore & Continue" && die 'shutdown -h now'
+ yesno "$_ErrTitle" "$msg" "Exit" "Ignore & Continue" && die
fi
return 0
}
fi
export DEBUG=true
}
+
+unmount_install_partitions() {
+ swapoff -a
+ [[ -d $MNT ]] && umount -R $MNT >/dev/null 2>&1
+ return 0
+}