You've already forked al-installer
More cleanup in various functions, use var+="val" rather than var="$var val"
This commit is contained in:
@ -12,7 +12,7 @@
|
||||
# immutable variables {
|
||||
|
||||
readonly DIST="ArchLabs" # Linux distributor
|
||||
readonly VER="1.6.78" # Installer version
|
||||
readonly VER="1.6.88" # Installer version
|
||||
readonly LIVE="liveuser" # Live session user
|
||||
readonly MNT="/mnt/install" # Install mountpoint
|
||||
readonly ERR="/tmp/errlog" # Built-in error log
|
||||
@ -83,7 +83,7 @@ declare -Agr FS_CMDS=(
|
||||
)
|
||||
|
||||
declare -Agr FS_OPTS=([vfat]="" [ntfs]="" [ext2]="" [ext3]=""
|
||||
[ext4]="dealloc - off discard - off nofail - off noacl - off relatime - off noatime - off nobarrier - off nodelalloc - off"
|
||||
[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"
|
||||
@ -114,6 +114,7 @@ init_variables() {
|
||||
declare -g EXTRA_PACKAGES=""
|
||||
declare -g MKINIT_HOOKS="shutdown"
|
||||
|
||||
declare -g WARN=false
|
||||
declare -g IS_64BIT=false
|
||||
declare -g AUTOLOGIN=false
|
||||
declare -g CONFIG_DONE=false
|
||||
@ -139,7 +140,7 @@ init_variables() {
|
||||
}
|
||||
|
||||
source_file() {
|
||||
. $1 2>/dev/null || { printf "\nFailed to source library file %s" "$1"; die 1; }
|
||||
. "$1" || { printf "\nFailed to source library file %s" "$1"; die 1; }
|
||||
}
|
||||
|
||||
user_creation() {
|
||||
@ -241,7 +242,7 @@ select_language() {
|
||||
sed -i "s/#${LOC}/${LOC}/" /etc/locale.gen
|
||||
locale-gen >/dev/null 2>&1
|
||||
fi
|
||||
setfont $FONT >/dev/null 2>&1
|
||||
[[ $TERM == 'linux' ]] && setfont $FONT >/dev/null 2>&1
|
||||
export LANG="$LOC"
|
||||
return 0
|
||||
}
|
||||
@ -287,12 +288,12 @@ window_manager() {
|
||||
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 \
|
||||
"bspwm" "A tiling window manager that represents windows as the leaves of a binary tree" off \
|
||||
"bspwm" "A tiling window manager that represents windows as the leaves of a binary tree" off \
|
||||
"i3-gaps" "A fork of i3 window manager with more features including gaps" off \
|
||||
"dwm" "A customized fork of dwm, with patches and modifications" off \
|
||||
"gnome" "A desktop environment that aims to be simple and easy to use" off \
|
||||
"dwm" "A customized fork of dwm, with patches and modifications" off \
|
||||
"gnome" "A desktop environment that aims to be simple and easy to use" off \
|
||||
"cinnamon" "A desktop environment combining a traditional desktop layout with modern graphical effects" off \
|
||||
"xfce4" "A lightweight and modular desktop environment based on GTK+ 2 and 3" off)"
|
||||
"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")
|
||||
|
||||
@ -300,19 +301,20 @@ window_manager() {
|
||||
for wm in $INSTALL_WMS; do
|
||||
LOGIN_CHOICES="${LOGIN_CHOICES}$wm - "
|
||||
case $wm in
|
||||
openbox) WM_PACKAGES="$WM_PACKAGES $wm obconf archlabs-obkey archlabs-kickshaw archlabs-skippy-xd tint2 conky jgmenu" ;;
|
||||
bspwm) WM_PACKAGES="$WM_PACKAGES $wm sxhkd" ;;
|
||||
i3-gaps) WM_PACKAGES="$WM_PACKAGES $wm i3status perl-anyevent-i3" ;;
|
||||
gnome) WM_PACKAGES="$WM_PACKAGES $wm gnome-extra" ;;
|
||||
cinnamon) WM_PACKAGES="$WM_PACKAGES $wm" ;;
|
||||
xfce4) WM_PACKAGES="$WM_PACKAGES $wm xfce4-goodies xfce4-pulseaudio-plugin" ;;
|
||||
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" ;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ $INSTALL_WMS =~ (openbox|bspwm|i3-gaps) ]]; then
|
||||
WM_PACKAGES="$WM_PACKAGES archlabs-polybar jsoncpp libmpdclient archlabs-screenlock archlabs-oblogout archlabs-paranoid lxappearance rofi termite thunar"
|
||||
WM_PACKAGES+=" archlabs-polybar jsoncpp libmpdclient archlabs-screenlock archlabs-oblogout"
|
||||
WM_PACKAGES+=" archlabs-paranoid lxappearance rofi termite thunar"
|
||||
elif [[ $INSTALL_WMS =~ (xfce4) ]]; then
|
||||
WM_PACKAGES="$WM_PACKAGES archlabs-oblogout archlabs-screenlock archlabs-paranoid"
|
||||
WM_PACKAGES+=" archlabs-oblogout archlabs-screenlock archlabs-paranoid"
|
||||
fi
|
||||
|
||||
# choose which to login
|
||||
@ -330,7 +332,7 @@ window_manager() {
|
||||
FILES[11]="/home/$NEWUSER/.xinitrc"
|
||||
else
|
||||
LOGIN_TYPE='lightdm'
|
||||
WM_PACKAGES="$WM_PACKAGES lightdm lightdm-gtk-greeter lightdm-gtk-greeter-settings accountsservice"
|
||||
WM_PACKAGES+=" lightdm lightdm-gtk-greeter lightdm-gtk-greeter-settings accountsservice"
|
||||
FILES[11]="/etc/lightdm/lightdm.conf $MNT/etc/lightdm/lightdm-gtk-greeter.conf"
|
||||
fi
|
||||
|
||||
@ -338,13 +340,12 @@ window_manager() {
|
||||
|
||||
# autologin
|
||||
yesno "$_WMLogin" "$_AutoLoginBody\n" && AUTOLOGIN=true || AUTOLOGIN=false
|
||||
|
||||
case $LOGIN_WM in
|
||||
i3-gaps) LOGIN_WM='i3' ;;
|
||||
gnome) LOGIN_WM='gnome-session' ;;
|
||||
i3-gaps) LOGIN_WM='i3' ;;
|
||||
xfce4) LOGIN_WM='startxfce4' ;;
|
||||
gnome) LOGIN_WM='gnome-session' ;;
|
||||
openbox) LOGIN_WM='openbox-session' ;;
|
||||
cinnamon) LOGIN_WM='cinnamon-session' ;;
|
||||
openbox) LOGIN_WM='openbox-session' ;;
|
||||
xfce4) LOGIN_WM='startxfce4' ;;
|
||||
esac
|
||||
|
||||
return 0
|
||||
@ -354,91 +355,92 @@ extra_packages() {
|
||||
local pkgs
|
||||
pkgs="$(dialog --cr-wrap --stdout --backtitle "$BT" \
|
||||
--title " $_ExtraPackages " --checklist "$_ExtraPackagesBody\n" 0 0 30 \
|
||||
"firefox" "A popular open-source graphical web browser from Mozilla" off \
|
||||
"chromium" "an open-source graphical web browser based on the Blink rendering engine" off \
|
||||
"opera" "Fast and secure, free of charge web browser from Opera Software" off \
|
||||
"epiphany" "A GNOME web browser based on the WebKit rendering engine" off \
|
||||
"qutebrowser" "A keyboard-focused vim-like web browser based on Python and PyQt5" off \
|
||||
"atom" "An open-source text editor developed by GitHub that is licensed under the MIT License" off \
|
||||
"geany" "A fast and lightweight IDE" off \
|
||||
"emacs" "An extensible, customizable, self-documenting real-time display editor" off \
|
||||
"neovim" "A fork of Vim aiming to improve user experience, plugins, and GUIs." off \
|
||||
"mousepad" "A simple text editor" off \
|
||||
"rxvt-unicode" "A unicode enabled rxvt-clone terminal emulator" off \
|
||||
"termite" "A minimal VTE-based terminal emulator" off \
|
||||
"tilix" "A tiling terminal emulator for Linux using GTK+ 3" off \
|
||||
"terminator" "Terminal emulator that supports tabs and grids" off \
|
||||
"tilda" "A Gtk based drop down terminal for Linux and Unix" off \
|
||||
"xfce4-terminal" "A terminal emulator based in the Xfce Desktop Environment" off \
|
||||
"thunar" "A modern file manager for the Xfce Desktop Environment" off \
|
||||
"pcmanfm" "A fast and lightweight file manager based in Lxde" off \
|
||||
"gnome-disk-utility" "Disk Management Utility" off \
|
||||
"firefox" "A popular open-source graphical web browser from Mozilla" off \
|
||||
"chromium" "an open-source graphical web browser based on the Blink rendering engine" off \
|
||||
"opera" "Fast and secure, free of charge web browser from Opera Software" off \
|
||||
"epiphany" "A GNOME web browser based on the WebKit rendering engine" off \
|
||||
"qutebrowser" "A keyboard-focused vim-like web browser based on Python and PyQt5" off \
|
||||
"atom" "An open-source text editor developed by GitHub that is licensed under the MIT License" off \
|
||||
"geany" "A fast and lightweight IDE" off \
|
||||
"emacs" "An extensible, customizable, self-documenting real-time display editor" off \
|
||||
"neovim" "A fork of Vim aiming to improve user experience, plugins, and GUIs." off \
|
||||
"mousepad" "A simple text editor" off \
|
||||
"rxvt-unicode" "A unicode enabled rxvt-clone terminal emulator" off \
|
||||
"termite" "A minimal VTE-based terminal emulator" off \
|
||||
"tilix" "A tiling terminal emulator for Linux using GTK+ 3" off \
|
||||
"terminator" "Terminal emulator that supports tabs and grids" off \
|
||||
"tilda" "A Gtk based drop down terminal for Linux and Unix" off \
|
||||
"xfce4-terminal" "A terminal emulator based in the Xfce Desktop Environment" off \
|
||||
"thunar" "A modern file manager for the Xfce Desktop Environment" off \
|
||||
"pcmanfm" "A fast and lightweight file manager based in Lxde" off \
|
||||
"gnome-disk-utility" "Disk Management Utility" off \
|
||||
"gnome-system-monitor" "View current processes and monitor system state" off \
|
||||
"steam" "A popular game distribution platform by Valve" off \
|
||||
"vlc" "A free and open source cross-platform multimedia player" off \
|
||||
"mpd" "A flexible, powerful, server-side application for playing music" off \
|
||||
"ncmpcpp" "An mpd client and almost exact clone of ncmpc with some new features" off \
|
||||
"cmus" "A small, fast and powerful console music player for Unix-like operating systems" off \
|
||||
"audacious" "A free and advanced audio player based on GTK+" off \
|
||||
"nicotine+" "A graphical client for Soulseek" off \
|
||||
"lollypop" "A new music playing application" off \
|
||||
"rhythmbox" "Music playback and management application" off \
|
||||
"deadbeef" "A GTK+ audio player for GNU/Linux" off \
|
||||
"clementine" "A modern music player and library organizer" off \
|
||||
"thunderbird" "Standalone mail and news reader from mozilla" off \
|
||||
"geary" "A lightweight email client for the GNOME desktop" off \
|
||||
"evolution" "Manage your email, contacts and schedule" off \
|
||||
"mutt" "Small but very powerful text-based mail client" off \
|
||||
"deluge" "A BitTorrent client written in python" off \
|
||||
"transmission-gtk" "Free BitTorrent client GTK+ GUI" off \
|
||||
"qbittorrent" "An advanced BitTorrent client" off \
|
||||
"hexchat" "A popular and easy to use graphical IRC client" off \
|
||||
"pidgin" "Multi-protocol instant messaging client" off \
|
||||
"weechat" "Fast, light and extensible IRC client" off \
|
||||
"irssi" "Modular text mode IRC client" off \
|
||||
"libreoffice-fresh" "Full featured office suite" off \
|
||||
"abiword" "Fully-featured word processor" off \
|
||||
"calligra" "A set of applications for productivity" off \
|
||||
"evince" "A document viewer" off \
|
||||
"zathura" "Minimalistic document viewer" off \
|
||||
"qpdfview" "A tabbed PDF viewer" off \
|
||||
"mupdf" "Lightweight PDF and XPS viewer" off \
|
||||
"gpicview" "Lightweight image viewer" off \
|
||||
"gimp" "GNU Image Manipulation Program" off \
|
||||
"inkscape" "Professional vector graphics editor" off \
|
||||
"krita" "Edit and paint images" off \
|
||||
"steam" "A popular game distribution platform by Valve" off \
|
||||
"vlc" "A free and open source cross-platform multimedia player" off \
|
||||
"mpd" "A flexible, powerful, server-side application for playing music" off \
|
||||
"ncmpcpp" "An mpd client and almost exact clone of ncmpc with some new features" off \
|
||||
"cmus" "A small, fast and powerful console music player for Unix-like operating systems" off \
|
||||
"audacious" "A free and advanced audio player based on GTK+" off \
|
||||
"nicotine+" "A graphical client for Soulseek" off \
|
||||
"lollypop" "A new music playing application" off \
|
||||
"rhythmbox" "Music playback and management application" off \
|
||||
"deadbeef" "A GTK+ audio player for GNU/Linux" off \
|
||||
"clementine" "A modern music player and library organizer" off \
|
||||
"thunderbird" "Standalone mail and news reader from mozilla" off \
|
||||
"geary" "A lightweight email client for the GNOME desktop" off \
|
||||
"evolution" "Manage your email, contacts and schedule" off \
|
||||
"mutt" "Small but very powerful text-based mail client" off \
|
||||
"deluge" "A BitTorrent client written in python" off \
|
||||
"transmission-gtk" "Free BitTorrent client GTK+ GUI" off \
|
||||
"qbittorrent" "An advanced BitTorrent client" off \
|
||||
"hexchat" "A popular and easy to use graphical IRC client" off \
|
||||
"pidgin" "Multi-protocol instant messaging client" off \
|
||||
"weechat" "Fast, light and extensible IRC client" off \
|
||||
"irssi" "Modular text mode IRC client" off \
|
||||
"libreoffice-fresh" "Full featured office suite" off \
|
||||
"abiword" "Fully-featured word processor" off \
|
||||
"calligra" "A set of applications for productivity" off \
|
||||
"evince" "A document viewer" off \
|
||||
"zathura" "Minimalistic document viewer" off \
|
||||
"qpdfview" "A tabbed PDF viewer" off \
|
||||
"mupdf" "Lightweight PDF and XPS viewer" off \
|
||||
"gpicview" "Lightweight image viewer" off \
|
||||
"gimp" "GNU Image Manipulation Program" off \
|
||||
"inkscape" "Professional vector graphics editor" off \
|
||||
"krita" "Edit and paint images" off \
|
||||
"simplescreenrecorder" "A feature-rich screen recorder" off \
|
||||
"obs-studio" "Free opensource streaming/recording software" off \
|
||||
"openshot" "An open-source, non-linear video editor for Linux based on MLT framework" off \
|
||||
"kdenlive" "A non-linear video editor for Linux using the MLT video framework" off \
|
||||
"audacity" "A program that lets you manipulate digital audio waveforms" off \
|
||||
"guvcview" "Capture video from camera devices" off \
|
||||
"gpick" "Advanced color picker using GTK+ toolkit" off \
|
||||
"gcolor2" "A simple GTK+2 color selector" off \
|
||||
"plank" "An elegant, simple, and clean dock" off \
|
||||
"docky" "Full fledged dock that makes opening common applications and managing windows faster and easier" off \
|
||||
"cairo-dock" "Light eye-candy fully themable animated dock" off \
|
||||
"qt5ct" "GUI for managing Qt based application themes, icons, and fonts" off \
|
||||
"ttf-hack" "A hand groomed and optically balanced typeface based on Bitstream Vera Mono" off \
|
||||
"ttf-anonymous-pro" "A family of four fixed-width fonts designed especially with coding in mind" off \
|
||||
"ttf-font-awesome" "Iconic font designed for Bootstrap" off \
|
||||
"ttf-fira-code" "Monospaced font with programming ligatures" off \
|
||||
"noto-fonts" "Google Noto fonts" off \
|
||||
"noto-fonts-cjk" "Google Noto CJK fonts (Chinese, Japanese, Korean)" off)"
|
||||
[[ $pkgs =~ vlc ]] && pkgs="$pkgs qt4"
|
||||
[[ $pkgs =~ mpd ]] && pkgs="$pkgs mpc"
|
||||
[[ $pkgs =~ mupdf ]] && pkgs="$pkgs mupdf-tools"
|
||||
[[ $pkgs =~ qt5ct ]] && pkgs="$pkgs qt5-styleplugins"
|
||||
[[ $pkgs =~ steam ]] && pkgs="$pkgs steam-native-runtime"
|
||||
[[ $pkgs =~ zathura ]] && pkgs="$pkgs zathura-pdf-poppler"
|
||||
[[ $pkgs =~ noto-fonts ]] && pkgs="$pkgs noto-fonts-emoji"
|
||||
[[ $pkgs =~ cairo-dock ]] && pkgs="$pkgs cairo-dock-plug-ins"
|
||||
[[ $pkgs =~ kdenlive ]] && pkgs="$pkgs kdebase-runtime dvdauthor frei0r-plugins breeze breeze-gtk"
|
||||
"obs-studio" "Free opensource streaming/recording software" off \
|
||||
"openshot" "An open-source, non-linear video editor for Linux based on MLT framework" off \
|
||||
"kdenlive" "A non-linear video editor for Linux using the MLT video framework" off \
|
||||
"audacity" "A program that lets you manipulate digital audio waveforms" off \
|
||||
"guvcview" "Capture video from camera devices" off \
|
||||
"gpick" "Advanced color picker using GTK+ toolkit" off \
|
||||
"gcolor2" "A simple GTK+2 color selector" off \
|
||||
"plank" "An elegant, simple, and clean dock" off \
|
||||
"docky" "Full fledged dock that makes opening applications and managing windows faster and easier" off \
|
||||
"cairo-dock" "Light eye-candy fully themable animated dock" off \
|
||||
"qt5ct" "GUI for managing Qt based application themes, icons, and fonts" off \
|
||||
"ttf-hack" "A hand groomed and optically balanced typeface based on Bitstream Vera Mono" off \
|
||||
"ttf-anonymous-pro" "A family of four fixed-width fonts designed especially with coding in mind" off \
|
||||
"ttf-font-awesome" "Iconic font designed for Bootstrap" off \
|
||||
"ttf-fira-code" "Monospaced font with programming ligatures" off \
|
||||
"noto-fonts" "Google Noto fonts" off \
|
||||
"noto-fonts-cjk" "Google Noto CJK fonts (Chinese, Japanese, Korean)" off)"
|
||||
|
||||
[[ $pkgs =~ vlc ]] && pkgs+=" qt4"
|
||||
[[ $pkgs =~ mpd ]] && pkgs+=" mpc"
|
||||
[[ $pkgs =~ mupdf ]] && pkgs+=" mupdf-tools"
|
||||
[[ $pkgs =~ qt5ct ]] && pkgs+=" qt5-styleplugins"
|
||||
[[ $pkgs =~ steam ]] && pkgs+=" steam-native-runtime"
|
||||
[[ $pkgs =~ zathura ]] && pkgs+=" zathura-pdf-poppler"
|
||||
[[ $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="$pkgs ttf-hack"
|
||||
pkgs+=" ttf-hack"
|
||||
fi
|
||||
if [[ $pkgs =~ (qutebrowser|qbittorrent|kdenlive|vlc) ]] && ! [[ $pkgs =~ qt5ct ]]; then
|
||||
pkgs="$pkgs qt5ct qt5-styleplugins"
|
||||
pkgs+=" qt5ct qt5-styleplugins"
|
||||
fi
|
||||
|
||||
EXTRA_PACKAGES="$EXTRA_PACKAGES$([[ $pkgs ]] && printf " %s" "$pkgs")"
|
||||
@ -492,38 +494,33 @@ mirrorlist_cmd() {
|
||||
}
|
||||
|
||||
display_selection() {
|
||||
local msg="Configuration values used for install
|
||||
msgbox "$_PrepTitle" "\nConfiguration values used for install\n\n
|
||||
Root: $ROOT_PART
|
||||
Boot: $BOOT_PART
|
||||
Swap: $SWAP
|
||||
Extra: ${EXTRA_MNTS:-None}
|
||||
|
||||
LVM: $LVM
|
||||
LUKS: $LUKS
|
||||
|
||||
Root Partition: $ROOT_PART
|
||||
Boot Partition: $BOOT_PART
|
||||
|
||||
Bootloader: $BOOTLDR
|
||||
Boot Mount: ${BMNTS[$SYS-$BOOTLDR]}
|
||||
Bootloader: $BOOTLDR
|
||||
Boot Mount: ${BMNTS[$SYS-$BOOTLDR]}
|
||||
Boot Command: ${BCMDS[$BOOTLDR]}
|
||||
|
||||
Swap: $SWAP
|
||||
Extra: $EXTRA_MNTS
|
||||
|
||||
LUKS: $LUKS
|
||||
LVM: $LVM
|
||||
|
||||
New User: $NEWUSER
|
||||
Autologin: $AUTOLOGIN
|
||||
New User: $NEWUSER
|
||||
Login: $LOGIN_WM
|
||||
Autologin: $AUTOLOGIN
|
||||
Login Type: $LOGIN_TYPE
|
||||
Login Session: $LOGIN_WM
|
||||
|
||||
Hostname: $HOSTNAME
|
||||
Locale: $LOCALE
|
||||
Keymap: $KEYMAP
|
||||
Locale: $LOCALE
|
||||
Keymap: $KEYMAP
|
||||
Timezone: $ZONE/$SUBZONE
|
||||
|
||||
Kernel: $KERNEL
|
||||
Kernel: $KERNEL
|
||||
Sessions: $INSTALL_WMS
|
||||
Mirrors: $MIRROR_CMD
|
||||
Packages: $EXTRA_PACKAGES"
|
||||
|
||||
msgbox "$_PrepTitle" "\n$msg\n"
|
||||
Mirrors: $MIRROR_CMD
|
||||
Packages: $EXTRA_PACKAGES\n"
|
||||
}
|
||||
|
||||
configure_install() {
|
||||
@ -540,10 +537,8 @@ configure_install() {
|
||||
mirrorlist_cmd || return 1
|
||||
user_creation || return 1
|
||||
window_manager || 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
|
||||
CONFIG_DONE=true
|
||||
return 0
|
||||
@ -551,64 +546,63 @@ configure_install() {
|
||||
|
||||
edit_configs() {
|
||||
if [[ $CURRENT_MENU != "edit" ]]; then
|
||||
MENU_HIGHLIGHT=1
|
||||
SELECTED=1
|
||||
CURRENT_MENU="edit"
|
||||
elif (( MENU_HIGHLIGHT < 10 )); then
|
||||
(( MENU_HIGHLIGHT++ ))
|
||||
elif (( SELECTED < 10 )); then
|
||||
(( SELECTED++ ))
|
||||
fi
|
||||
|
||||
tput civis
|
||||
MENU_HIGHLIGHT=$(dialog --cr-wrap --stdout --backtitle "$BT" \
|
||||
--title " $_EditTitle " --default-item $MENU_HIGHLIGHT --menu "$_EditBody" 0 0 0 \
|
||||
"1" "$_Done" "2" "keyboard" "3" "language + locale" "4" "hostname" "5" "sudoers" \
|
||||
"6" "mkinitcpio.conf" "7" "fstab" "8" "crypttab" "9" "$BOOTLDR" "10" "pacman.conf" \
|
||||
SELECTED=$(dialog --cr-wrap --stdout --backtitle "$BT" \
|
||||
--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")
|
||||
|
||||
if [[ $MENU_HIGHLIGHT == "" || $MENU_HIGHLIGHT == 1 ]]; then
|
||||
if [[ ! $SELECTED || $SELECTED -eq 1 ]]; then
|
||||
wrap_up "$_InstFinBody" 'Reboot' 'Back' 'reboot'
|
||||
else
|
||||
local existing_files=""
|
||||
for f in $(echo "${FILES[$MENU_HIGHLIGHT]}"); do
|
||||
[[ -e ${MNT}$f ]] && existing_files="$existing_files ${MNT}$f"
|
||||
for f in $(echo "${FILES[$SELECTED]}"); do
|
||||
[[ -e ${MNT}$f ]] && existing_files+=" ${MNT}$f"
|
||||
done
|
||||
|
||||
if [[ $existing_files ]]; then
|
||||
vim -O $existing_files
|
||||
else
|
||||
msgbox "$_ErrTitle" "$_NoFileErr"
|
||||
fi
|
||||
[[ ! $existing_files ]] && msgbox "$_ErrTitle" "$_NoFileErr" || vim -O $existing_files
|
||||
fi
|
||||
|
||||
edit_configs
|
||||
}
|
||||
|
||||
main() {
|
||||
if [[ $CURRENT_MENU != "main" ]]; then
|
||||
MENU_HIGHLIGHT=1
|
||||
SELECTED=1
|
||||
CURRENT_MENU="main"
|
||||
elif (( MENU_HIGHLIGHT < 8 )); then
|
||||
((MENU_HIGHLIGHT++)) # increment the highlighted menu item
|
||||
elif (( SELECTED < 8 )); then
|
||||
((SELECTED++)) # increment the highlighted menu item
|
||||
fi
|
||||
|
||||
tput civis
|
||||
MENU_HIGHLIGHT=$(dialog --cr-wrap --stdout --backtitle "$BT" \
|
||||
--title " $_PrepTitle " --default-item $MENU_HIGHLIGHT --menu "$_PrepBody" 0 0 0 \
|
||||
SELECTED=$(dialog --cr-wrap --stdout --backtitle "$BT" \
|
||||
--title " $_PrepTitle " --default-item $SELECTED --menu "$_PrepBody" 0 0 0 \
|
||||
"1" "$_PrepShowDev" "2" "$_PrepParts" "3" "$_PrepLUKS" "4" "$_PrepLVM" \
|
||||
"5" "$_PrepMount" "6" "$_PrepConfig" "7" "Check Choices" "8" "$_PrepInstall" \
|
||||
"9" "$_Done")
|
||||
|
||||
# if trying to install the system, make sure the partitions are mounted
|
||||
# and that the needed config variables and user variables have been set up
|
||||
if [[ $MENU_HIGHLIGHT && $MENU_HIGHLIGHT -eq 8 ]]; then
|
||||
check_install_ready || return 1
|
||||
if [[ $SELECTED ]]; then
|
||||
if [[ $SELECTED -eq 8 ]]; then
|
||||
check_install_ready || return 1
|
||||
elif [[ ($SELECTED -eq 2 || $SELECTED -eq 5) && $WARN != true ]]; then
|
||||
msgbox "$_PrepTitle" "$_WarnMount"
|
||||
WARN=true
|
||||
fi
|
||||
fi
|
||||
|
||||
case $MENU_HIGHLIGHT in
|
||||
case $SELECTED in
|
||||
1) show_devices ;;
|
||||
2) edit_partitions ;;
|
||||
3) luks_menu || MENU_HIGHLIGHT=1 ;;
|
||||
4) lvm_menu || MENU_HIGHLIGHT=1 ;;
|
||||
5) mount_main || MENU_HIGHLIGHT=1 ;;
|
||||
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 ;;
|
||||
@ -620,7 +614,7 @@ main() {
|
||||
init_variables
|
||||
|
||||
for file in /usr/share/archlabs/installer/lib/?*.sh; do
|
||||
source_file $file
|
||||
source_file "$file"
|
||||
done
|
||||
|
||||
# trap Ctrl-C to properly exit
|
||||
|
Reference in New Issue
Block a user