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