1
0
mirror of https://gitlab.com/JKANetwork/JKArch.git synced 2026-02-16 10:11:32 +01:00

More dialog, less black screen

This commit is contained in:
kprkpr
2016-09-25 18:36:42 +02:00
parent 5d7efa885b
commit 64e78f14f1
2 changed files with 26 additions and 418 deletions

View File

@@ -127,20 +127,17 @@ if [[ ! $optpa -eq 3 ]];then
tput setaf 6 ; echo "$(T "Your partition scheme")" ; tput setaf 9
lsblk --output NAME,KNAME,FSTYPE,SIZE,LABEL
tput setaf 6 ; echo "Selecciona disco duro a utilizar para seleccionar las particiones" ; tput setaf 9
options=($(lsblk --output KNAME | cut -c1-3 | sort | uniq | sed '1d' | grep 'sd\|hd'))
select opt in "${options[@]}"
tput setaf 6 ; echo "$(T "I recommend to take notes before continue. Next, you will have the questions about it")" ; tput setaf 9
pause
harddisks=$(lsblk --output KNAME | cut -c1-3 | sort | uniq | sed '1d' | grep 'sd\|hd')
i=3
for addr in $(echo $harddisks | tr " " "\n")
do
case $opt in
*)
if [[ -z $opt ]];then
echo "$(T "Not valid")"
else
hd=$opt
break
fi;;
esac
varx+=" $addr '- $(lsblk --output SIZE /dev/$addr | sed '1d' | head -1)'"
done
varf="dialog --stdout --nocancel --menu \"Selecciona disco duro a utilizar para seleccionar las particiones\" 0 0 5 $varx"
hd=`bash -c "$varf"`
#Detectar tipo de tabla de particiones (gpt o msdos) y si es gpt, preparar para UEFI
tabletype="$(parted /dev/${hd} p | grep "Partition Table" | awk '1 {print $3}')"
@@ -149,23 +146,18 @@ if [[ ! $optpa -eq 3 ]];then
mostrardialog "$(T "GPT Partition Table")" "$(T "You are using GPT, you will have to select EFI")"
fi
clear
tput setaf 6 ; echo "$(T "Your partition scheme")" ; tput setaf 9
lsblk --output NAME,KNAME,FSTYPE,SIZE,LABEL
tput setaf 6 ; echo "$(T "Select root ('/') partition")" ; tput setaf 9
options=($(lsblk --output KNAME | sed '1d' | grep ${hd} | grep '[1-9]$'))
select opt in "${options[@]}"
variable=$(lsblk --output KNAME /dev/${hd} | cut -c1-4 | tail -n +3)
i=3
varx=""
for addr in $(echo $variable | tr " " "\n")
do
case $opt in
*)
if [[ -z $opt ]];then
echo "$(T "Not valid")"
else
particionraiz=$opt
break
fi;;
esac
varx+=" $addr '$(lsblk --output KNAME,FSTYPE,SIZE,LABEL /dev/${hd} | tail -n +$i | head -1)'"
i=$((i+1))
done
varf="dialog --stdout --nocancel --menu \"Selecciona la particion raiz(/)\" 0 0 5 $varx"
particionraiz=`bash -c "$varf"`
optfr=`dialog --stdout --nocancel --menu "Formato para la particion raiz(/)" 0 0 4 1 "EXT4 (Recomendado)" 2 "BTRFS" 3 "XFS" 4 "No formatear (Si ya esta formateada)"`
case $optfr in
1) formatoraiz="mkfs.ext4 -F";;
@@ -180,23 +172,16 @@ if [[ ! $optpa -eq 3 ]];then
case $opthpart in
2)
#Selección de home
lsblk --output NAME,KNAME,FSTYPE,SIZE,LABEL
tput setaf 6 ; echo "$(T "Select home partition")" ; tput setaf 9
options=($(lsblk --output KNAME | sed '1d' | grep ${hd} | grep '[1-9]$') "$(T "Not select")")
select opt in "${options[@]}"
variable=$(lsblk --output KNAME /dev/${hd} | cut -c1-4 | tail -n +3)
i=3
varx=""
for addr in $(echo $variable | tr " " "\n")
do
case $opt in
"$(T "Not select")")
break;;
*)
if [[ -z $opt ]];then
echo "$(T "Not valid")"
else
particionhome=$opt
break
fi;;
esac
varx+=" $addr '$(lsblk --output KNAME,FSTYPE,SIZE,LABEL /dev/${hd} | tail -n +$i | head -1)'"
i=$((i+1))
done
varf="dialog --stdout --nocancel --menu \"Selecctiona la particion home (/home)\" 0 0 5 $varx"
particionhome=`bash -c "$varf"`
if [[ $particionhome ]];then
optfh=`dialog --stdout --nocancel --menu "Formato para la particion home (/home)" 0 0 4 1 "EXT4 (Recomendado)" 2 "BTRFS" 3 "XFS" 4 "No formatear (Si ya esta formateada)"`