From f96883357041989d419f540128401a82d87d6a09 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Wed, 13 Sep 2023 23:13:27 +0200 Subject: [PATCH] vdo: avoid using of valuesonly To retain backward compatibility with some older version of lvm avoid using --valuesonly option with lvmconfig. --- scripts/lvm_import_vdo.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/lvm_import_vdo.sh b/scripts/lvm_import_vdo.sh index b9f24cfda..90fc3f975 100755 --- a/scripts/lvm_import_vdo.sh +++ b/scripts/lvm_import_vdo.sh @@ -531,9 +531,9 @@ convert_non_lv_() { dry snapshot_merge_ "$DEVICE" # For systems using devicesfile add 'merged' PV into system.devices. - if [ "$("$LVM" lvmconfig --valuesonly devices/use_devicesfile --typeconfig full)" = "1" ]; then - dry "$LVM" lvmdevices --adddev "$DEVICE" - fi + # Bypassing use of --valuesonly to keep compatibility with older lvm. + local usedev=$("$LVM" lvmconfig --typeconfig full devices/use_devicesfile || true) + [ "${usedev#*=" = "1" ] && dry "$LVM" lvmdevices --adddev "$DEVICE" # Restore auto activation for a VG dry "$LVM" vgchange --setautoactivation y $VERB $FORCE "$VGNAME"