# Parabola Install Wizard - common constants # # Copyright (C) 2020,2022 bill-auger # # SPDX-License-Identifier: GPL-3.0-or-later # # This file is part of Parabola Install Wizard. # # Parabola Install Wizard is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Parabola Install Wizard is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Parabola Install Wizard. If not, see . # config readonly SWAP_MB=1000 # defaults readonly DEF_KEYMAP='us' readonly DEF_LANG='en_US.UTF-8' readonly DEF_TRKEY='en' readonly DEF_INSTALL='offline' readonly DEF_PKG_SET='standard' readonly DEF_INIT='systemd' readonly DEF_WMDE='cli' readonly DEF_HOSTNAME='parabola' readonly DEF_TIMEZONE='UTC' # per-stage state vars readonly STATEVARS_LOGINS=( 'ROOT_PASS' 'USER_LOGIN' 'USER_PASS' ) readonly STATEVARS_BASE=( 'INSTALL' 'BASE' 'INIT' ) readonly STATEVARS_BOOT=( 'BOOT' ) readonly STATEVARS_DEFAUILTS=( 'INSTALL' 'BASE' 'INIT' \ 'WMDE' \ 'LANG' 'HOSTNAME' 'TIMEZONE' 'KEYMAP' 'LOCALES' \ 'XKBMAP' 'LANG' ) readonly STATEVARS_WMDE=( 'WMDE' ) readonly STATEVARS_ENV=( 'LANG' 'HOSTNAME' 'TIMEZONE' 'KEYMAP' 'LOCALES' ) readonly STATEVARS_PARTITION=( 'DEVICE_N' 'DEVICE' 'PART_METHOD' ) readonly STATEVARS_READY=( 'ROOT_PART' 'BOOT_PART' 'HOME_PART' ) readonly STATEVARS_CHROOTENV=( 'LANG' 'HOSTNAME' 'TIMEZONE' 'KEYMAP' 'LOCALES' \ 'BOOT' 'WMDE' 'DEVICE' ) readonly STATEVARS_CHROOTLOGIN=( 'ROOT_PASS' 'USER_LOGIN' 'USER_PASS' 'XKBMAP' 'WMDE' ) readonly STATEVARS_CHROOTSERVICES=( 'INIT' 'WMDE' ) STATEVARS_PRESET=( ${STATEVARS_LOGINS[*]} \ ${STATEVARS_BASE[*]} \ ${STATEVARS_BOOT[*]} \ ${STATEVARS_WMDE[*]} \ ${STATEVARS_ENV[*]} \ ${STATEVARS_PARTITION[*]} \ ${STATEVARS_READY[*]} \ ${STATEVARS_CHROOTENV[*]} \ ${STATEVARS_CHROOTLOGIN[*]} \ ${STATEVARS_CHROOTSERVICES[*]} ) readarray -td '' STATEVARS_PRESET < <( sort -zu < <(printf "%s\0" "${STATEVARS_PRESET[@]}") ) readonly STATEVARS_PRESET # sanity checks readonly IN_CHROOT=$( main_script="${BASH_SOURCE[$(( ${#BASH_SOURCE[@]} - 1 ))]}" \ [[ "${main_script}" =~ ^/root/chroot-.*\.sh$ ]] ; echo $((!$?)) ) readonly DIALOG_ERR_MSG="ERROR: can not find the \`dialog\` program" readonly PRIVILEGE_ERR_MSG="ERROR: this program requires superuser privilege" readonly STATEFILE_ERR_MSG="ERROR: can not write to state file" # install.sh declare -r -A KEYRINGS=( [armv7l]='archlinux-keyring parabola-keyring archlinuxarm-keyring' \ [i686]=' archlinux-keyring parabola-keyring archlinux32-keyring' \ [x86_64]='archlinux-keyring parabola-keyring' ) declare -r -A BASE_PACKAGES=( [base]='base' \ [standard]='base parabola-base' ) declare -r -A BOOT_PACKAGES=( [grub]='grub grub2-theme-gnuaxiom mkinitcpio-openswap' ) declare -r -A GUI_PACKAGES=( [lxde]='parabola-desktop-lxde' \ [mate]='parabola-desktop-mate' ) # TODO: parabola-desktop NYI readonly PACCONF_NONSYSTEMD_REGEX='s|^_NONSYSTEMD_$|[nonsystemd]\nInclude = /etc/pacman.d/mirrorlist\n|' readonly PACCONF_SYSTEMD_REGEX='s|^_NONSYSTEMD_$|#[nonsystemd]\n#Include = /etc/pacman.d/mirrorlist\n|' readonly ONLINE_CHECK_URL=https://repo.parabola.nu/check_network_status.txt readonly CURL_CMD=(curl --silent --write-out '%{http_code}' ${ONLINE_CHECK_URL} -o /dev/null) # chroot-env.sh readonly GRUB_THEME_SED_RX="s|^#GRUB_THEME=.*|GRUB_THEME=/boot/grub/themes/_THEME_DIR_/theme.txt|" # chroot-login.sh readonly WHEEL_SUDOERS_SED_RX='s|[#] [%]wheel ALL=[(]ALL[)] ALL|%wheel ALL=(ALL) ALL|'