Fix issue with deleting lvm

This commit is contained in:
natemaia 2018-07-28 00:25:31 -07:00
parent a1115047cb
commit c3f51d420b

View File

@ -15,7 +15,7 @@
# immutable variables {
readonly DIST="Archlabs" # Linux distributor
readonly VER="1.6.8" # Installer version
readonly VER="1.6.9" # Installer version
readonly LIVE="liveuser" # Live session user name
readonly TRN="/installer" # Translation path
readonly MNT="/mnt/install" # Install mountpoint
@ -1381,22 +1381,22 @@ lvm_detect() {
}
lvm_show_vg() {
DEL_VG=""
VOL_GROUP_LIST=""
for i in $(lvs --noheadings | awk '{print $2}' | uniq); do
VOL_GROUP_LIST="$VOL_GROUP_LIST $i $(vgdisplay "$i" | awk '/VG Size/ {print $3$4}')"
done
if [[ -z $VOL_GROUP_LIST ]]; then
if [[ $VOL_GROUP_LIST == "" ]]; then
msgbox "$_ErrTitle" "$_LvmVGErr"
return 1
fi
tput civis
choice="$(dialog --cr-wrap --stdout --backtitle "$BT" \
DEL_VG="$(dialog --cr-wrap --stdout --backtitle "$BT" \
--title " $_PrepLVM " --menu "$_LvmSelVGBody" 18 70 10 $VOL_GROUP_LIST)"
[[ $? != 0 || $choice == "" ]] && return 1
echo -n "$choice"
[[ $? != 0 || $DEL_VG == "" ]] && return 1
}
get_lv_size() {
@ -1541,7 +1541,7 @@ lvm_create() {
# get volume group name then confirm or bail out
lvm_group_name || return 1
yesno "$_LvmCreateVG" "$_LvmPvConfBody1 $VOLUME_GROUP\n$_LvmPvConfBody2 $VOL_GROUP_PARTS" || return 1
yesno "$_LvmCreateVG" "$_LvmPvConfBody1 $VOLUME_GROUP\n\n$_LvmPvConfBody2 $VOL_GROUP_PARTS\n" || return 1
# create it
infobox "$_LvmCreateVG" "$_LvmPvActBody1 $VOLUME_GROUP\n"
@ -1583,9 +1583,9 @@ lvm_create() {
}
lvm_del_vg() {
local choice
choice="$(lvm_show_vg)"
yesno "$_LvmDelVG" "$_LvmDelQ" && vgremove -f "$choice" >/dev/null 2>&1
if lvm_show_vg; then
yesno "$_LvmDelVG" "$_LvmDelQ" && vgremove -f "$DEL_VG" >/dev/null 2>&1
fi
return 0
}