diff options
Diffstat (limited to 'recipes-sota/ostree-initramfs/ostree-initramfs.bb')
-rw-r--r-- | recipes-sota/ostree-initramfs/ostree-initramfs.bb | 32 |
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 | |||
3 | LICENSE = "GPLv2+" | ||
4 | LIC_FILES_CHKSUM = "file://COPYING.GPL;md5=751419260aa954499f7abaabaa882bbe" | ||
5 | |||
6 | S = "${WORKDIR}" | ||
7 | |||
8 | SRC_URI = "file://COPYING.GPL" | ||
9 | |||
10 | DEPENDS += " ostree" | ||
11 | |||
12 | FILES_${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 | |||
19 | export OSTREE_INITRAMFS_IMAGE | ||
20 | |||
21 | do_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 | } | ||