You've already forked al-installer
Combine mount and partition lib files, and other minor changes
This commit is contained in:
@ -12,13 +12,14 @@
|
||||
# immutable variables {
|
||||
|
||||
readonly DIST="ArchLabs" # Linux distributor
|
||||
readonly VER="1.6.64" # Installer version
|
||||
readonly VER="1.6.67" # 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 LIB="/usr/share/archlabs/installer/lib"
|
||||
readonly TRN="/usr/share/archlabs/installer/lang"
|
||||
readonly RUN="/run/archiso/bootmnt/arch/boot"
|
||||
|
||||
readonly VM="$(dmesg | grep -i "hypervisor")"
|
||||
readonly KBD="$(find /usr/share/kbd/keymaps -name '*.map.gz')"
|
||||
@ -37,9 +38,9 @@ fi
|
||||
readonly DEV_COUNT="$(wc -l <<< "$SYS_DEVS")"
|
||||
|
||||
if [[ $(grep 'GenuineIntel' /proc/cpuinfo) ]]; then
|
||||
readonly UCODE="/intel-ucode.img"
|
||||
readonly UCODE="intel-ucode.img"
|
||||
elif [[ $(grep 'AuthenticAMD' /proc/cpuinfo) ]]; then
|
||||
readonly UCODE="/amd-ucode.img"
|
||||
readonly UCODE="amd-ucode.img"
|
||||
fi
|
||||
|
||||
# create associative array for SUBZONES[zone], value is: 'sub-zone country_code'
|
||||
@ -211,7 +212,7 @@ select_language() {
|
||||
"9" "Magyar (hu_HU)" "10" "Chinese (zh_CN)")
|
||||
|
||||
source_file $TRN/english.trans
|
||||
declare -g FONT="ter-i18n"
|
||||
declare -g FONT="ter-i16n"
|
||||
|
||||
case $lang in
|
||||
1) LOC="en_US.UTF-8" ;;
|
||||
@ -219,7 +220,7 @@ select_language() {
|
||||
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-14" ;;
|
||||
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" ;;
|
||||
@ -241,14 +242,14 @@ select_language() {
|
||||
setup_keymap() {
|
||||
tput civis
|
||||
declare -g KEYMAP
|
||||
KEYMAP="$(dialog --cr-wrap --stdout --no-cancel --backtitle "$BT" \
|
||||
KEYMAP="$(dialog --cr-wrap --stdout --backtitle "$BT" \
|
||||
--title " $_PrepLayout " --menu "$_XMapBody" 20 70 12 $KEYMAPS)"
|
||||
[[ $? != 0 || $KEYMAP == "" ]] && return 1
|
||||
|
||||
# when a matching console map is not available open a selection dialog
|
||||
if ! [[ $CONSOLE_MAPS =~ "$KEYMAP -" ]]; then
|
||||
tput civis
|
||||
CONSOLE_MAP="$(dialog --cr-wrap --stdout --no-cancel --backtitle "$BT" \
|
||||
CONSOLE_MAP="$(dialog --cr-wrap --stdout --backtitle "$BT" \
|
||||
--title " $_CMapTitle " --menu "$_CMapBody" 20 70 12 $CONSOLE_MAPS)"
|
||||
[[ $? != 0 || $CONSOLE_MAP == "" ]] && return 1
|
||||
else
|
||||
@ -266,18 +267,21 @@ setup_keymap() {
|
||||
setup_timezone() {
|
||||
tput civis
|
||||
declare -g ZONE
|
||||
ZONE="$(dialog --cr-wrap --stdout --no-cancel --backtitle "$BT" \
|
||||
ZONE="$(dialog --cr-wrap --stdout --backtitle "$BT" \
|
||||
--title " $_TimeZTitle " --menu "$_TimeZBody" 20 70 10 America - Australia - \
|
||||
Asia - Atlantic - Africa - Europe - Indian - Pacific - Arctic - Antarctica -)"
|
||||
[[ $? != 0 || $ZONE == "" ]] && return 1
|
||||
|
||||
declare -g SUBZONE
|
||||
SUBZONE="$(dialog --cr-wrap --stdout --no-cancel --backtitle "$BT" \
|
||||
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 || setup_timezone
|
||||
}
|
||||
|
||||
window_manager() {
|
||||
INSTALL_WMS="$(dialog --cr-wrap --stdout --backtitle "$BT" --no-cancel \
|
||||
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 \
|
||||
@ -286,6 +290,7 @@ window_manager() {
|
||||
"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)"
|
||||
[[ $? != 0 || $INSTALL_WMS == "" ]] && return 1
|
||||
WM_NUM=$(awk '{print NF}' <<< "$INSTALL_WMS")
|
||||
|
||||
# packages needed for the selected window manager
|
||||
@ -344,8 +349,8 @@ window_manager() {
|
||||
|
||||
extra_packages() {
|
||||
local pkgs
|
||||
pkgs="$(dialog --cr-wrap --stdout --no-cancel --backtitle "$BT" \
|
||||
--title " $_WMChoice " --checklist "$_WMChoiceBody\n" 0 0 25 \
|
||||
pkgs="$(dialog --cr-wrap --stdout --backtitle "$BT" \
|
||||
--title " $_WMChoice " --checklist "$_WMChoiceBody\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 \
|
||||
@ -394,7 +399,7 @@ extra_packages() {
|
||||
"evince" "A document viewer" off \
|
||||
"zathura" "Minimalistic document viewer" off \
|
||||
"qpdfview" "A tabbed PDF viewer" off \
|
||||
"mupdf mupdf-tools" "Lightweight PDF and XPS 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 \
|
||||
@ -419,12 +424,17 @@ extra_packages() {
|
||||
"noto-fonts-cjk" "Google Noto CJK fonts (Chinese, Japanese, Korean)" off)"
|
||||
[[ $pkgs =~ vlc ]] && pkgs="$pkgs qt4"
|
||||
[[ $pkgs =~ mpd ]] && pkgs="$pkgs mpc"
|
||||
[[ $pkgs =~ mpd ]] && pkgs="$pkgs zathura-pdf-poppler"
|
||||
[[ $pkgs =~ mupdf ]] && pkgs="$pkgs mupdf-tools"
|
||||
[[ $pkgs =~ qt5ct ]] && pkgs="$pkgs qt5-styleplugins"
|
||||
[[ $pkgs =~ cairo-dock ]] && pkgs="$pkgs cairo-dock-plug-ins"
|
||||
[[ $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"
|
||||
EXTRA_PACKAGES="$pkgs $EXTRA_PACKAGES"
|
||||
if [[ $pkgs =~ (qutebrowser|qbittorrent|kdenlive|vlc) ]] && ! [[ $pkgs =~ qt5ct ]]; then
|
||||
pkgs="$pkgs qt5ct qt5-styleplugins"
|
||||
fi
|
||||
|
||||
EXTRA_PACKAGES="$EXTRA_PACKAGES$([[ $pkgs ]] && echo -n " $pkgs")"
|
||||
return 0
|
||||
}
|
||||
|
||||
@ -506,7 +516,7 @@ configure_install() {
|
||||
|
||||
tput civis
|
||||
declare -g LOCALE
|
||||
LOCALE="$(dialog --cr-wrap --stdout --no-cancel --backtitle "$BT" \
|
||||
LOCALE="$(dialog --cr-wrap --stdout --backtitle "$BT" \
|
||||
--title " $_ConfLocale " --menu "$_LocaleBody" 25 70 20 $LOCALES)"
|
||||
[[ $? != 0 || $LOCALE == "" ]] && return 1
|
||||
|
||||
@ -521,7 +531,7 @@ configure_install() {
|
||||
KERNEL='linux-lts'
|
||||
fi
|
||||
|
||||
extra_packages
|
||||
extra_packages || return 1
|
||||
CONFIG_DONE=true
|
||||
return 0
|
||||
}
|
||||
@ -544,7 +554,6 @@ edit_configs() {
|
||||
wrap_up "$_InstFinBody" 'Exit & Reboot' 'Go Back' 'reboot'
|
||||
else
|
||||
local existing_files=""
|
||||
|
||||
for f in $(echo "${FILES[$MENU_HIGHLIGHT]}"); do
|
||||
[[ -e ${MNT}$f ]] && existing_files="$existing_files ${MNT}$f"
|
||||
done
|
||||
@ -581,9 +590,7 @@ main() {
|
||||
# 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
|
||||
local retval=$?
|
||||
[[ $retval -gt 0 ]] && { MENU_HIGHLIGHT=$retval; return 1; }
|
||||
check_install_ready || return 1
|
||||
fi
|
||||
|
||||
case $MENU_HIGHLIGHT in
|
||||
@ -599,7 +606,7 @@ main() {
|
||||
esac
|
||||
}
|
||||
|
||||
for file in utils mount partition bootloader lvm luks install; do
|
||||
for file in utils mount boot lvm luks install; do
|
||||
source_file $LIB/$file.sh
|
||||
done
|
||||
|
||||
|
Reference in New Issue
Block a user