Don't rely on lsblk line order (#27)
In util-linux-2.29 the lines of `lsblk -npsro NAME` are written in different order, so use TYPE in order to be forward-compatible
This commit is contained in:
parent
6b14c08748
commit
e378928b7f
1 changed files with 1 additions and 1 deletions
2
vps2arch
2
vps2arch
|
@ -167,7 +167,7 @@ configure_bootloader() {
|
|||
root_dev=$(pvs --noheadings | awk -v vg="$vg" '($2 == vg) { print $1 }')
|
||||
fi
|
||||
for root_dev in $root_dev; do
|
||||
tmp=$(lsblk -npsro NAME "$root_dev" | tail -n1)
|
||||
tmp=$(lsblk -npsro TYPE,NAME "$root_dev" | awk '($1 == "disk") { print $2}')
|
||||
case " $root_devs " in
|
||||
*" $tmp "*) ;;
|
||||
*) root_devs="${root_devs:+$root_devs }$tmp" ;;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue