2020-06-28 09:28:57 +05:30
|
|
|
# vim: set ft=sh:
|
2020-07-03 21:19:09 +05:30
|
|
|
# shellcheck shell=sh
|
|
|
|
#
|
|
|
|
# false positive
|
|
|
|
# shellcheck disable=2154
|
|
|
|
#
|
|
|
|
# word splitting is safe by design
|
2020-09-07 12:24:12 +05:30
|
|
|
# shellcheck disable=2068
|
2020-06-28 09:28:57 +05:30
|
|
|
{
|
|
|
|
[ "$break" = lvm ] && { print "break before trigger_lvm()"; sh; }
|
|
|
|
|
2020-09-07 12:24:12 +05:30
|
|
|
export DM_DISABLE_UDEV=1
|
2020-06-28 09:28:57 +05:30
|
|
|
mkdir -p /run/lvm /run/lock/lvm
|
|
|
|
|
2020-09-07 12:24:12 +05:30
|
|
|
set -- \
|
|
|
|
--sysinit -qq -aay "${lvm_discard:+--config=devices{issue_discards=1}}"
|
2020-06-28 09:28:57 +05:30
|
|
|
|
|
|
|
if [ "$lvm_group" ] && [ "$lvm_name" ]; then
|
2020-09-07 12:24:12 +05:30
|
|
|
lvm lvchange $@ "${lvm_group}/${lvm_name}"
|
2020-06-28 09:28:57 +05:30
|
|
|
elif [ "$lvm_group" ]; then
|
|
|
|
lvm vgchange $@ "$lvm_group"
|
|
|
|
elif [ "$lvm_tag" ]; then
|
2020-09-07 12:24:12 +05:30
|
|
|
lvm lvchange $@ "@${lvm_tag}"
|
2020-06-28 09:28:57 +05:30
|
|
|
else
|
|
|
|
lvm vgchange $@
|
|
|
|
fi || panic "failed to trigger LVM"
|
|
|
|
}
|