summaryrefslogtreecommitdiffstats
path: root/recipes-sota/ostree-initramfs/ostree-initramfs.bb
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-sota/ostree-initramfs/ostree-initramfs.bb')
-rw-r--r--recipes-sota/ostree-initramfs/ostree-initramfs.bb32
1 files changed, 32 insertions, 0 deletions
diff --git a/recipes-sota/ostree-initramfs/ostree-initramfs.bb b/recipes-sota/ostree-initramfs/ostree-initramfs.bb
new file mode 100644
index 0000000..5b3818c
--- /dev/null
+++ b/recipes-sota/ostree-initramfs/ostree-initramfs.bb
@@ -0,0 +1,32 @@
1# Small hook to call ostree-prepare-root on initrd-switch-root
2
3LICENSE = "GPLv2+"
4LIC_FILES_CHKSUM = "file://COPYING.GPL;md5=751419260aa954499f7abaabaa882bbe"
5
6S = "${WORKDIR}"
7
8SRC_URI = "file://COPYING.GPL"
9
10DEPENDS += " ostree"
11
12FILES_${PN} += "${systemd_unitdir} \
13 ${systemd_unitdir}/system \
14 ${systemd_unitdir}/system/initrd-switch-root.target.wants \
15 ${systemd_unitdir}/system/initrd-switch-root.target.wants/ostree-prepare-root.service \
16 ${sysconfdir}/initrd-release \
17 "
18
19export OSTREE_INITRAMFS_IMAGE
20
21do_install() {
22 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
23 install -d ${D}${sysconfdir}
24 echo "NAME=${OSTREE_INITRAMFS_IMAGE}" > ${D}/${sysconfdir}/initrd-release
25 install -d ${D}${systemd_unitdir}
26 install -d ${D}${systemd_unitdir}/system
27
28 install -d ${D}${systemd_unitdir}/system/initrd-switch-root.target.wants
29 ln -s ${systemd_unitdir}/system/ostree-prepare-root.service \
30 "${D}${systemd_unitdir}/system/initrd-switch-root.target.wants/ostree-prepare-root.service"
31 fi
32}