Add device label info to partition menus

This commit is contained in:
natemaia 2020-03-07 16:24:38 -08:00
parent b2a3db3cfd
commit 3455c4bfe9

View File

@ -5,7 +5,7 @@
# Some ideas and code reworked from other resources # Some ideas and code reworked from other resources
# AIF, Calamares, and the Arch Wiki.. Credit where credit is due # AIF, Calamares, and the Arch Wiki.. Credit where credit is due
VER=2.1.20 VER=2.1.21
# default values { # default values {
@ -716,11 +716,11 @@ part_find()
fi fi
(( COUNT++ )) (( COUNT++ ))
fi fi
done < <(lsblk -lno TYPE,NAME,SIZE,FSTYPE | done < <(lsblk -lno TYPE,PATH,SIZE,FSTYPE,LABEL |
awk "/$regexp/"' && !'"/${IGNORE_DEV:-NONEXX}/"' { awk "/$regexp/"' && !'"/${IGNORE_DEV:-NONEXX}/"' {
sub(/^part/, "/dev/") if ($4 == "") { $4 = "unformatted" }
sub(/^lvm|^crypt/, "/dev/mapper/") if ($5 == "") { $5 = "unlabeled" }
print $1$2, $3"__"$4 print $2, $3 "__" $4 "__" $5
}') }')
case "$regexp" in case "$regexp" in
@ -999,13 +999,13 @@ select_root()
else else
local pts dev size isize ptcount=0 local pts dev size isize ptcount=0
# walk partition list and skip ones that are < 4G # walk partition list and skip ones that are < 8G
while read -r dev size; do while read -r dev size; do
s=${size%%__*} s=${size%%__*}
size_t="${s: -1:1}" size_t="${s: -1:1}"
isize=${s:0:-1} isize=${s:0:-1}
isize=${isize%.*} isize=${isize%.*}
if ! [[ $size_t == 'M' || ($size_t == 'G' && $isize -lt 4) ]]; then if ! [[ $size_t == 'M' || ($size_t == 'G' && $isize -lt 8) ]]; then
pts+="$dev $size " pts+="$dev $size "
(( ptcount++ )) (( ptcount++ ))
fi fi
@ -1016,7 +1016,7 @@ select_root()
ROOT="$(awk 'NF > 0 {print $1}' <<< "$pts")" ROOT="$(awk 'NF > 0 {print $1}' <<< "$pts")"
else else
local txt="\nSelect the root (/) partition, this is where $DIST will be installed." local txt="\nSelect the root (/) partition, this is where $DIST will be installed."
txt+="\n\nDevices smaller than 4G will not be shown here." txt+="\n\nDevices smaller than 8G will not be shown here."
dlg ROOT menu "Mount Root" "$txt" $pts dlg ROOT menu "Mount Root" "$txt" $pts
fi fi
fi fi
@ -1047,7 +1047,7 @@ select_swap()
dlg SWAP menu "Swap Setup" "\nSelect whether to use a swapfile, swap partition, or none." \ dlg SWAP menu "Swap Setup" "\nSelect whether to use a swapfile, swap partition, or none." \
"none" "No swap space" \ "none" "No swap space" \
"swapfile" "/swapfile (recommended -- editable size)" \ "swapfile" "/swapfile (editable size)" \
$pts $pts
if [[ -z $SWAP || $SWAP == "none" ]]; then if [[ -z $SWAP || $SWAP == "none" ]]; then