From 1b0ce58f3292323ec74bb7d93d7f028efbcb0e6c Mon Sep 17 00:00:00 2001 From: Bruce Leidl Date: Tue, 15 Jan 2019 12:27:17 -0500 Subject: [PATCH] add service for lvm activation since everything for early activation in latest LVM is broken --- .../citadel-initramfs/citadel-initramfs.bb | 3 ++- .../files/citadel-lvm-activate.service | 18 ++++++++++++++++++ .../files/citadel-rootfs-mount.path | 2 ++ 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 meta-citadel/recipes-initrd/citadel-initramfs/files/citadel-lvm-activate.service diff --git a/meta-citadel/recipes-initrd/citadel-initramfs/citadel-initramfs.bb b/meta-citadel/recipes-initrd/citadel-initramfs/citadel-initramfs.bb index d1807b2..e788e75 100644 --- a/meta-citadel/recipes-initrd/citadel-initramfs/citadel-initramfs.bb +++ b/meta-citadel/recipes-initrd/citadel-initramfs/citadel-initramfs.bb @@ -8,12 +8,12 @@ SRC_URI = "\ file://initrd-release \ file://crypttab \ file://11-dm.rules \ + file://citadel-lvm-activate.service \ file://citadel-rootfs-mount.path \ file://citadel-rootfs-mount.service \ file://citadel-rootfs-setup.service \ file://citadel-install-rootfs-mount.service \ file://citadel-install-rootfs-setup.service \ - file://citadel-image.conf \ file://99-grsec.conf \ " @@ -28,6 +28,7 @@ do_install() { done install -d ${D}${systemd_system_unitdir} + install -m 644 ${WORKDIR}/citadel-lvm-activate.service ${D}${systemd_system_unitdir} install -m 644 ${WORKDIR}/citadel-rootfs-mount.path ${D}${systemd_system_unitdir} install -m 644 ${WORKDIR}/citadel-rootfs-mount.service ${D}${systemd_system_unitdir} install -m 644 ${WORKDIR}/citadel-rootfs-setup.service ${D}${systemd_system_unitdir} diff --git a/meta-citadel/recipes-initrd/citadel-initramfs/files/citadel-lvm-activate.service b/meta-citadel/recipes-initrd/citadel-initramfs/files/citadel-lvm-activate.service new file mode 100644 index 0000000..92c6200 --- /dev/null +++ b/meta-citadel/recipes-initrd/citadel-initramfs/files/citadel-lvm-activate.service @@ -0,0 +1,18 @@ +[Unit] +Description=Activate LVM volumes +DefaultDependencies=no +AssertPathExists=/etc/initrd-release + +# Don't run if running from installer or in live mode +ConditionKernelCommandLine=!citadel.install +ConditionKernelCommandLine=!citadel.live + +Requires=cryptsetup.target +After=cryptsetup.target + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/usr/sbin/vgchange -v -aay --sysinit + + diff --git a/meta-citadel/recipes-initrd/citadel-initramfs/files/citadel-rootfs-mount.path b/meta-citadel/recipes-initrd/citadel-initramfs/files/citadel-rootfs-mount.path index e730764..b6ede3e 100644 --- a/meta-citadel/recipes-initrd/citadel-initramfs/files/citadel-rootfs-mount.path +++ b/meta-citadel/recipes-initrd/citadel-initramfs/files/citadel-rootfs-mount.path @@ -13,6 +13,8 @@ ConditionKernelCommandLine=root=/dev/mapper/rootfs ConditionKernelCommandLine=!citadel.install ConditionKernelCommandLine=!citadel.live +Requires=citadel-lvm-activate.service + [Path] PathChanged=/dev/mapper