Update, another attempted fix for hanging on shutdown

This commit is contained in:
natemaia 2018-11-08 00:25:02 -08:00
parent 7426259dc5
commit 3d41c04f36
14 changed files with 74 additions and 49 deletions

View File

@ -175,4 +175,4 @@ _LvmPartErrBody="没有可用于逻辑卷管理的可用分区,至少需要一
_LvmLvNameErrBody="输入的名称无效。逻辑卷LV名称可能是字母数字但不能包含空格或以'/'开头。\n"
_LvmLvSizeErrBody="\n输入的值无效。\n\n必须是最后以'M'(兆字节)或'G'(千兆字节)表示的数值。\n\n示例包括100M10G或250M。\n值 也可能不等于或大于VG的剩余尺寸。"
# vim:ft=sh:tw=0:syntax=off:nospell
# vim:tw=9999:syntax=off:nospell

View File

@ -194,4 +194,4 @@ _CloseInst="Sluit het installatieprogramma"
_CloseInstBody="\nUnmount partities en sluit het installatieprogramma?\n"
_InstFinBody="\nDe installatie is nu voltooid.\n\nWilt u het installatieprogramma sluiten en opnieuw opstarten?"
# vim:ft=sh:tw=0:syntax=off:nospell
# vim:tw=9999:syntax=off:nospell

View File

@ -16,16 +16,16 @@ _Name="Name:"
# Welcome
_WelTitle="Welcome to"
_WelBody="This will unpack and help you setup $DIST on your system\n\nMenu Navigation:\n\n - Select items by pressing the option number or using the arrow keys.\n\n - Use [Space] to (de)select options and [Enter] to confirm.\n\n - Switch between buttons using [Tab] or the arrow keys.\n\n - Long lists can be navigated using [Page Up] and [Page Down], or by pressing the highlighted letter of the desired option.\n"
_WelBody="\nThis will unpack and help you setup $DIST on your system.\n\n\nMenu Navigation:\n\n - Select items by pressing the option number or using the arrow keys.\n\n - Use [Space] to (de)select options and [Enter] to confirm.\n\n - Switch between buttons using [Tab] or the arrow keys.\n\n - Long lists can be navigated using [Page Up] and [Page Down], or by pressing the highlighted letter of the desired option.\n"
# Requirements
_NotRoot="\nThe installer must be run as root or using sudo.\n"
_Not64Bit="\nThe installer must be run on x86_64 capable hardware or virtual machine.\n"
_NoNetwork="\nThe installer should be run with an active network connection.\n"
_NotRoot="\nThis installer must be run as root or using sudo.\n"
_Not64Bit="\nThis installer only supports x86_64 capable hardware or virtual machines.\n"
_NoNetwork="\nThis installer needs to be run with an active internet connection in order to update and install packages.\n"
# Preparation Menu
_PrepTitle="Prepare System"
_PrepBody="\nFollow the below steps in order.\n\nBefore beginning the install, a root (/) partition must be mounted (UEFI also requires a boot partition) and the system settings must be configured."
_PrepBody="\nFollow the below steps in order.\n\nTo begin the install, a root (/) partition must first be mounted and the system settings must be configured (UEFI systems also require a boot partition to be mounted).\n\nIf you have already created a partition table and partition(s) you can begin mounting and skip over the editing step."
_PrepLayout="Keyboard Layout"
_PrepShowDev="Device Tree"
_PrepParts="Edit Partitions"
@ -58,7 +58,7 @@ _TimeSubZBody="\nSelect the nearest city to your location from the list below."
_TimeZQ="\nSet time zone as:"
# bootloader
_MntBootBody="\nSelect bootloader and boot partition mountpoint (if any).\n\nSystemd-boot automatically detects other bootloaders and is recommended for multiboot, grub also does this however you will need to run 'grub-mkconfig' to detect other bootloaders."
_MntBootBody="\nSelect which bootloader you want to use, if you have a boot partition the mountpoint on the right will be used.\n\nSystemd-boot automatically detects other bootloaders and is recommended for multiboot, grub also does this however you will need to run 'grub-mkconfig' manually after first boot in order to detect other bootloaders and add menu entries for them."
_InstSysTitle="Install Syslinux"
_InstSysBody="\nInstall syslinux to the master boot record (MBR) or to root (/)?"
@ -82,7 +82,7 @@ _AutoLoginBody="\nDo you want the new user to be automatically logged in when th
# Set keymap, hwclock, local and timezone
_CMapTitle="Virtual Console Keymap"
_CMapBody="\nSelect virtual console keymap.\n\nVirtual console is the shell prompt before reaching a graphical environment (Xorg).\n\nIts keymap is seperate from the one used by Xorg.\n\nDefault: us"
_XMapBody="\nSelect the system wide keymap, this is the keyboard layout used once a graphical environment (Xorg) is running.\n\nDefault: us"
_XMapBody="\nSelect the system wide keymap, this is the keyboard layout used once a graphical environment (Xorg) is running.\n\nIf a matching virtual console keymap exists it will be used, otherwise you will be asked to pick one.\n\nDefault: us"
_LocaleBody="\nLocale determines the date, time, currency, and language.\n\nThe format is language_COUNTRY\n\neg. en_US: english United States\n en_GB: english Great Britain"
# Set hostname
@ -101,8 +101,8 @@ _RootBody="--- Enter root password (empty uses the password entered above) ---"
_MntTitle="Mount Status"
_MntSucc="\nMount Succeeded!\n"
_MntFail="\nMount Failed!\n"
_WarnMount="\nIMPORTANT: Please choose carefully during mounting and formatting.\n\nDuring mounting, partitions can be mounted without formatting by selecting '$_Skip'.\nThis can be useful for data partitions or previously formatted partitions.\n"
_MntBody="\nUse [Space] to de/select the desired mount options.\n\nFor SSD's the 'discard' option provides active TRIM support.\n\nChoosing none will result in an automatic mount with system applied options."
_WarnMount="\nIMPORTANT: Please choose carefully during mounting and formatting.\n\nDuring mounting, partitions can be mounted without formatting by selecting '$_Skip'.\nThis can be useful for data partitions or previously formatted partitions.\n\nThe one exception to this is the root (/) partition, it must be formatted before unpacking to ensure the system stability.\n"
_MntBody="\nUse [Space] to de/select the desired mount options.\n\nIf the device is an SSD the 'discard' option provides active TRIM support and will be automatically selected.\n\nChoosing none will result in an automatic mount with system applied options."
_MntConfBody="\nConfirm the following mount options:"
# Select Device
@ -209,4 +209,4 @@ _UserErrBody="\nIncorrect user name.\n\nPlease try again.\n"
_UserPassErr="\nThe user passwords entered do not match.\n"
_RootPassErr="\nThe root passwords entered do not match.\n"
# vim:ft=sh:tw=0:syntax=off:nospell
# vim:tw=9999:syntax=off:nospell

View File

@ -196,4 +196,4 @@ _CloseInst="Fermer l'installateur"
_CloseInstBody="\nDémonter les partitions et fermer le programme d'installation?\n"
_InstFinBody="\nL'installation est maintenant terminée.\n\nVoulez-vous fermer le programme d'installation et redémarrer?"
# vim:ft=sh:tw=0:syntax=off:nospell
# vim:tw=9999:syntax=off:nospell

View File

@ -195,4 +195,4 @@ _CloseInst="Zárja be a telepítőt"
_CloseInstBody="\nLeválasztja a partíciókat és bezárja a telepítőt?"
_InstFinBody="\nA telepítés befejeződött.\n\nSzeretné bezárni a telepítőt és újraindítani?"
# vim:ft=sh:tw=0:syntax=off:nospell
# vim:tw=9999:syntax=off:nospell

View File

@ -194,4 +194,4 @@ _CloseInst="Chiudi il programma di installazione"
_CloseInstBody="\nSmontare le partizioni e chiudere l'installazione?"
_InstFinBody="\nL'installazione è terminata.\n\nVolete chiudere l'installazione e riavviare?"
# vim:ft=sh:tw=0:syntax=off:nospell
# vim:tw=9999:syntax=off:nospell

View File

