summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbill-auger <mr.j.spam.me@gmail.com>2020-03-29 15:25:39 -0400
committerbill-auger <mr.j.spam.me@gmail.com>2020-03-29 15:42:08 -0400
commitb8742a9e1421a2dfde92806a72caba8485b79a47 (patch)
tree448f748fae5f798018556fb39511cd9f81a8591b
parent67e410b30cf706b14fd905ef181ffe0a8e5d34be (diff)
wip - consolidate install wizardsunified
-rw-r--r--configs/profile/root-image/root/.common.sh.inc47
-rwxr-xr-xconfigs/profile/root-image/root/.install/install.sh38
-rw-r--r--configs/profile/root-image/root/.install/partition.sh4
-rwxr-xr-xconfigs/profile/root-image/root/.install/system.sh10
4 files changed, 62 insertions, 37 deletions
diff --git a/configs/profile/root-image/root/.common.sh.inc b/configs/profile/root-image/root/.common.sh.inc
index 0d2b3c9..93708c6 100644
--- a/configs/profile/root-image/root/.common.sh.inc
+++ b/configs/profile/root-image/root/.common.sh.inc
@@ -2,12 +2,7 @@ readonly STATE_FILE=/root/.session_state
readonly COMMON_FILE=/root/.common.sh.inc
-GetStateVar() # (var_name)
-{
- local var_name=$1
-
- echo $(grep "${var_name}=" ${STATE_FILE} | cut -d '=' -f 2)
-}
+## state helpers ##
SetStateVar() # (var_name value*)
{
@@ -18,6 +13,13 @@ SetStateVar() # (var_name value*)
echo "${var_name}=${value}" >> ${STATE_FILE}
}
+GetStateVar() # (var_name)
+{
+ local var_name=$1
+
+ echo $(grep "${var_name}=" ${STATE_FILE} | cut -d '=' -f 2)
+}
+
## translations for user-facing strings ##
@@ -40,31 +42,46 @@ declare -A TR=(
[menu_base-gl]="Instalar Sistema Base"
[menu_base-pt]="Instalar o Sistema Base"
- [menu_grub-en]="(Optional) Install GRUB"
- [menu_grub-es]="(Opcional) Instalar GRUB"
- [menu_grub-gl]="(Opcional) Instalar GRUB"
- [menu_grub-pt]="(Opcional) Instalar o GRUB"
-
[menu_config-en]="Configure System"
[menu_config-es]="Configuración del Sistema"
[menu_config-gl]="Configuración do Sistema"
[menu_config-pt]="Configuração do Sistema"
- [menu_user-en]="(Optional) Create User Account"
- [menu_user-es]="(Opcional) Crear Cuenta de Usuario"
- [menu_user-gl]="(Opcional) Crear Conta de Usuario"
- [menu_user-pt]="(Opcional) Adicionar uma Conta de Usuário"
+ [menu_grub-en]="(Optional) Install GRUB"
+ [menu_grub-es]="(Opcional) Instalar GRUB"
+ [menu_grub-gl]="(Opcional) Instalar GRUB"
+ [menu_grub-pt]="(Opcional) Instalar o GRUB"
[menu_wmde-en]="(Optional) Install Parabola Desktop"
[menu_wmde-es]="(Opcional) Instalar Parabola Escritorio"
[menu_wmde-gl]="(Opcional) Instalar Parabola Escritorio"
[menu_wmde-pt]="(Opcional) Instalar Parabola Ambiente Gráfico"
+ [menu_user-en]="(Optional) Create User Account"
+ [menu_user-es]="(Opcional) Crear Cuenta de Usuario"
+ [menu_user-gl]="(Opcional) Crear Conta de Usuario"
+ [menu_user-pt]="(Opcional) Adicionar uma Conta de Usuário"
+
[menu_exit-en]="Exit"
[menu_exit-es]="Salir"
[menu_exit-gl]="Salir"
[menu_exit-pt]="Sair"
+ [base-en]="Select a base system:"
+ [base-es]="Selecciona la base sistema:"
+ [base-gl]="Selecciona a base sistema:"
+ [base-pt]="Escolha a base sistema:"
+
+ [base_mini-en]="Bare-bones minimal system"
+ [base_mini-es]=""
+ [base_mini-gl]=""
+ [base_mini-pt]=""
+
+ [base_posix-en]="Complete POSIX-compliant system"
+ [base_posix-es]=""
+ [base_posix-gl]=""
+ [base_posix-pt]=""
+
[init-en]="Select an init-system:"
[init-es]="Selecciona la init-system:"
[init-gl]="Selecciona a init-system:"
diff --git a/configs/profile/root-image/root/.install/install.sh b/configs/profile/root-image/root/.install/install.sh
index 83d47cb..ac0f9fb 100755
--- a/configs/profile/root-image/root/.install/install.sh
+++ b/configs/profile/root-image/root/.install/install.sh
@@ -19,10 +19,10 @@ while [[ option != 7 ]]
do option=$(dialog --stdout --menu "${TR[menu-${LANG_KEY}]}" 20 70 50 \
1 "${TR[menu_format-${LANG_KEY}]}" \
2 "${TR[menu_base-${LANG_KEY}]}" \
- 3 "${TR[menu_grub-${LANG_KEY}]}" \
- 4 "${TR[menu_config-${LANG_KEY}]}" \
- 5 "${TR[menu_user-${LANG_KEY}]}" \
- 6 "${TR[menu_wmde-${LANG_KEY}]}" \
+ 3 "${TR[menu_config-${LANG_KEY}]}" \
+ 4 "${TR[menu_grub-${LANG_KEY}]}" \
+ 5 "${TR[menu_wmde-${LANG_KEY}]}" \
+ 6 "${TR[menu_user-${LANG_KEY}]}" \
7 "${TR[menu_exit-${LANG_KEY}]}" )
case $option in
@@ -30,11 +30,20 @@ do option=$(dialog --stdout --menu "${TR[menu-${LANG_KEY}]}" 20 70 50 \
/root/.install/partition.sh
;;
2) #Install base system
+
+ # prompt for base package set
+ base=$(dialog --stdout --radiolist "${TR[base-${LANG_KEY}]}" 20 70 50 \
+ 'mini' "${TR[base_mini-${LANG_KEY}]}" 'off' \
+ 'posix' "${TR[base_posix-${LANG_KEY}]}" 'on' )
+ extra_packages=( $( [[ "${base}" == 'posix' ]] && echo 'parabola-base' ) )
+
+ # prompt for init-system
init=$(dialog --stdout --radiolist "${TR[init-${LANG_KEY}]}" 20 70 50 \
'openrc' "${TR[init_openrc-${LANG_KEY}]}" 'off' \
'systemd' "${TR[init_systemd-${LANG_KEY}]}" 'on' )
SetStateVar 'INIT' ${init}
+ # prompt for local vs remote package repos if possible
conf_regex=$( [[ "${init}" == 'openrc' ]] && echo "$PACCONF_NONSYSTEMD_REGEX" || \
echo "$PACCONF_SYSTEMD_REGEX" )
fallback=$( [[ -d /isorepo ]] && echo 'offline' || echo 'online' )
@@ -46,16 +55,9 @@ do option=$(dialog --stdout --menu "${TR[menu-${LANG_KEY}]}" 20 70 50 \
sed -i "$conf_regex" /etc/pacman-${install}.conf
cp /etc/pacman-${install}.conf /etc/pacman.conf
- pacstrap /mnt base
+ pacstrap /mnt base dialog ${extra_packages[@]}
;;
3)
- #Install grub
- pacstrap /mnt grub grub2-theme-gnuaxiom
- #Enable Parabola theme for grub
-
- sed -i "$GRUB_THEME_SED_CMD" /mnt/etc/default/grub
- ;;
- 4)
#Generate fstab and access to chroot to do System Config
genfstab -p /mnt >> /mnt/etc/fstab
cp ${STATE_FILE} /mnt/root/
@@ -65,6 +67,13 @@ do option=$(dialog --stdout --menu "${TR[menu-${LANG_KEY}]}" 20 70 50 \
arch-chroot /mnt /root/system.sh
rm /mnt/root/system.sh
;;
+ 4)
+ #Install grub
+ pacstrap /mnt grub grub2-theme-gnuaxiom
+
+ #Enable Parabola theme for grub
+ sed -i "$GRUB_THEME_SED_CMD" /mnt/etc/default/grub
+ ;;
5)
#Packages to the X11 live
wmde=$(dialog --stdout --radiolist "${TR[wmde-${LANG_KEY}]}" 20 70 50 \
@@ -72,11 +81,10 @@ do option=$(dialog --stdout --menu "${TR[menu-${LANG_KEY}]}" 20 70 50 \
'lxde' "${TR[wmde_lxde-${LANG_KEY}]}" 'on' \
'mate' "${TR[wmde_mate-${LANG_KEY}]}" 'off' )
SetStateVar 'WMDE' ${wmde}
-
- packages=( $( cat ./packages ) )
+ [[ "${wmde}" == 'cli' ]] && break
#Install packages
- pacstrap /mnt ${packages[@]}
+ pacstrap /mnt parabola-desktop-${wmde}
#Enable services
cp ${STATE_FILE} /mnt/root/
diff --git a/configs/profile/root-image/root/.install/partition.sh b/configs/profile/root-image/root/.install/partition.sh
index 7ab3ab0..fec7cc6 100644
--- a/configs/profile/root-image/root/.install/partition.sh
+++ b/configs/profile/root-image/root/.install/partition.sh
@@ -5,7 +5,7 @@ source /root/.common.sh.inc
umount /mnt &> /dev/null
-# prompt disk device
+# prompt for disk device
hd_devices=$(ls /dev/sd?)
hdds=()
for hd_device in ${hd_devices}
@@ -14,7 +14,7 @@ done
hdd=$(dialog --stdout --radiolist "${TR[hdd-${LANG_KEY}]}" 20 70 50 ${hdds[@]})
SetStateVar 'HDD' $hdd
-# prompt partitioner
+# prompt for partitioner
part_method=$(dialog --stdout --menu "${TR[part-${LANG_KEY}]}" 20 70 50 \
1 "${TR[part_auto-${LANG_KEY}]}" \
2 "${TR[part_man-${LANG_KEY}]}" )
diff --git a/configs/profile/root-image/root/.install/system.sh b/configs/profile/root-image/root/.install/system.sh
index 9b38059..b94f051 100755
--- a/configs/profile/root-image/root/.install/system.sh
+++ b/configs/profile/root-image/root/.install/system.sh
@@ -3,15 +3,15 @@
source /root/.common.sh.inc
-# prompt hostname
+# prompt for hostname
hostname=$(dialog --stdout --inputbox "${TR[hostname-${LANG_KEY}]}" 8 40)
echo ${hostname} > /etc/hostname
-# prompt timezone
+# prompt for timezone
timezone=$(dialog --stdout --inputbox "${TR[timezone-${LANG_KEY}]}" 8 40)
ln -s /usr/share/zoneinfo/${timezone} /etc/localtime
-# prompt keymap
+# prompt for keymap
# FIXME:
live_keymap=$( [[ "$(GetStateVar 'XKBMAP')" ]] && echo $(GetStateVar 'XKBMAP') || echo 'us' )
keymaps=()
@@ -22,7 +22,7 @@ done
keymap=$(dialog --stdout --radiolist "${TR[keymap-${LANG_KEY}]}" 20 70 50 "${keymaps[@]}")
echo "KEYMAP=${keymap}" > /etc/vconsole.conf
-# prompt locale
+# prompt for locale
all_locales=$( sed -e '1,23d' -e 's/#//g' -e 's/ /#/g' -e 's/..$//' /etc/locale.gen )
live_locale=$( [[ "$(GetStateVar 'LANG')" ]] && echo $(GetStateVar 'LANG') || echo 'en_US' )
locales=()
@@ -39,7 +39,7 @@ do locale=$(echo ${locale} | sed -e 's/#/ /g')
done
locale-gen
-# prompt language
+# prompt for language
live_language=$( [[ "$(GetStateVar 'LANG')" ]] && echo $(GetStateVar 'LANG') || echo 'en_US.UTF-8' )
language=()
while read language