You've already forked al-installer
Reboot fix, possibly??
This commit is contained in:
@ -9,132 +9,85 @@
|
||||
|
||||
# set -n
|
||||
|
||||
# immutable {
|
||||
# globals {
|
||||
|
||||
readonly DIST="ArchLabs" # Linux distributor
|
||||
readonly VER="1.7.5" # Installer version
|
||||
readonly LIVE="liveuser" # Live session user
|
||||
readonly MNT="/mnt/install" # Install mountpoint
|
||||
readonly ERR="/tmp/errlog" # Built-in error log
|
||||
readonly EFI="/sys/firmware/efi/efivars"
|
||||
readonly TRN="/usr/share/archlabs/installer/lang"
|
||||
readonly RUN="/run/archiso/bootmnt/arch/boot"
|
||||
# immutable values
|
||||
readonly VER="1.7.9" # Installer version
|
||||
readonly DIST="ArchLabs" # Linux distributor
|
||||
readonly LIVE="liveuser" # Live session user
|
||||
readonly MNT="/mnt/install" # Install mountpoint
|
||||
readonly ERR="/tmp/errlog" # Built-in error log
|
||||
|
||||
readonly VM="$(dmesg | grep -i "hypervisor")"
|
||||
readonly SALT="$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)"
|
||||
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 CMAPS="$(find /usr/share/kbd/keymaps -name '*.map.gz' | awk '{gsub(/\.map\.gz|.*\//, ""); print $1 " -"}')"
|
||||
# mutable values
|
||||
declare -g WARN=false
|
||||
declare -g AUTOLOGIN=false
|
||||
declare -g CONFIG_DONE=false
|
||||
declare -g SEPERATE_BOOT=false
|
||||
|
||||
if grep -q 'GenuineIntel' /proc/cpuinfo; then
|
||||
readonly UCODE="intel-ucode.img"
|
||||
elif grep -q 'AuthenticAMD' /proc/cpuinfo; then
|
||||
readonly UCODE="amd-ucode.img"
|
||||
fi
|
||||
|
||||
# create associative array for SUBZONES[zone]
|
||||
declare -gA SUBZONES
|
||||
for zone in America Australia Asia Atlantic Africa Europe Indian Pacific Arctic Antarctica; do
|
||||
SUBZONES[$zone]="$(awk "/$zone\// {gsub(/$zone\//, \"\"); print \$3 \" \"\$1}" /usr/share/zoneinfo/zone.tab)"
|
||||
done
|
||||
readonly SUBZONES # make it read only
|
||||
|
||||
if [[ $DISPLAY && $TERM != 'linux' ]]; then
|
||||
for t in termite st xterm; do
|
||||
hash $t >/dev/null 2>&1 && { readonly TERM_CMD="$t"; break; }
|
||||
done
|
||||
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 KERNELS="linux - linux-lts -"
|
||||
|
||||
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]}"
|
||||
[UEFI]="grub ${BMNTS[UEFI-grub]} systemd-boot ${BMNTS[UEFI-systemd-boot]} syslinux ${BMNTS[UEFI-syslinux]}"
|
||||
)
|
||||
|
||||
declare -Agr FS_CMDS=(
|
||||
[ext2]="mkfs.ext2 -q" [ext3]="mkfs.ext3 -q" [ext4]="mkfs.ext4 -q"
|
||||
[f2fs]="mkfs.f2fs" [jfs]="mkfs.jfs -q" [xfs]="mkfs.xfs -f" [nilfs2]="mkfs.nilfs2 -q"
|
||||
[ntfs]="mkfs.ntfs -q" [reiserfs]="mkfs.reiserfs -q" [vfat]="mkfs.vfat -F32"
|
||||
)
|
||||
|
||||
declare -Agr FS_OPTS=([vfat]="" [ntfs]="" [ext2]="" [ext3]=""
|
||||
[ext4]="discard - off dealloc - off nofail - off noacl - off relatime - off noatime - off nobarrier - off nodelalloc - off"
|
||||
[jfs]="discard - off errors=continue - off errors=panic - off nointegrity - off"
|
||||
[reiserfs]="acl - off nolog - off notail - off replayonly - off user_xattr - off"
|
||||
[xfs]="discard - off filestreams - off ikeep - off largeio - off noalign - off nobarrier - off norecovery - off noquota - off wsync - off"
|
||||
[nilfs2]="discard - off nobarrier - off errors=continue - off errors=panic - off order=relaxed - off order=strict - off norecovery - off"
|
||||
[f2fs]="data_flush - off disable_roll_forward - off disable_ext_identify - off discard - off fastboot - off flush_merge - off inline_xattr - off inline_data - off inline_dentry - off no_heap - off noacl - off nobarrier - off noextent_cache - off noinline_data - off norecovery - off"
|
||||
)
|
||||
declare -g BT="$DIST Installer - (x86_64) - Version $VER"
|
||||
declare -g ROOT_PART=""
|
||||
declare -g BOOT_DEVICE=""
|
||||
declare -g BOOT_PART=""
|
||||
declare -g BOOTLDR=""
|
||||
declare -g EXTRA_MNT=""
|
||||
declare -g EXTRA_MNTS=""
|
||||
declare -g SWAP_PART=""
|
||||
declare -g SWAP_SIZE=""
|
||||
declare -g NEWUSER=""
|
||||
declare -g USER_PASS=""
|
||||
declare -g ROOT_PASS=""
|
||||
declare -g LOGIN_WM=""
|
||||
declare -g LOGIN_TYPE=""
|
||||
declare -g INSTALL_WMS=""
|
||||
declare -g KERNEL=""
|
||||
declare -g WM_PACKAGES=""
|
||||
declare -g PACKAGES=""
|
||||
declare -g MKINIT_HOOKS="shutdown"
|
||||
|
||||
# }
|
||||
|
||||
init() {
|
||||
declare -g BT="$DIST Installer - (x86_64) - Version $VER"
|
||||
declare -g ROOT_PART=""
|
||||
declare -g BOOT_DEVICE=""
|
||||
declare -g BOOT_PART=""
|
||||
declare -g BOOTLDR=""
|
||||
declare -g EXTRA_MNT=""
|
||||
declare -g EXTRA_MNTS=""
|
||||
declare -g SWAP=""
|
||||
declare -g SWAP_SIZE="$SYS_MEM"
|
||||
declare -g NEWUSER=""
|
||||
declare -g USER_PASS=""
|
||||
declare -g ROOT_PASS=""
|
||||
declare -g LOGIN_WM=""
|
||||
declare -g LOGIN_TYPE=""
|
||||
declare -g INSTALL_WMS=""
|
||||
declare -g KERNEL="linux"
|
||||
declare -g WM_PACKAGES=""
|
||||
declare -g EXTRA_PACKAGES=""
|
||||
declare -g MKINIT_HOOKS="shutdown"
|
||||
select_language() {
|
||||
tput civis
|
||||
local lang
|
||||
lang=$(dialog --cr-wrap --stdout --backtitle "$BT" --title " Select Language " --menu \
|
||||
"\nLanguage - sprache - taal - språk - lingua - idioma - nyelv - língua\n" 0 0 0 \
|
||||
"1" "English (en_**)" "2" "Español (es_ES)" \
|
||||
"3" "Português [Brasil] (pt_BR)" "4" "Português (pt_PT)" \
|
||||
"5" "Français (fr_FR)" "6" "Russkiy (ru_RU)" \
|
||||
"7" "Italiano (it_IT)" "8" "Nederlands (nl_NL)" \
|
||||
"9" "Magyar (hu_HU)" "10" "Chinese (zh_CN)")
|
||||
|
||||
declare -g WARN=false
|
||||
declare -g AUTOLOGIN=false
|
||||
declare -g CONFIG_DONE=false
|
||||
declare -g SEPERATE_BOOT=false
|
||||
local srcdir="/usr/share/archlabs/installer/lang"
|
||||
|
||||
declare -gA BCMDS=(
|
||||
[syslinux]="syslinux-install_update -iam"
|
||||
[grub]="grub-install --recheck --force"
|
||||
[systemd-boot]="bootctl --path=/boot install"
|
||||
)
|
||||
src $srcdir/english.trans
|
||||
FONT="ter-i16n"
|
||||
|
||||
declare -gA FILES=(
|
||||
[2]="/etc/X11/xorg.conf.d/00-keyboard.conf /etc/default/keyboard /etc/vconsole.conf"
|
||||
[3]="/etc/locale.conf /etc/default/locale"
|
||||
[4]="/etc/hostname /etc/hosts"
|
||||
[5]="/etc/sudoers"
|
||||
[6]="/etc/mkinitcpio.conf"
|
||||
[7]="/etc/fstab"
|
||||
[8]="/etc/crypttab"
|
||||
[9]="/etc/default/grub"
|
||||
[10]="/etc/pacman.conf"
|
||||
[11]=""
|
||||
)
|
||||
case $lang in
|
||||
1) LOC="en_US.UTF-8" ;;
|
||||
2) src $srcdir/spanish.trans && LOC="es_ES.UTF-8" ;;
|
||||
3) src $srcdir/p_brasil.trans && LOC="pt_BR.UTF-8" ;;
|
||||
4) src $srcdir/portuguese.trans && LOC="pt_PT.UTF-8" ;;
|
||||
5) src $srcdir/french.trans && LOC="fr_FR.UTF-8" ;;
|
||||
6) src $srcdir/russian.trans && LOC="ru_RU.UTF-8" FONT="LatKaCyrHeb-16" ;;
|
||||
7) src $srcdir/italian.trans && LOC="it_IT.UTF-8" ;;
|
||||
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
|
||||
esac
|
||||
|
||||
sed -i "s/#en_US.UTF-8/en_US.UTF-8/" /etc/locale.gen
|
||||
|
||||
if [[ $LOC != "en_US.UTF-8" ]]; then
|
||||
sed -i "s/#${LOC}/${LOC}/" /etc/locale.gen
|
||||
locale-gen >/dev/null 2>&1
|
||||
fi
|
||||
[[ $TERM == 'linux' ]] && setfont $FONT >/dev/null 2>&1
|
||||
export LANG="$LOC"
|
||||
return 0
|
||||
}
|
||||
|
||||
user() {
|
||||
user_creation() {
|
||||
tput cnorm
|
||||
local values
|
||||
values="$(dialog --stdout --no-cancel --separator '~' --ok-label "Submit" --backtitle "$BT" \
|
||||
@ -199,49 +152,30 @@ user() {
|
||||
return 0
|
||||
}
|
||||
|
||||
language() {
|
||||
tput civis
|
||||
local lang
|
||||
lang=$(dialog --cr-wrap --stdout --backtitle "$BT" --title " Select Language " --menu \
|
||||
"\nLanguage - sprache - taal - språk - lingua - idioma - nyelv - língua\n" 0 0 0 \
|
||||
"1" "English (en_**)" "2" "Español (es_ES)" \
|
||||
"3" "Português [Brasil] (pt_BR)" "4" "Português (pt_PT)" \
|
||||
"5" "Français (fr_FR)" "6" "Russkiy (ru_RU)" \
|
||||
"7" "Italiano (it_IT)" "8" "Nederlands (nl_NL)" \
|
||||
"9" "Magyar (hu_HU)" "10" "Chinese (zh_CN)")
|
||||
|
||||
src $TRN/english.trans
|
||||
FONT="ter-i16n"
|
||||
|
||||
case $lang in
|
||||
1) LOC="en_US.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
|
||||
|
||||
sed -i "s/#en_US.UTF-8/en_US.UTF-8/" /etc/locale.gen
|
||||
|
||||
if [[ $LOC != "en_US.UTF-8" ]]; then
|
||||
sed -i "s/#${LOC}/${LOC}/" /etc/locale.gen
|
||||
locale-gen >/dev/null 2>&1
|
||||
fi
|
||||
[[ $TERM == 'linux' ]] && setfont $FONT >/dev/null 2>&1
|
||||
export LANG="$LOC"
|
||||
return 0
|
||||
}
|
||||
|
||||
keymap() {
|
||||
select_keymap() {
|
||||
tput civis
|
||||
KEYMAP="$(dialog --cr-wrap --stdout --backtitle "$BT" \
|
||||
--title " $_PrepLayout " --menu "$_XMapBody" 20 70 12 $KEYMAPS)"
|
||||
--title " $_PrepLayout " --menu "$_XMapBody" 20 70 12 \
|
||||
'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' 'ro' 'Romanian' \
|
||||
'no' 'Norwegian' 'rs' 'Serbian' 'si' 'Slovenian' 'tj' 'Tajik' 'lk' 'Sinhala' \
|
||||
'tr' 'Turkish' 'uz' 'Uzbek' 'ie' 'Irish' 'pk' 'Urdu' 'mv' 'Dhivehi' \
|
||||
'np' 'Nepali' 'et' 'Amharic' 'sn' 'Wolof' 'ml' 'Bambara' 'tz' 'Swahili' \
|
||||
'ke' 'Swahili' 'bw' 'Tswana' 'ph' 'Filipino' 'my' 'Malay' 'tm' 'Turkmen' \
|
||||
'id' 'Indonesian' 'bt' 'Dzongkha' 'lv' 'Latvian' 'md' 'Moldavian' 'mao' 'Maori' \
|
||||
'by' 'Belarusian' 'az' 'Azerbaijani' 'mk' 'Macedonian' 'kh' 'Khmer' 'epo' 'Esperanto' \
|
||||
'me' 'Montenegrin')"
|
||||
[[ $? != 0 || $KEYMAP == "" ]] && return 1
|
||||
|
||||
# when a matching console map is not available open a selection dialog
|
||||
@ -261,35 +195,30 @@ keymap() {
|
||||
return 0
|
||||
}
|
||||
|
||||
timezone() {
|
||||
select_timezone() {
|
||||
# create associative array for SUBZONES[zone]
|
||||
local f="/usr/share/zoneinfo/zone.tab"
|
||||
declare -A SUBZONES
|
||||
for i in America Australia Asia Atlantic Africa Europe Indian Pacific Arctic Antarctica; do
|
||||
SUBZONES[$i]="$(awk '/'"$i"'\// {gsub(/'"$i"'\//, ""); print $3, $1}' $f)"
|
||||
done
|
||||
|
||||
tput civis
|
||||
ZONE="$(dialog --cr-wrap --stdout --backtitle "$BT" \
|
||||
--title " $_TimeZTitle " --menu "$_TimeZBody" 20 70 10 America - Australia - \
|
||||
Asia - Atlantic - Africa - Europe - Indian - Pacific - Arctic - Antarctica -)"
|
||||
--title " $_TimeZTitle " --menu "$_TimeZBody" 20 70 10 \
|
||||
'America' '-' 'Australia' '-' 'Asia' '-' 'Atlantic' '-' 'Africa' '-' \
|
||||
'Europe' '-' 'Indian' '-' 'Pacific' '-' 'Arctic' '-' 'Antarctica' '-')"
|
||||
[[ $? != 0 || $ZONE == "" ]] && return 1
|
||||
|
||||
SUBZONE="$(dialog --cr-wrap --stdout --backtitle "$BT" \
|
||||
--title " $_TimeZTitle " --menu "$_TimeSubZBody" 20 70 12 ${SUBZONES[$ZONE]})"
|
||||
[[ $? != 0 || $SUBZONE == "" ]] && return 1
|
||||
|
||||
yesno "$_TimeZTitle" "$_TimeZQ $ZONE/$SUBZONE?\n" && return 0 || timezone
|
||||
yesno "$_TimeZTitle" "$_TimeZQ $ZONE/$SUBZONE?\n" && return 0 || select_timezone
|
||||
}
|
||||
|
||||
choose_dm() {
|
||||
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")"
|
||||
[[ $? -eq 0 ]] || return 1
|
||||
if [[ $LOGIN_TYPE == 'lightdm' ]]; then
|
||||
WM_PACKAGES+=" lightdm lightdm-gtk-greeter lightdm-gtk-greeter-settings accountsservice"
|
||||
FILES[11]="/etc/lightdm/lightdm.conf /etc/lightdm/lightdm-gtk-greeter.conf"
|
||||
else
|
||||
FILES[11]="/home/$NEWUSER/.xinitrc /home/$NEWUSER/.zprofile /home/$NEWUSER/.xprofile"
|
||||
fi
|
||||
}
|
||||
|
||||
sessions() {
|
||||
select_wm_or_de() {
|
||||
tput civis
|
||||
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 \
|
||||
@ -303,7 +232,8 @@ sessions() {
|
||||
[[ $INSTALL_WMS ]] || INSTALL_WMS='openbox'
|
||||
|
||||
WM_NUM=$(awk '{print NF}' <<< "$INSTALL_WMS")
|
||||
WM_PACKAGES="$INSTALL_WMS"
|
||||
WM_PACKAGES="${INSTALL_WMS/dwm/}" # remove dwm as we are compiling from source
|
||||
WM_PACKAGES="${INSTALL_WMS// / }" # substitute all double spaces to single
|
||||
|
||||
# packages needed for the selected WMs/DEs
|
||||
for wm in $INSTALL_WMS; do
|
||||
@ -319,40 +249,59 @@ sessions() {
|
||||
done
|
||||
|
||||
if [[ $INSTALL_WMS =~ (openbox|bspwm|i3-gaps) ]]; then
|
||||
WM_PACKAGES+=" archlabs-polybar archlabs-paranoid archlabs-screenlock archlabs-oblogout"
|
||||
WM_PACKAGES+=" rofi termite thunar lxappearance libmpdclient jsoncpp"
|
||||
WM_PACKAGES+=" rofi termite thunar archlabs-polybar archlabs-paranoid"
|
||||
WM_PACKAGES+=" lxappearance libmpdclient jsoncpp archlabs-screenlock archlabs-oblogout"
|
||||
elif [[ $INSTALL_WMS =~ (xfce4) ]]; then
|
||||
WM_PACKAGES+=" archlabs-oblogout archlabs-screenlock archlabs-paranoid"
|
||||
fi
|
||||
|
||||
# choose how to log in
|
||||
select_login_method || return 1
|
||||
|
||||
# choose which WM/DE to start at login
|
||||
if (( WM_NUM == 1 )); then
|
||||
LOGIN_WM="$INSTALL_WMS"
|
||||
if [[ $LOGIN_TYPE == 'xinit' ]]; then
|
||||
if [[ $WM_NUM -eq 1 ]]; then
|
||||
LOGIN_WM="$INSTALL_WMS"
|
||||
else
|
||||
LOGIN_WM="$(dialog --cr-wrap --stdout --no-cancel --backtitle "$BT" \
|
||||
--title " $_WMLogin " --menu "$_WMLoginBody" 0 0 0 $LOGIN_CHOICES)"
|
||||
[[ $? -eq 0 ]] || return 1
|
||||
fi
|
||||
|
||||
case $LOGIN_WM in
|
||||
i3-gaps) LOGIN_WM='i3' ;;
|
||||
xfce4) LOGIN_WM='startxfce4' ;;
|
||||
gnome) LOGIN_WM='gnome-session' ;;
|
||||
openbox) LOGIN_WM='openbox-session' ;;
|
||||
cinnamon) LOGIN_WM='cinnamon-session' ;;
|
||||
esac
|
||||
|
||||
# autologin
|
||||
yesno "$_WMLogin" "$_AutoLoginBody\n" && AUTOLOGIN=true || AUTOLOGIN=false
|
||||
else
|
||||
LOGIN_WM="$(dialog --cr-wrap --stdout --no-cancel --backtitle "$BT" \
|
||||
--title " $_WMLogin " --menu "$_WMLoginBody" 0 0 0 $LOGIN_CHOICES)"
|
||||
[[ $? -eq 0 ]] || return 1
|
||||
AUTOLOGIN=false
|
||||
fi
|
||||
|
||||
# choose how to log in
|
||||
choose_dm || return 1
|
||||
|
||||
# add all the packages to the main package list
|
||||
EXTRA_PACKAGES="$WM_PACKAGES"
|
||||
|
||||
# autologin
|
||||
yesno "$_WMLogin" "$_AutoLoginBody\n" && AUTOLOGIN=true || AUTOLOGIN=false
|
||||
case $LOGIN_WM in
|
||||
i3-gaps) LOGIN_WM='i3' ;;
|
||||
xfce4) LOGIN_WM='startxfce4' ;;
|
||||
gnome) LOGIN_WM='gnome-session' ;;
|
||||
openbox) LOGIN_WM='openbox-session' ;;
|
||||
cinnamon) LOGIN_WM='cinnamon-session' ;;
|
||||
esac
|
||||
# add packages to the main package list
|
||||
PACKAGES="$WM_PACKAGES"
|
||||
return 0
|
||||
}
|
||||
|
||||
packages() {
|
||||
select_login_method() {
|
||||
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")"
|
||||
[[ $? -eq 0 ]] || return 1
|
||||
if [[ $LOGIN_TYPE == 'lightdm' ]]; then
|
||||
WM_PACKAGES+=" lightdm lightdm-gtk-greeter lightdm-gtk-greeter-settings accountsservice"
|
||||
EDIT_FILES[11]="/etc/lightdm/lightdm.conf /etc/lightdm/lightdm-gtk-greeter.conf"
|
||||
else
|
||||
EDIT_FILES[11]="/home/$NEWUSER/.xinitrc /home/$NEWUSER/.zprofile /home/$NEWUSER/.xprofile"
|
||||
fi
|
||||
}
|
||||
|
||||
select_extra_packages() {
|
||||
local pkgs
|
||||
pkgs="$(dialog --cr-wrap --stdout --backtitle "$BT" \
|
||||
--title " $_ExtraPackages " --checklist "$_ExtraPackagesBody\n" 0 0 30 \
|
||||
@ -440,15 +389,18 @@ packages() {
|
||||
([[ $INSTALL_WMS =~ dwm ]] && ! [[ $pkgs =~ ttf-hack ]]) && pkgs+=" ttf-hack"
|
||||
([[ $pkgs =~ (qutebrowser|qbittorrent|kdenlive|vlc) ]] && ! [[ $pkgs =~ qt5ct ]]) && pkgs+=" qt5ct qt5-styleplugins"
|
||||
|
||||
EXTRA_PACKAGES+=" $pkgs"
|
||||
PACKAGES+=" $pkgs" # add chosen packages to the main package list
|
||||
PACKAGES="${PACKAGES/^ /}" # remove leading spaces from the package string
|
||||
return 0
|
||||
}
|
||||
|
||||
mirrors() {
|
||||
select_mirrorlist_command() {
|
||||
local key="5f29642060ab983b31fdf4c2935d8c56"
|
||||
|
||||
if hash reflector >/dev/null 2>&1; then
|
||||
MIRROR_CMD="reflector --score 100 -l 50 -f 10 --sort rate --verbose"
|
||||
yesno "$_MirrorTitle" "$_MirrorSetup" "Automatic" "Custom" && return 0
|
||||
|
||||
local ip="$(json 'ip' "check&?access_key=${key}&fields=ip")"
|
||||
local c="$(json 'country_name' "${ip}?access_key=${key}&fields=country_name")"
|
||||
MIRROR_CMD="reflector --country $c --score 80 --latest 40 --fastest 10 --sort rate --verbose"
|
||||
@ -483,42 +435,57 @@ mirrors() {
|
||||
return 0
|
||||
}
|
||||
|
||||
display() {
|
||||
local cmd mnt
|
||||
display_system_settings() {
|
||||
local cmd mnt pkgs
|
||||
cmd="${BCMDS[$BOOTLDR]}"
|
||||
mnt="${BMNTS[$SYS-$BOOTLDR]}"
|
||||
msgbox "$_PrepTitle" "\nConfiguration values for the current install\n\n
|
||||
Root: ${ROOT_PART:-None}
|
||||
Boot: ${BOOT_PART:-None}
|
||||
Swap: ${SWAP:-None}
|
||||
msgbox "$_PrepTitle" "\n\n---------- PARTITION CONFIGURATION ------------
|
||||
|
||||
Extra: ${EXTRA_MNTS:-None}
|
||||
Hooks: ${MKINIT_HOOKS:-None}
|
||||
Root: ${ROOT_PART:-None}
|
||||
Boot: ${BOOT_PART:-None}
|
||||
|
||||
LVM: ${LVM:-None}
|
||||
LUKS: ${LUKS:-None}
|
||||
Swap: ${SWAP_PART:-None}
|
||||
Size: ${SWAP_SIZE:-None}
|
||||
|
||||
Bootloader: ${BOOTLDR:-None}
|
||||
Boot Mount: ${mnt:-None}
|
||||
Boot Command: ${cmd:-None}
|
||||
Extra: ${EXTRA_MNTS:-None}
|
||||
Hooks: ${MKINIT_HOOKS:-None}
|
||||
|
||||
User: ${NEWUSER:-None}
|
||||
Hostname: ${HOSTNAME:-None}
|
||||
Locale: ${LOCALE:-None}
|
||||
Keymap: ${KEYMAP:-None}
|
||||
Timezone: ${ZONE:-None}/${SUBZONE:-None}
|
||||
LVM: ${LVM:-None}
|
||||
LUKS: ${LUKS:-None}
|
||||
|
||||
Autologin: ${AUTOLOGIN:-None}
|
||||
Login: ${LOGIN_WM:-None}
|
||||
Login Type: ${LOGIN_TYPE:-None}
|
||||
|
||||
Sessions: ${INSTALL_WMS:-None}
|
||||
Kernel: ${KERNEL:-None}
|
||||
Mirrors: ${MIRROR_CMD:-None}
|
||||
Packages: ${EXTRA_PACKAGES:-None}\n"
|
||||
---------- BOOTLOADER CONFIGURATION -----------
|
||||
|
||||
Loader: ${BOOTLDR:-None}
|
||||
Mount: ${mnt:-None}
|
||||
Command: ${cmd:-None}
|
||||
|
||||
|
||||
------------ SYSTEM CONFIGURATION -------------
|
||||
|
||||
User: ${NEWUSER:-None}
|
||||
Locale: ${LOCALE:-None}
|
||||
Keymap: ${KEYMAP:-None}
|
||||
Hostname: ${HOSTNAME:-None}
|
||||
Timezone: ${ZONE:-None}/${SUBZONE:-None}
|
||||
|
||||
|
||||
------------ LOGIN CONFIGURATION --------------
|
||||
|
||||
Session: ${LOGIN_WM:-None}
|
||||
Autologin: ${AUTOLOGIN:-None}
|
||||
Management: ${LOGIN_TYPE:-None}
|
||||
|
||||
|
||||
------------ PACKAGES AND MIRRORS -------------
|
||||
|
||||
Kernel: ${KERNEL:-None}
|
||||
Sessions: ${INSTALL_WMS:-None}
|
||||
Mirrors: ${MIRROR_CMD:-None}
|
||||
Packages: $(printq "${PACKAGES:-None}")\n"
|
||||
}
|
||||
|
||||
configure() {
|
||||
configure_system_settings() {
|
||||
tput cnorm
|
||||
HOSTNAME="$(getinput "$_ConfHost" "$_HostNameBody" "${DIST,,}")"
|
||||
[[ $? != 0 || ! $HOSTNAME ]] && return 1
|
||||
@ -528,21 +495,21 @@ configure() {
|
||||
--title " $_ConfLocale " --menu "$_LocaleBody" 25 70 20 $LOCALES)"
|
||||
[[ $? != 0 || ! $LOCALE ]] && return 1
|
||||
|
||||
timezone || return 1
|
||||
mirrors || return 1
|
||||
user || return 1
|
||||
sessions || return 1
|
||||
select_timezone || return 1
|
||||
select_mirrorlist_command || return 1
|
||||
user_creation || return 1
|
||||
select_wm_or_de || return 1
|
||||
|
||||
tput civis
|
||||
KERNEL="$(dialog --cr-wrap --stdout --backtitle "$BT" \
|
||||
--title " $_KernelTitle " --menu "$_KernelBody" 0 0 0 $KERNELS)"
|
||||
--title " $_KernelTitle " --menu "$_KernelBody" 0 0 0 'linux' '-' 'linux-lts' '-')"
|
||||
[[ $? != 0 || ! $KERNEL ]] && return 1
|
||||
packages || return 1
|
||||
select_extra_packages || return 1
|
||||
CONFIG_DONE=true
|
||||
return 0
|
||||
}
|
||||
|
||||
configs() {
|
||||
edit_system_configs() {
|
||||
if [[ $CURRENT_MENU != "edit" ]]; then
|
||||
SELECTED=1; CURRENT_MENU="edit"
|
||||
elif (( SELECTED < 11 )); then
|
||||
@ -551,19 +518,19 @@ configs() {
|
||||
|
||||
tput civis
|
||||
local exitstr="Exit"
|
||||
[[ $DEBUG != true ]] && exitstr+=" & Reboot"
|
||||
[[ $DEBUG == true ]] && exitstr+=" & Reboot" || exitstr+=" & Reboot"
|
||||
|
||||
SELECTED=$(dialog --cr-wrap --stdout --backtitle "$BT" \
|
||||
--title " $_EditTitle " --default-item $SELECTED --menu "$_EditBody" 0 0 0 \
|
||||
"1" "$exitstr" "2" "Keyboard" "3" "Locale" "4" "Hostname" "5" "Sudoers" \
|
||||
"6" "Mkinitcpio.conf" "7" "Fstab" "8" "Crypttab" "9" "${BOOTLDR^}" "10" "Pacman.conf" \
|
||||
"11" "${LOGIN_TYPE^}")
|
||||
"1" "$exitstr" "2" "Keyboard" "3" "Locale" "4" "Hostname" \
|
||||
"5" "Sudoers" "6" "Mkinitcpio.conf" "7" "Fstab" "8" "Crypttab" \
|
||||
"9" "${BOOTLDR^}" "10" "Pacman.conf" "11" "${LOGIN_TYPE^}")
|
||||
|
||||
if [[ ! $SELECTED || $SELECTED -eq 1 ]]; then
|
||||
[[ $DEBUG == true ]] && die 0 || die 'reboot'
|
||||
[[ $DEBUG == true ]] && { more /tmp/debug-log; die 0; } || die 'systemctl -i reboot'
|
||||
else
|
||||
local existing_files=""
|
||||
for f in $(echo "${FILES[$SELECTED]}"); do
|
||||
for f in $(echo "${EDIT_FILES[$SELECTED]}"); do
|
||||
[[ -e ${MNT}$f ]] && existing_files+=" ${MNT}$f"
|
||||
done
|
||||
if [[ ! $existing_files ]]; then
|
||||
@ -582,7 +549,7 @@ configs() {
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
configs
|
||||
edit_system_configs
|
||||
}
|
||||
|
||||
main() {
|
||||
@ -615,17 +582,14 @@ main() {
|
||||
2) partition || SELECTED=1 ;;
|
||||
3) luks_menu || SELECTED=2 ;;
|
||||
4) lvm_menu || SELECTED=3 ;;
|
||||
5) mountp || SELECTED=4 ;;
|
||||
6) configure || SELECTED=5 ;;
|
||||
7) display ;;
|
||||
5) mount_install_partitions || SELECTED=4 ;;
|
||||
6) configure_system_settings || SELECTED=5 ;;
|
||||
7) display_system_settings ;;
|
||||
8) install ;;
|
||||
*) yesno "$_CloseInst" "$_CloseInstBody" "Exit" "Back" && die 0
|
||||
esac
|
||||
}
|
||||
|
||||
# must be done first
|
||||
init
|
||||
|
||||
# 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; }
|
||||
@ -640,8 +604,8 @@ esac done
|
||||
|
||||
# initial choices/prep
|
||||
devices
|
||||
language
|
||||
keymap
|
||||
select_language
|
||||
select_keymap
|
||||
checks
|
||||
sysid
|
||||
|
||||
|
Reference in New Issue
Block a user