Skip to content

Commit

Permalink
Don't rely on lsblk line order (#27)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
drizzt committed Feb 25, 2017
1 parent 6b14c08 commit e378928
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vps2arch
Original file line number Diff line number Diff line change
Expand Up @@ -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" ;;
Expand Down

0 comments on commit e378928

Please sign in to comment.