You've already forked al-installer
More cleanup and fixes, rename a large amount of functions for brevity
This commit is contained in:
@ -1,18 +1,18 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# vim:ft=sh:fdm=marker:fmr={,}
|
||||
# vim:fdm=marker:fmr={,}
|
||||
|
||||
# This program is free software, provided under the GNU GPL
|
||||
# Written by Nathaniel Maia for use in Archlabs
|
||||
# Some ideas and code were taken from other installers
|
||||
# Some ideas and code has been taken from other installers
|
||||
# AIF, Cnichi, Calamares, The Arch Wiki.. Credit where credit is due
|
||||
|
||||
# set -n
|
||||
|
||||
# immutable variables {
|
||||
# immutable {
|
||||
|
||||
readonly DIST="ArchLabs" # Linux distributor
|
||||
readonly VER="1.6.88" # Installer version
|
||||
readonly VER="1.6.94" # Installer version
|
||||
readonly LIVE="liveuser" # Live session user
|
||||
readonly MNT="/mnt/install" # Install mountpoint
|
||||
readonly ERR="/tmp/errlog" # Built-in error log
|
||||
@ -26,14 +26,6 @@ readonly SYS_MEM=$(grep 'MemTotal' /proc/meminfo | awk '{print int($2 / 1024)"M"
|
||||
readonly LOCALES="$(awk '/\.UTF-8/ {gsub(/# .*|#/, ""); if($1) print $1 " -"}' /etc/locale.gen)"
|
||||
readonly CONSOLE_MAPS="$(find /usr/share/kbd/keymaps -name '*.map.gz' | awk '{gsub(/\.map\.gz|.*\//, ""); print $1 " -"}')"
|
||||
|
||||
readonly IGNORE_DEV="$(lsblk -lno NAME,MOUNTPOINT | awk '/\/run\/archiso\/bootmnt/ {sub(/[1-9]/, ""); print $1}')"
|
||||
if [[ $IGNORE_DEV ]]; then
|
||||
readonly SYS_DEVS="$(lsblk -lno NAME,SIZE,TYPE | awk '/disk/ && !'"/$IGNORE_DEV/"' {print "/dev/" $1 " " $2}')"
|
||||
else
|
||||
readonly SYS_DEVS="$(lsblk -lno NAME,SIZE,TYPE | awk '/disk/ {print "/dev/" $1 " " $2}')"
|
||||
fi
|
||||
readonly DEV_COUNT="$(wc -l <<< "$SYS_DEVS")"
|
||||
|
||||
if grep -q 'GenuineIntel' /proc/cpuinfo; then
|
||||
readonly UCODE="intel-ucode.img"
|
||||
elif grep -q 'AuthenticAMD' /proc/cpuinfo; then
|
||||
@ -54,25 +46,26 @@ if [[ $DISPLAY && $TERM != 'linux' ]]; then
|
||||
fi
|
||||
|
||||
# static string of keymap codes and respective language
|
||||
readonly KEYMAPS="us English cm English gb English au English gh English za English
|
||||
ng English ca French cd French gn French tg French fr French de German at German ch German
|
||||
es Spanish latam Spanish br Portuguese pt Portuguese ma Arabic sy Arabic ara Arabic
|
||||
ua Ukrainian cz Czech ru Russian sk Slovak nl Dutch it Italian hu Hungarian cn Chinese
|
||||
tw Taiwanese vn Vietnamese kr Korean jp Japanese th Thai la Lao pl Polish se Swedish
|
||||
is Icelandic fi Finnish dk Danish be Belgian in Indian al Albanian am Armenian bd Bangla
|
||||
ba Bosnian bg Bulgarian dz Berber mm Burmese hr Croatian gr Greek il Hebrew ir Persian iq Iraqi
|
||||
af Afghani fo Faroese ge Georgian ee Estonian kg Kyrgyz kz Kazakh lt Lithuanian mt Maltese
|
||||
mn Mongolian no Norwegian ro Romanian rs Serbian si Slovenian tj Tajik lk Sinhala tr Turkish
|
||||
uz Uzbek ie Irish pk Urdu mv Dhivehi epo Esperanto np Nepali et Amharic sn Wolof ml Bambara
|
||||
tz Swahili ke Swahili bw Tswana ph Filipino id Indonesian my Malay tm Turkmen bt Dzongkha
|
||||
lv Latvian md Moldavian mao Maori by Belarusian me Montenegrin mk Macedonian kh Khmer az Azerbaijani"
|
||||
readonly KEYMAPS="us English cm English gb English au English gh English za English ng English
|
||||
ca French cd French gn French tg French fr French de German at German ch German es Spanish
|
||||
latam Spanish br Portuguese pt Portuguese ma Arabic sy Arabic ara Arabic ua Ukrainian cz Czech
|
||||
ru Russian sk Slovak nl Dutch it Italian hu Hungarian cn Chinese tw Taiwanese vn Vietnamese
|
||||
kr Korean jp Japanese th Thai la Lao pl Polish se Swedish is Icelandic fi Finnish dk Danish
|
||||
be Belgian in Indian al Albanian am Armenian bd Bangla ba Bosnian bg Bulgarian dz Berber
|
||||
mm Burmese hr Croatian gr Greek il Hebrew ir Persian iq Iraqi af Afghani fo Faroese ge Georgian
|
||||
ee Estonian kg Kyrgyz kz Kazakh lt Lithuanian mt Maltese mn Mongolian no Norwegian ro Romanian
|
||||
rs Serbian si Slovenian tj Tajik lk Sinhala tr Turkish uz Uzbek ie Irish pk Urdu mv Dhivehi
|
||||
epo Esperanto np Nepali et Amharic sn Wolof ml Bambara tz Swahili ke Swahili bw Tswana
|
||||
ph Filipino id Indonesian my Malay tm Turkmen bt Dzongkha lv Latvian md Moldavian mao Maori
|
||||
by Belarusian me Montenegrin mk Macedonian kh Khmer az Azerbaijani"
|
||||
|
||||
declare -Agr BMNTS=(
|
||||
[UEFI-grub]="/boot/efi" [UEFI-systemd-boot]="/boot" [BIOS-grub]="/boot"
|
||||
[BIOS-syslinux]="/boot" [UEFI-syslinux]="/boot"
|
||||
)
|
||||
|
||||
declare -Agr BOOTLDRS=([BIOS]="grub ${BMNTS[BIOS-grub]} syslinux ${BMNTS[BIOS-syslinux]}"
|
||||
declare -Agr BOOTLDRS=(
|
||||
[BIOS]="grub ${BMNTS[BIOS-grub]} syslinux ${BMNTS[BIOS-syslinux]}"
|
||||
[UEFI]="grub ${BMNTS[UEFI-grub]} systemd-boot ${BMNTS[UEFI-systemd-boot]} syslinux ${BMNTS[UEFI-syslinux]}"
|
||||
)
|
||||
|
||||
@ -93,7 +86,7 @@ declare -Agr FS_OPTS=([vfat]="" [ntfs]="" [ext2]="" [ext3]=""
|
||||
|
||||
# }
|
||||
|
||||
init_variables() {
|
||||
init() {
|
||||
declare -g BT="$DIST Installer - (x86_64) - Version $VER"
|
||||
declare -g ROOT_PART=""
|
||||
declare -g BOOT_DEVICE=""
|
||||
@ -136,14 +129,22 @@ init_variables() {
|
||||
[8]="/etc/crypttab"
|
||||
[9]="/etc/default/grub"
|
||||
[10]="/etc/pacman.conf"
|
||||
[11]=""
|
||||
)
|
||||
}
|
||||
|
||||
source_file() {
|
||||
. "$1" || { printf "\nFailed to source library file %s" "$1"; die 1; }
|
||||
devices() {
|
||||
IGNORE_DEV="$(lsblk -lno NAME,MOUNTPOINT | awk '/\/run\/archiso\/bootmnt/ {sub(/[1-9]/, ""); print $1}')"
|
||||
if [[ $IGNORE_DEV ]]; then
|
||||
SYS_DEVS="$(lsblk -lno NAME,SIZE,TYPE | awk '/disk/ && !'"/$IGNORE_DEV/"' {print "/dev/" $1 " " $2}')"
|
||||
else
|
||||
SYS_DEVS="$(lsblk -lno NAME,SIZE,TYPE | awk '/disk/ {print "/dev/" $1 " " $2}')"
|
||||
fi
|
||||
DEV_COUNT="$(wc -l <<< "$SYS_DEVS")"
|
||||
declare -gr SYS_DEVS IGNORE_DEV DEV_COUNT
|
||||
}
|
||||
|
||||
user_creation() {
|
||||
user() {
|
||||
tput cnorm
|
||||
local values
|
||||
values="$(dialog --stdout --no-cancel --separator '~' --ok-label "Submit" --backtitle "$BT" \
|
||||
@ -176,16 +177,16 @@ user_creation() {
|
||||
rpass2="$(openssl enc -pbkdf2 -a -d -salt -pass pass:$SALT <<< "$values" |
|
||||
awk -F'~' '{print $6}' | openssl enc -pbkdf2 -a -salt -pass pass:$SALT)"
|
||||
|
||||
# due to the encryption the string while encrypted will not be empty
|
||||
# due to encrypting the string, when empty, once encrypted it wont be empty
|
||||
local empty
|
||||
empty="$(openssl enc -pbkdf2 -a -salt -pass pass:$SALT <<< "")"
|
||||
|
||||
# both root passwords are empty, so use the user passwords instead
|
||||
[[ $rpass == "" && $rpass2 == "" ]] && { rpass="$pass"; rpass2="$pass2"; }
|
||||
[[ $rpass == "$empty" && $rpass2 == "$empty" ]] && { rpass="$pass"; rpass2="$pass2"; }
|
||||
|
||||
# make sure a username was entered and that the passwords match
|
||||
if [[ ${#user} -eq 0 || $user =~ \ |\' || $user =~ [^a-z0-9\ ] || $pass == "$empty" || "$pass" != "$pass2" || "$rpass" != "$rpass2" ]]; then
|
||||
if [[ $pass == "" || "$pass" != "$pass2" || "$rpass" != "$rpass2" ]]; then
|
||||
if [[ ${#user} -eq 0 || $user =~ \ |\' || $user =~ [^a-z0-9] || $pass == "$empty" || "$pass" != "$pass2" || "$rpass" != "$rpass2" ]]; then
|
||||
if [[ $pass == "$empty" || "$pass" != "$pass2" || "$rpass" != "$rpass2" ]]; then
|
||||
# password was left empty or doesn't match
|
||||
if [[ $pass == "$empty" ]]; then
|
||||
msgbox "$_ErrTitle" "\nUser password CANNOT be left empty.\n$_TryAgain"
|
||||
@ -199,7 +200,7 @@ user_creation() {
|
||||
user=""
|
||||
fi
|
||||
# recursively loop back unless the user cancels
|
||||
user_creation || return 1
|
||||
user || return 1
|
||||
else
|
||||
NEWUSER="$user"
|
||||
USER_PASS="$pass"
|
||||
@ -208,7 +209,7 @@ user_creation() {
|
||||
return 0
|
||||
}
|
||||
|
||||
select_language() {
|
||||
language() {
|
||||
tput civis
|
||||
local lang
|
||||
lang=$(dialog --cr-wrap --stdout --backtitle "$BT" --title " Select Language " --menu \
|
||||
@ -219,20 +220,20 @@ select_language() {
|
||||
"7" "Italiano (it_IT)" "8" "Nederlands (nl_NL)" \
|
||||
"9" "Magyar (hu_HU)" "10" "Chinese (zh_CN)")
|
||||
|
||||
source_file $TRN/english.trans
|
||||
src $TRN/english.trans
|
||||
FONT="ter-i16n"
|
||||
|
||||
case $lang in
|
||||
1) LOC="en_US.UTF-8" ;;
|
||||
2) source_file $TRN/spanish.trans && LOC="es_ES.UTF-8" ;;
|
||||
3) source_file $TRN/p_brasil.trans && LOC="pt_BR.UTF-8" ;;
|
||||
4) source_file $TRN/portuguese.trans && LOC="pt_PT.UTF-8" ;;
|
||||
5) source_file $TRN/french.trans && LOC="fr_FR.UTF-8" ;;
|
||||
6) source_file $TRN/russian.trans && LOC="ru_RU.UTF-8" FONT="LatKaCyrHeb-16" ;;
|
||||
7) source_file $TRN/italian.trans && LOC="it_IT.UTF-8" ;;
|
||||
8) source_file $TRN/dutch.trans && LOC="nl_NL.UTF-8" ;;
|
||||
9) source_file $TRN/hungarian.trans && LOC="hu_HU.UTF-8" FONT="lat2-16" ;;
|
||||
10) source_file $TRN/chinese.trans && LOC="zh_CN.UTF-8" ;;
|
||||
2) src $TRN/spanish.trans && LOC="es_ES.UTF-8" ;;
|
||||
3) src $TRN/p_brasil.trans && LOC="pt_BR.UTF-8" ;;
|
||||
4) src $TRN/portuguese.trans && LOC="pt_PT.UTF-8" ;;
|
||||
5) src $TRN/french.trans && LOC="fr_FR.UTF-8" ;;
|
||||
6) src $TRN/russian.trans && LOC="ru_RU.UTF-8" FONT="LatKaCyrHeb-16" ;;
|
||||
7) src $TRN/italian.trans && LOC="it_IT.UTF-8" ;;
|
||||
8) src $TRN/dutch.trans && LOC="nl_NL.UTF-8" ;;
|
||||
9) src $TRN/hungarian.trans && LOC="hu_HU.UTF-8" FONT="lat2-16" ;;
|
||||
10) src $TRN/chinese.trans && LOC="zh_CN.UTF-8" ;;
|
||||
*) die 0
|
||||
esac
|
||||
|
||||
@ -247,7 +248,7 @@ select_language() {
|
||||
return 0
|
||||
}
|
||||
|
||||
setup_keymap() {
|
||||
keymap() {
|
||||
tput civis
|
||||
KEYMAP="$(dialog --cr-wrap --stdout --backtitle "$BT" \
|
||||
--title " $_PrepLayout " --menu "$_XMapBody" 20 70 12 $KEYMAPS)"
|
||||
@ -270,7 +271,7 @@ setup_keymap() {
|
||||
return 0
|
||||
}
|
||||
|
||||
setup_timezone() {
|
||||
timezone() {
|
||||
tput civis
|
||||
ZONE="$(dialog --cr-wrap --stdout --backtitle "$BT" \
|
||||
--title " $_TimeZTitle " --menu "$_TimeZBody" 20 70 10 America - Australia - \
|
||||
@ -281,10 +282,10 @@ setup_timezone() {
|
||||
--title " $_TimeZTitle " --menu "$_TimeSubZBody" 20 70 12 ${SUBZONES[$ZONE]})"
|
||||
[[ $? != 0 || $SUBZONE == "" ]] && return 1
|
||||
|
||||
yesno "$_TimeZTitle" "$_TimeZQ $ZONE/$SUBZONE?\n" && return 0 || setup_timezone
|
||||
yesno "$_TimeZTitle" "$_TimeZQ $ZONE/$SUBZONE?\n" && return 0 || timezone
|
||||
}
|
||||
|
||||
window_manager() {
|
||||
sessions() {
|
||||
INSTALL_WMS="$(dialog --cr-wrap --stdout --backtitle "$BT" \
|
||||
--title " $_WMChoice " --checklist "$_WMChoiceBody\n" 0 0 0 \
|
||||
"openbox" "A lightweight, powerful, and highly configurable stacking window manager" off \
|
||||
@ -296,23 +297,24 @@ window_manager() {
|
||||
"xfce4" "A lightweight and modular desktop environment based on GTK+ 2 and 3" off)"
|
||||
[[ $? != 0 || $INSTALL_WMS == "" ]] && return 1
|
||||
WM_NUM=$(awk '{print NF}' <<< "$INSTALL_WMS")
|
||||
WM_PACKAGES="$INSTALL_WMS"
|
||||
|
||||
# packages needed for the selected window manager
|
||||
# packages needed for the selected WM/DE
|
||||
for wm in $INSTALL_WMS; do
|
||||
LOGIN_CHOICES="${LOGIN_CHOICES}$wm - "
|
||||
case $wm in
|
||||
cinnamon) WM_PACKAGES+=" $wm" ;;
|
||||
bspwm) WM_PACKAGES+=" $wm sxhkd" ;;
|
||||
gnome) WM_PACKAGES+=" $wm gnome-extra" ;;
|
||||
i3-gaps) WM_PACKAGES+=" $wm i3status perl-anyevent-i3" ;;
|
||||
xfce4) WM_PACKAGES+=" $wm xfce4-goodies xfce4-pulseaudio-plugin" ;;
|
||||
openbox) WM_PACKAGES+=" $wm obconf archlabs-obkey archlabs-kickshaw archlabs-skippy-xd tint2 conky jgmenu" ;;
|
||||
cinnamon) : ;; # none
|
||||
bspwm) WM_PACKAGES+=" sxhkd" ;;
|
||||
gnome) WM_PACKAGES+=" gnome-extra" ;;
|
||||
i3-gaps) WM_PACKAGES+=" i3status perl-anyevent-i3" ;;
|
||||
xfce4) WM_PACKAGES+=" xfce4-goodies xfce4-pulseaudio-plugin" ;;
|
||||
openbox) WM_PACKAGES+=" obconf archlabs-obkey archlabs-kickshaw archlabs-skippy-xd tint2 conky jgmenu" ;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ $INSTALL_WMS =~ (openbox|bspwm|i3-gaps) ]]; then
|
||||
WM_PACKAGES+=" archlabs-polybar jsoncpp libmpdclient archlabs-screenlock archlabs-oblogout"
|
||||
WM_PACKAGES+=" archlabs-paranoid lxappearance rofi termite thunar"
|
||||
WM_PACKAGES+=" archlabs-polybar archlabs-paranoid archlabs-screenlock archlabs-oblogout"
|
||||
WM_PACKAGES+=" rofi termite thunar lxappearance libmpdclient jsoncpp"
|
||||
elif [[ $INSTALL_WMS =~ (xfce4) ]]; then
|
||||
WM_PACKAGES+=" archlabs-oblogout archlabs-screenlock archlabs-paranoid"
|
||||
fi
|
||||
@ -333,7 +335,7 @@ window_manager() {
|
||||
else
|
||||
LOGIN_TYPE='lightdm'
|
||||
WM_PACKAGES+=" lightdm lightdm-gtk-greeter lightdm-gtk-greeter-settings accountsservice"
|
||||
FILES[11]="/etc/lightdm/lightdm.conf $MNT/etc/lightdm/lightdm-gtk-greeter.conf"
|
||||
FILES[11]="/etc/lightdm/lightdm.conf /etc/lightdm/lightdm-gtk-greeter.conf"
|
||||
fi
|
||||
|
||||
EXTRA_PACKAGES="$WM_PACKAGES"
|
||||
@ -351,7 +353,7 @@ window_manager() {
|
||||
return 0
|
||||
}
|
||||
|
||||
extra_packages() {
|
||||
packages() {
|
||||
local pkgs
|
||||
pkgs="$(dialog --cr-wrap --stdout --backtitle "$BT" \
|
||||
--title " $_ExtraPackages " --checklist "$_ExtraPackagesBody\n" 0 0 30 \
|
||||
@ -436,30 +438,26 @@ extra_packages() {
|
||||
[[ $pkgs =~ noto-fonts ]] && pkgs+=" noto-fonts-emoji"
|
||||
[[ $pkgs =~ cairo-dock ]] && pkgs+=" cairo-dock-plug-ins"
|
||||
[[ $pkgs =~ kdenlive ]] && pkgs+=" kdebase-runtime dvdauthor frei0r-plugins breeze breeze-gtk"
|
||||
if [[ $INSTALL_WMS =~ dwm ]] && ! [[ $pkgs =~ ttf-hack ]]; then
|
||||
pkgs+=" ttf-hack"
|
||||
fi
|
||||
if [[ $pkgs =~ (qutebrowser|qbittorrent|kdenlive|vlc) ]] && ! [[ $pkgs =~ qt5ct ]]; then
|
||||
pkgs+=" qt5ct qt5-styleplugins"
|
||||
fi
|
||||
([[ $INSTALL_WMS =~ dwm ]] && ! [[ $pkgs =~ ttf-hack ]]) && pkgs+=" ttf-hack"
|
||||
([[ $pkgs =~ (qutebrowser|qbittorrent|kdenlive|vlc) ]] && ! [[ $pkgs =~ qt5ct ]]) && pkgs+=" qt5ct qt5-styleplugins"
|
||||
|
||||
EXTRA_PACKAGES="$EXTRA_PACKAGES$([[ $pkgs ]] && printf " %s" "$pkgs")"
|
||||
EXTRA_PACKAGES+="$pkgs"
|
||||
return 0
|
||||
}
|
||||
|
||||
mirrorlist_cmd() {
|
||||
mirrors() {
|
||||
local key="5f29642060ab983b31fdf4c2935d8c56"
|
||||
local ip="$(curl -s "http://api.ipstack.com/check&fields=ip&?access_key=${key}" |
|
||||
val_from_json 'ip')"
|
||||
json 'ip')"
|
||||
|
||||
if hash reflector >/dev/null 2>&1; then
|
||||
MIRROR_CMD="reflector --score 100 -l 50 -f 10 --sort rate"
|
||||
MIRROR_CMD="reflector --score 100 -l 50 -f 10 --sort rate --verbose"
|
||||
yesno "$_MirrorTitle" "$_MirrorSetup" "Automatic" "Custom" && return 0
|
||||
|
||||
local c="$(curl -s "http://api.ipstack.com/${ip}?access_key=${key}&fields=country_name" |
|
||||
val_from_json 'country_name')"
|
||||
json 'country_name')"
|
||||
if [[ $c != "" ]]; then
|
||||
MIRROR_CMD="reflector --country $c --score 80 --latest 40 --fastest 10 --sort rate"
|
||||
MIRROR_CMD="reflector --country $c --score 80 --latest 40 --fastest 10 --sort rate --verbose"
|
||||
fi
|
||||
|
||||
tput cnorm
|
||||
@ -477,7 +475,7 @@ mirrorlist_cmd() {
|
||||
'delay': MirrorStatus delay.\n" 0 0 "$MIRROR_CMD")"
|
||||
else
|
||||
local c="$(curl -s "http://api.ipstack.com/${ip}?access_key=${key}&fields=country_code" |
|
||||
val_from_json 'country_code')"
|
||||
json 'country_code')"
|
||||
|
||||
local w="https://www.archlinux.org/mirrorlist"
|
||||
if [[ $c != "" ]]; then
|
||||
@ -493,37 +491,37 @@ mirrorlist_cmd() {
|
||||
return 0
|
||||
}
|
||||
|
||||
display_selection() {
|
||||
display() {
|
||||
msgbox "$_PrepTitle" "\nConfiguration values used for install\n\n
|
||||
Root: $ROOT_PART
|
||||
Boot: $BOOT_PART
|
||||
Swap: $SWAP
|
||||
Extra: ${EXTRA_MNTS:-None}
|
||||
Root: $ROOT_PART
|
||||
Boot: $BOOT_PART
|
||||
Swap: $SWAP
|
||||
Extra: ${EXTRA_MNTS:-None}
|
||||
|
||||
LVM: $LVM
|
||||
LUKS: $LUKS
|
||||
LVM: $LVM
|
||||
LUKS: $LUKS
|
||||
|
||||
Bootloader: $BOOTLDR
|
||||
Boot Mount: ${BMNTS[$SYS-$BOOTLDR]}
|
||||
Boot Command: ${BCMDS[$BOOTLDR]}
|
||||
|
||||
New User: $NEWUSER
|
||||
Login: $LOGIN_WM
|
||||
Autologin: $AUTOLOGIN
|
||||
Login Type: $LOGIN_TYPE
|
||||
User: $NEWUSER
|
||||
Hostname: $HOSTNAME
|
||||
Locale: $LOCALE
|
||||
Keymap: $KEYMAP
|
||||
Timezone: $ZONE/$SUBZONE
|
||||
|
||||
Hostname: $HOSTNAME
|
||||
Locale: $LOCALE
|
||||
Keymap: $KEYMAP
|
||||
Timezone: $ZONE/$SUBZONE
|
||||
Autologin: $AUTOLOGIN
|
||||
Login: $LOGIN_WM
|
||||
Login Type: $LOGIN_TYPE
|
||||
|
||||
Kernel: $KERNEL
|
||||
Sessions: $INSTALL_WMS
|
||||
Mirrors: $MIRROR_CMD
|
||||
Packages: $EXTRA_PACKAGES\n"
|
||||
Sessions: $INSTALL_WMS
|
||||
Kernel: $KERNEL
|
||||
Mirrors: $MIRROR_CMD
|
||||
Packages: $EXTRA_PACKAGES\n"
|
||||
}
|
||||
|
||||
configure_install() {
|
||||
configure() {
|
||||
tput cnorm
|
||||
HOSTNAME="$(getinput "$_ConfHost" "$_HostNameBody" "${DIST,,}")"
|
||||
[[ $? != 0 || $HOSTNAME == "" ]] && return 1
|
||||
@ -533,22 +531,22 @@ configure_install() {
|
||||
--title " $_ConfLocale " --menu "$_LocaleBody" 25 70 20 $LOCALES)"
|
||||
[[ $? != 0 || $LOCALE == "" ]] && return 1
|
||||
|
||||
setup_timezone || return 1
|
||||
mirrorlist_cmd || return 1
|
||||
user_creation || return 1
|
||||
window_manager || return 1
|
||||
timezone || return 1
|
||||
mirrors || return 1
|
||||
user || return 1
|
||||
sessions || return 1
|
||||
yesno 'Choose Kernel' "\nUse the current kernel or the LTS kernel?\n" 'Current' 'LTS' &&
|
||||
KERNEL='linux' || KERNEL='linux-lts'
|
||||
extra_packages || return 1
|
||||
packages || return 1
|
||||
CONFIG_DONE=true
|
||||
return 0
|
||||
}
|
||||
|
||||
edit_configs() {
|
||||
configs() {
|
||||
if [[ $CURRENT_MENU != "edit" ]]; then
|
||||
SELECTED=1
|
||||
CURRENT_MENU="edit"
|
||||
elif (( SELECTED < 10 )); then
|
||||
elif (( SELECTED < 11 )); then
|
||||
(( SELECTED++ ))
|
||||
fi
|
||||
|
||||
@ -557,7 +555,7 @@ edit_configs() {
|
||||
--title " $_EditTitle " --default-item $SELECTED --menu "$_EditBody" 0 0 0 \
|
||||
"1" "Exit & Reboot" "2" "Keyboard" "3" "Locale" "4" "Hostname" "5" "Sudoers" \
|
||||
"6" "Mkinitcpio.conf" "7" "Fstab" "8" "Crypttab" "9" "${BOOTLDR^}" "10" "Pacman.conf" \
|
||||
"11" "$LOGIN_TYPE")
|
||||
"11" "${LOGIN_TYPE^}")
|
||||
|
||||
if [[ ! $SELECTED || $SELECTED -eq 1 ]]; then
|
||||
wrap_up "$_InstFinBody" 'Reboot' 'Back' 'reboot'
|
||||
@ -568,14 +566,14 @@ edit_configs() {
|
||||
done
|
||||
[[ ! $existing_files ]] && msgbox "$_ErrTitle" "$_NoFileErr" || vim -O $existing_files
|
||||
fi
|
||||
edit_configs
|
||||
configs
|
||||
}
|
||||
|
||||
main() {
|
||||
if [[ $CURRENT_MENU != "main" ]]; then
|
||||
SELECTED=1
|
||||
CURRENT_MENU="main"
|
||||
elif (( SELECTED < 8 )); then
|
||||
elif (( SELECTED < 9 )); then
|
||||
((SELECTED++)) # increment the highlighted menu item
|
||||
fi
|
||||
|
||||
@ -590,7 +588,7 @@ main() {
|
||||
# and that the needed config variables and user variables have been set up
|
||||
if [[ $SELECTED ]]; then
|
||||
if [[ $SELECTED -eq 8 ]]; then
|
||||
check_install_ready || return 1
|
||||
icheck || return 1
|
||||
elif [[ ($SELECTED -eq 2 || $SELECTED -eq 5) && $WARN != true ]]; then
|
||||
msgbox "$_PrepTitle" "$_WarnMount"
|
||||
WARN=true
|
||||
@ -598,23 +596,27 @@ main() {
|
||||
fi
|
||||
|
||||
case $SELECTED in
|
||||
1) show_devices ;;
|
||||
2) edit_partitions ;;
|
||||
3) luks_menu || SELECTED=1 ;;
|
||||
4) lvm_menu || SELECTED=1 ;;
|
||||
5) mount_main || SELECTED=1 ;;
|
||||
6) configure_install ;;
|
||||
7) display_selection ;;
|
||||
8) install_main && edit_configs ;;
|
||||
1) device_tree ;;
|
||||
2) partition || SELECTED=1 ;;
|
||||
3) luks_menu || SELECTED=2 ;;
|
||||
4) lvm_menu || SELECTED=3 ;;
|
||||
5) mountp || SELECTED=4 ;;
|
||||
6) configure || SELECTED=5 ;;
|
||||
7) display ;;
|
||||
8) install || SELECTED=7 ;;
|
||||
*) wrap_up "$_CloseInstBody" 'Exit' 'Back' 'exit'
|
||||
esac
|
||||
}
|
||||
|
||||
# must be done first
|
||||
init_variables
|
||||
init
|
||||
|
||||
for file in /usr/share/archlabs/installer/lib/?*.sh; do
|
||||
source_file "$file"
|
||||
# declares system device list
|
||||
devices
|
||||
|
||||
# source all the lib files
|
||||
for i in /usr/share/archlabs/installer/lib/?*.sh; do
|
||||
. "$i" || { printf "\nFailed to source library file %s\n" "$i"; die 1; }
|
||||
done
|
||||
|
||||
# trap Ctrl-C to properly exit
|
||||
@ -624,10 +626,13 @@ for arg in $@; do case $arg in
|
||||
--debug|-d) debug ;;
|
||||
esac done
|
||||
|
||||
select_language
|
||||
setup_keymap
|
||||
check_requirements
|
||||
identify_system
|
||||
# initial choices/prep
|
||||
language
|
||||
keymap
|
||||
checks
|
||||
sysid
|
||||
|
||||
# welcome message
|
||||
msgbox "$_WelTitle $DIST Installer" "$_WelBody"
|
||||
|
||||
while true; do
|
||||
|
Reference in New Issue
Block a user