From a124f6d9b0bf4d5511929ae382908626af4cea17 Mon Sep 17 00:00:00 2001 From: Bruce Leidl Date: Tue, 27 Mar 2018 21:48:58 -0400 Subject: [PATCH] set up systemd hook in initramfs --- .../recipes-initrd/citadel-initramfs/citadel-initramfs.bb | 6 +++++- .../citadel-initramfs/files/citadel-rootfs-mount.path | 2 -- .../citadel-initramfs/files/citadel-rootfs-mount.service | 6 +++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/meta-citadel/recipes-initrd/citadel-initramfs/citadel-initramfs.bb b/meta-citadel/recipes-initrd/citadel-initramfs/citadel-initramfs.bb index 29345e9..c242400 100644 --- a/meta-citadel/recipes-initrd/citadel-initramfs/citadel-initramfs.bb +++ b/meta-citadel/recipes-initrd/citadel-initramfs/citadel-initramfs.bb @@ -23,8 +23,12 @@ do_install() { done install -d ${D}${systemd_system_unitdir} - #install -m 644 ${WORKDIR}/citadel-rootfs-mount.path ${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 -d ${D}${systemd_system_unitdir}/sysinit.target.wants + ln -s ../citadel-rootfs-mount.path ${D}${systemd_system_unitdir}/sysinit.target.wants/citadel-rootfs-mount.path + install -d ${D}${sysconfdir} install -m 644 ${WORKDIR}/initrd-release ${D}${sysconfdir} install -m 644 ${WORKDIR}/crypttab ${D}${sysconfdir} 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 0975326..85d60d4 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 @@ -4,5 +4,3 @@ Description=Watch for new entries in /dev/mapper [Path] PathChanged=/dev/mapper -[Install] -WantedBy=initrd-root-fs.target diff --git a/meta-citadel/recipes-initrd/citadel-initramfs/files/citadel-rootfs-mount.service b/meta-citadel/recipes-initrd/citadel-initramfs/files/citadel-rootfs-mount.service index aa62747..fe91c27 100644 --- a/meta-citadel/recipes-initrd/citadel-initramfs/files/citadel-rootfs-mount.service +++ b/meta-citadel/recipes-initrd/citadel-initramfs/files/citadel-rootfs-mount.service @@ -1,7 +1,11 @@ [Unit] Description=Mount citadel rootfs +ConditionPathExists=/dev/mapper/citadel-rootfsA +ConditionPathExists=/dev/mapper/citadel-rootfsB +ConditionPathExists=/dev/mapper/citadel-storage + [Service] Type=oneshot -RemainAfterExit=no +RemainAfterExit=yes ExecStart=/bin/sh -c 'echo "hello world"'