Skip to content

Commit

Permalink
Fix growpart error with older blkid versions (#54)
Browse files Browse the repository at this point in the history
Certain older distributions (e.g. CentOS 7.9) include outdated versions
(from 2013) of `blkid`.
Because [long options were added in
2017](util-linux/util-linux@15a74f7),
using the "original", short form to check the version would make this
script work with these `blkid` versions instead of failing with `blkid:
invalid option -- '-'`
  • Loading branch information
balcsida authored Apr 5, 2024
1 parent 23c60eb commit 49e5dd7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bin/growpart
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,7 @@ resize_sfdisk_dos() {

get_table_format() {
local out="" disk="$1"
if has_cmd blkid && blkid --version | grep -q util-linux &&
if has_cmd blkid && blkid -V | grep -q util-linux &&
out=$(blkid -o value -s PTTYPE "$disk") &&
[ "$out" = "dos" -o "$out" = "gpt" ]; then
_RET="$out"
Expand Down

0 comments on commit 49e5dd7

Please sign in to comment.