@ -195,4 +195,4 @@ _CloseInstBody="Fechar o instalador"
_CloseInstBody="\nDesmontar partições e fechar o instalador?"
_InstFinBody="\nA instalação está terminada agora.\n\nGostaria de fechar o instalador e reiniciar?"
# vim:ft=sh:tw=0:syntax=off:nospell
# vim:tw=9999:syntax=off:nospell

View File

@ -197,4 +197,4 @@ _CloseInstBody="Fechar o instalador"
_CloseInstBody="\nDesmontar partições e fechar o instalador?"
_InstFinBody="\nA instalação está terminada agora.\n\nGostaria de fechar o instalador e reiniciar?"
# vim:ft=sh:tw=0:syntax=off:nospell
# vim:tw=9999:syntax=off:nospell

View File

@ -194,4 +194,4 @@ _CloseInst="Закрыть установщик"
_CloseInstBody="\nРазмонтировать разделы и закрыть программу установки?"
_InstFinBody="\nУстановка завершена.\n\nВы хотите закрыть программу установки и перезагрузить компьютер?"
# vim:ft=sh:tw=0:syntax=off:nospell
# vim:tw=9999:syntax=off:nospell

View File

@ -195,4 +195,4 @@ _CloseInst="Cerrar instalador"
_CloseInstBody="\nDesmontar particiones y cerrar el instalador?"
_InstFinBody="\nLa instalación ahora está terminada.\n\n¿Le gustaría cerrar el instalador y reiniciar?"
# vim:ft=sh:tw=0:syntax=off:nospell
# vim:tw=9999:syntax=off:nospell

View File

@ -9,12 +9,12 @@
# set -n
# shellcheck disable=2154
# shellcheck disable=2154,2034
# globals {
# immutable values
readonly VER="1.7.12" # Installer version
readonly VER="1.7.13" # Installer version
readonly DIST="ArchLabs" # Linux distributor
readonly LIVE="liveuser" # Live session user
readonly MNT="/mnt/install" # Install mountpoint
@ -24,7 +24,8 @@ readonly ERR="/tmp/errlog" # Built-in error log
declare -g WARN=false
declare -g AUTOLOGIN=false
declare -g CONFIG_DONE=false
declare -gx SEPERATE_BOOT=false
declare -g SEPERATE_BOOT=false
declare -g HAS_NETWORK=false
declare -g BT="$DIST Installer - (x86_64) - Version $VER"
declare -g ROOT_PART=""
@ -299,7 +300,7 @@ select_login_method() {
if ! LOGIN_TYPE="$(dialog --cr-wrap --stdout --backtitle "$BT" \
--title " $_WMLogin " --menu "$_LoginTypeBody" 0 0 0 \
"xinit" "Console login without a display manager" \
"lightdm" "Lightweight display manager with the gtk greeter")"; then
"lightdm" "Lightweight display manager with a gtk greeter")"; then
return 1
fi
if [[ $LOGIN_TYPE == 'lightdm' ]]; then
@ -503,20 +504,35 @@ configure_system_settings() {
tput civis
# shellcheck disable=SC2153
if ! LOCALE="$(dialog --cr-wrap --stdout --backtitle "$BT" --title " $_ConfLocale " --menu "$_LocaleBody" 25 70 20 $LOCALES)"; then
if ! LOCALE="$(dialog --cr-wrap --stdout --backtitle "$BT" \
--title " $_ConfLocale " --menu "$_LocaleBody" 25 70 20 $LOCALES)"; then
return 1
fi
select_timezone || return 1
select_mirrorlist_command || return 1
user_creation || return 1
select_wm_or_de || return 1
tput civis
if ! KERNEL="$(dialog --cr-wrap --stdout --backtitle "$BT" --title " $_KernelTitle " --menu "$_KernelBody" 0 0 0 'linux' '-' 'linux-lts' '-')"; then
if [[ $HAS_NETWORK == true ]]; then
if ! KERNEL="$(dialog --cr-wrap --stdout --backtitle "$BT" \
--title " $_KernelTitle " --menu "$_KernelBody" 0 0 0 'linux' '-' 'linux-lts' '-')"; then
return 1
fi
select_wm_or_de || return 1
select_extra_packages || return 1
select_mirrorlist_command || return 1
else
# defaults for when there is no network connection
KERNEL='linux'
AUTOLOGIN=true
LOGIN_TYPE='xinit'
INSTALL_WMS='openbox'
LOGIN_WM='openbox-session'
MIRROR_CMD="reflector --score 100 -l 50 -f 10 --sort rate --verbose"
EDIT_FILES[11]="/home/$NEWUSER/.xinitrc /home/$NEWUSER/.zprofile /home/$NEWUSER/.xprofile"
fi
export CONFIG_DONE=true
return 0
}

