25 lines
638 B
Bash
25 lines
638 B
Bash
# vim: set ft=sh:
|
|
# shellcheck shell=sh
|
|
#
|
|
# https://www.shellcheck.net/wiki/SC2154
|
|
# https://www.shellcheck.net/wiki/SC2068
|
|
# shellcheck disable=2154,2068
|
|
|
|
[ "$break" = lvm ] && { print "break before lvm.init"; sh; }
|
|
|
|
export DM_DISABLE_UDEV=1
|
|
mkdir -p /run/lvm /run/lock/lvm
|
|
|
|
set -- \
|
|
--sysinit -qq -aay "${lvm_discard:+--config=devices\{issue_discards=1\}}"
|
|
|
|
if [ "$lvm_group" ] && [ "$lvm_name" ]; then
|
|
lvm lvchange $@ "${lvm_group}/${lvm_name}"
|
|
elif [ "$lvm_group" ]; then
|
|
lvm vgchange $@ "$lvm_group"
|
|
elif [ "$lvm_tag" ]; then
|
|
lvm lvchange $@ "@${lvm_tag}"
|
|
else
|
|
lvm vgchange $@
|
|
fi || panic "failed to trigger LVM"
|