1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-18 06:03:42 +03:00

test: install all necessary units & generators for LVM on Debian

And derivates.

Replaces: #30458
(cherry picked from commit f9ba9d3eb7c350f31132ccd9ed1ee3c0c693f5c5)
(cherry picked from commit b1dba6bcaae70849394f34be8850f2e5e2559633)
(cherry picked from commit dc7bc3d34e1cf87e6cf93ba901bd21af24b1ae71)
(cherry picked from commit 850d3d70bcab501fcc2a5df033435c0c0dd6664d)
This commit is contained in:
Frantisek Sumsal 2023-12-13 12:27:17 +01:00 committed by Luca Boccassi
parent 42c2a347ba
commit 2b1cc75930

View File

@ -1077,26 +1077,34 @@ install_multipath() {
}
install_lvm() {
local lvm_rules rule_prefix
image_install lvm
image_install "${ROOTLIBDIR:?}"/system/lvm2-lvmpolld.{service,socket}
image_install "${ROOTLIBDIR:?}"/system/{blk-availability,lvm2-monitor}.service
image_install -o "/lib/tmpfiles.d/lvm2.conf"
if get_bool "$LOOKS_LIKE_DEBIAN"; then
inst_rules 56-lvm.rules 69-lvm-metad.rules
lvm_rules="56-lvm.rules"
rule_prefix=""
else
# Support the new udev autoactivation introduced in lvm 2.03.14
# https://sourceware.org/git/?p=lvm2.git;a=commit;h=67722b312390cdab29c076c912e14bd739c5c0f6
# Static autoactivation (via lvm2-activation-generator) was dropped
# in lvm 2.03.15
# https://sourceware.org/git/?p=lvm2.git;a=commit;h=ee8fb0310c53ed003a43b324c99cdfd891dd1a7c
if [[ -f /lib/udev/rules.d/69-dm-lvm.rules ]]; then
inst_rules 11-dm-lvm.rules 69-dm-lvm.rules
else
image_install "${ROOTLIBDIR:?}"/system-generators/lvm2-activation-generator
image_install "${ROOTLIBDIR:?}"/system/lvm2-pvscan@.service
inst_rules 11-dm-lvm.rules 69-dm-lvm-metad.rules
fi
lvm_rules="11-dm-lvm.rules"
rule_prefix="dm-"
fi
# Support the new udev autoactivation introduced in lvm 2.03.14
# https://sourceware.org/git/?p=lvm2.git;a=commit;h=67722b312390cdab29c076c912e14bd739c5c0f6
# Static autoactivation (via lvm2-activation-generator) was dropped
# in lvm 2.03.15
# https://sourceware.org/git/?p=lvm2.git;a=commit;h=ee8fb0310c53ed003a43b324c99cdfd891dd1a7c
if [[ -f "/lib/udev/rules.d/69-${rule_prefix}lvm.rules" ]]; then
inst_rules "$lvm_rules" "69-${rule_prefix}lvm.rules"
else
image_install "${ROOTLIBDIR:?}"/system-generators/lvm2-activation-generator
image_install "${ROOTLIBDIR:?}"/system/lvm2-pvscan@.service
inst_rules "$lvm_rules" "69-${rule_prefix}lvm-metad.rules"
fi
mkdir -p "${initdir:?}/etc/lvm"
}