added ssd check in disk selection

This commit is contained in:
farhan 2022-03-05 14:06:39 +00:00
parent 8fb6610ee9
commit 38ec740df8
1 changed files with 7 additions and 20 deletions

View File

@ -208,23 +208,6 @@ echo -ne "Your key boards layout: ${keymap} \n"
set_option KEYMAP $keymap
}
drivessd () {
echo -ne "
Is this an ssd? yes/no:
"
options=("Yes" "No")
select_option $? 1 "${options[@]}"
case ${options[$?]} in
y|Y|yes|Yes|YES)
set_option MOUNT_OPTIONS "noatime,compress=zstd,ssd,commit=120";;
n|N|no|NO|No)
set_option MOUNT_OPTIONS "noatime,compress=zstd,commit=120";;
*) echo "Wrong option. Try again";drivessd;;
esac
}
# selection for disk type
diskpart () {
echo -ne "
@ -238,15 +221,19 @@ echo -ne "
PS3='
Select the disk to install on: '
options=($(lsblk -n --output TYPE,KNAME,SIZE | awk '$1=="disk"{print "/dev/"$2"|"$3}'))
options=("$(lsblk -n --output TYPE,KNAME,SIZE | awk '$1=="disk"{print "/dev/"$2"|"$3}')")
select_option $? 1 "${options[@]}"
disk=${options[$?]%|*}
echo -e "\n${disk%|*} selected \n"
set_option DISK ${disk%|*}
set_option DISK "${disk%|*}"
if [[ "$(lsblk -n --output TYPE,ROTA | awk '$1=="disk"{print $2}')" -eq "0" ]]; then
set_option "MOUNT_OPTION" "noatime,compress=zstd,ssd,commit=120"
else
set_option "MOUNT_OPTION" "noatime,compress=zstd,commit=120"
fi
drivessd
}
userinfo () {
read -p "Please enter your username: " username