View File

@ -24,6 +24,7 @@ install() {
echeck "genfstab -U $MNT > $MNT/etc/fstab"
[[ -f $MNT/swapfile ]] && sed -i "s~${MNT}~~" $MNT/etc/fstab
if [[ $HAS_NETWORK == true ]]; then
# update the mirrorlist.. MUST be done before updating or it may be slow
oneshot mirrorlist_sort
@ -32,6 +33,9 @@ install() {
# set up user login.. MUST be done after package operation
oneshot login_manager
else
chrun 'pacman -Rns archlabs-installer --noconfirm'
fi
# mkinitcpio and bootloader install should only be done after installing the packages
# and updating the mirrorlist, otherwise the chosen kernel may not be fully set up
@ -178,12 +182,6 @@ icon-theme-name=Adwaita
font-name=DejaVu Sans Mono 11
position=30%,end 50%,end
EOF
# if [[ $AUTOLOGIN == true ]]; then
# chrun "groupadd -r nopasswdlogin && usermod -aG nopasswdlogin $LIVE"
# sed -i '/#%PAM-1.0/ a auth sufficient pam_succeed_if.so user ingroup nopasswdlogin' $MNT/etc/pam.d/lightdm
# sed -i "/#autologin-session=/ c autologin-session=${LOGIN_WM}" $MNT/etc/lightdm/lightdm.conf
# sed -i "/#autologin-user=/ c autologin-user=${NEWUSER}" $MNT/etc/lightdm/lightdm.conf
# fi
else # xinit login
sed -i "s/openbox-session/${LOGIN_WM}/g" $MNT/home/$LIVE/.xinitrc
if grep -q '#exec' $MNT/home/$LIVE/.zprofile; then

View File

@ -42,7 +42,9 @@ mount_install_partitions() {
unmount_install_partitions() {
swapoff -a
if [[ -d $MNT ]]; then
umount -R $MNT # >/dev/null 2>&1
fi
}
select_swap() {
@ -178,7 +180,7 @@ select_filesystem() {
"reiserfs" "${FS_CMDS[reiserfs]}" "xfs" "${FS_CMDS[xfs]}")"
[[ $fs == "$_Skip" ]] && return 0 || { [[ $fs == "" ]] && return 1; }
if yesno "$_FSTitle" "\nFormat $part as $fs?\n"; then
if yesno "$_FSTitle" "\nFormat $part as $fs?\n" "Format" "Go Back"; then
format $part $fs
else
select_filesystem $part || return 1

View File

@ -30,8 +30,14 @@ ssd() {
die() {
tput cnorm
fuser -km $MNT # >/dev/null 2>&1
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
}
@ -141,10 +147,13 @@ checks() {
if ! curl -s --head 'https://www.archlinux.org/mirrorlist/all/' | head -n 1 | grep -q '200'; then
if [[ $(systemctl is-active NetworkManager) == "active" ]] && hash nmtui >/dev/null 2>&1; then
tput civis; nmtui
tput civis; nmtui-connect
if curl -s --head 'https://www.archlinux.org/mirrorlist/all/' | head -n 1 | grep -q '200'; then
export HAS_NETWORK=true
else
infobox "$_ErrTitle" "$_NoNetwork" 3
fi
fi
curl -s --head 'https://www.archlinux.org/mirrorlist/all/' | head -n 1 | grep -q '200' ||
infobox "$_ErrTitle" "$_NoNetwork\n"
fi
return 0
}