summaryrefslogtreecommitdiffstats
path: root/meta-sota/recipes-sota/ostree-initramfs/ostree-initramfs.bb
diff options
context:
space:
mode:
authorAnton Gerasimov <anton@advancedtelematic.com>2016-09-26 15:44:53 +0200
committerAnton Gerasimov <anton@advancedtelematic.com>2016-09-26 15:44:53 +0200
commit4e1566679067975e3e8ee0a9198e4df332e6e32e (patch)
tree9d0ca74f9868e22e878524aa6bfcebeb97a6990e /meta-sota/recipes-sota/ostree-initramfs/ostree-initramfs.bb
parent111007af41bd44d3b634563373fa7b04dc6aa2ae (diff)
Added initramfs image and fixed several error to make AGL rootfs
bootable as an OSTree deployment Bug-AGL: SPEC-253 Change-Id: If636a282d51a64c73c46ce70a361518c1f70cdd6 Signed-off-by: Anton Gerasimov <anton@advancedtelematic.com>
Diffstat (limited to 'meta-sota/recipes-sota/ostree-initramfs/ostree-initramfs.bb')
-rw-r--r--meta-sota/recipes-sota/ostree-initramfs/ostree-initramfs.bb32
1 files changed, 32 insertions, 0 deletions
diff --git a/meta-sota/recipes-sota/ostree-initramfs/ostree-initramfs.bb b/meta-sota/recipes-sota/ostree-initramfs/ostree-initramfs.bb
new file mode 100644
index 0000000..5b3818c
--- /dev/null
+++ b/meta-sota/recipes-sota/ostree-initramfs/ostree-initramfs.bb
@@ -0,0 +1,32 @@
+# Small hook to call ostree-prepare-root on initrd-switch-root
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING.GPL;md5=751419260aa954499f7abaabaa882bbe"
+
+S = "${WORKDIR}"
+
+SRC_URI = "file://COPYING.GPL"
+
+DEPENDS += " ostree"
+
+FILES_${PN} += "${systemd_unitdir} \
+ ${systemd_unitdir}/system \
+ ${systemd_unitdir}/system/initrd-switch-root.target.wants \
+ ${systemd_unitdir}/system/initrd-switch-root.target.wants/ostree-prepare-root.service \
+ ${sysconfdir}/initrd-release \
+ "
+
+export OSTREE_INITRAMFS_IMAGE
+
+do_install() {
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ install -d ${D}${sysconfdir}
+ echo "NAME=${OSTREE_INITRAMFS_IMAGE}" > ${D}/${sysconfdir}/initrd-release
+ install -d ${D}${systemd_unitdir}
+ install -d ${D}${systemd_unitdir}/system
+
+ install -d ${D}${systemd_unitdir}/system/initrd-switch-root.target.wants
+ ln -s ${systemd_unitdir}/system/ostree-prepare-root.service \
+ "${D}${systemd_unitdir}/system/initrd-switch-root.target.wants/ostree-prepare-root.service"
+ fi
+}