Modify lsblk flags for a consistent output across distros

This commit modifies the lsblk flags to make use of the list format
instead of raw output. `--list` flag seams to keep the geometry order
and produces a consistent output in several distros.
This commit is contained in:
David Cassany 2020-12-21 15:17:30 +01:00
parent e5268debe2
commit 176c7eaba6
No known key found for this signature in database
GPG Key ID: D91C0AAD9018D486

View File

@ -179,7 +179,7 @@ function get_partition_node_name {
local part
udev_pending
for partnode in $(
lsblk -p -r -o NAME,TYPE "${disk}" | grep -E "part|md$" | cut -f1 -d ' '
lsblk -p -l -o NAME,TYPE "${disk}" | grep -E "part|md$" | cut -f1 -d ' '
);do
if [ "${index}" = "${partid}" ];then
echo "${partnode}"