diff options
author | Patrick Williams <patrick@stwcx.xyz> | 2016-08-17 14:31:25 -0500 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2016-08-22 16:43:26 +0000 |
commit | 60f9d69e016b11c468c98ea75ba0a60c44afbbc4 (patch) | |
tree | ecb49581a9e41a37943c22cd9ef3f63451b20ee7 /import-layers/yocto-poky/meta/recipes-core/volatile-binds/volatile-binds.bb | |
parent | e18c61205e0234b03697129c20cc69c9b3940efc (diff) | |
download | blackbird-openbmc-60f9d69e016b11c468c98ea75ba0a60c44afbbc4.tar.gz blackbird-openbmc-60f9d69e016b11c468c98ea75ba0a60c44afbbc4.zip |
yocto-poky: Move to import-layers subdir
We are going to import additional layers, so create a subdir to
hold all of the layers that we import with git-subtree.
Change-Id: I6f732153a22be8ca663035c518837e3cc5ec0799
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Diffstat (limited to 'import-layers/yocto-poky/meta/recipes-core/volatile-binds/volatile-binds.bb')
-rw-r--r-- | import-layers/yocto-poky/meta/recipes-core/volatile-binds/volatile-binds.bb | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/import-layers/yocto-poky/meta/recipes-core/volatile-binds/volatile-binds.bb b/import-layers/yocto-poky/meta/recipes-core/volatile-binds/volatile-binds.bb new file mode 100644 index 000000000..fee7275e3 --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-core/volatile-binds/volatile-binds.bb @@ -0,0 +1,71 @@ +SUMMARY = "Volatile bind mount setup and configuration for read-only-rootfs" +DESCRIPTION = "${SUMMARY}" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://COPYING.MIT;md5=5750f3aa4ea2b00c2bf21b2b2a7b714d" + +SRC_URI = "\ + file://mount-copybind \ + file://COPYING.MIT \ + file://volatile-binds.service.in \ +" + +S = "${WORKDIR}" + +inherit allarch systemd distro_features_check + +REQUIRED_DISTRO_FEATURES = "systemd" + +VOLATILE_BINDS ?= "\ + /var/volatile/lib /var/lib\n\ +" +VOLATILE_BINDS[type] = "list" +VOLATILE_BINDS[separator] = "\n" + +def volatile_systemd_services(d): + services = [] + for line in oe.data.typed_value("VOLATILE_BINDS", d): + if not line: + continue + what, where = line.split(None, 1) + services.append("%s.service" % what[1:].replace("/", "-")) + return " ".join(services) + +SYSTEMD_SERVICE_${PN} = "${@volatile_systemd_services(d)}" + +FILES_${PN} += "${systemd_unitdir}/system/*.service" + +do_compile () { + while read spec mountpoint; do + if [ -z "$spec" ]; then + continue + fi + + servicefile="${spec#/}" + servicefile="$(echo "$servicefile" | tr / -).service" + sed -e "s#@what@#$spec#g; s#@where@#$mountpoint#g" \ + -e "s#@whatparent@#${spec%/*}#g; s#@whereparent@#${mountpoint%/*}#g" \ + volatile-binds.service.in >$servicefile + done <<END +${@d.getVar('VOLATILE_BINDS', True).replace("\\n", "\n")} +END + + if [ -e var-volatile-lib.service ]; then + # As the seed is stored under /var/lib, ensure that this service runs + # after the volatile /var/lib is mounted. + sed -i -e "/^Before=/s/\$/ systemd-random-seed.service/" \ + -e "/^WantedBy=/s/\$/ systemd-random-seed.service/" \ + var-volatile-lib.service + fi +} +do_compile[dirs] = "${WORKDIR}" + +do_install () { + install -d ${D}${base_sbindir} + install -m 0755 mount-copybind ${D}${base_sbindir}/ + + install -d ${D}${systemd_unitdir}/system + for service in ${SYSTEMD_SERVICE_volatile-binds}; do + install -m 0644 $service ${D}${systemd_unitdir}/system/ + done +} +do_install[dirs] = "${WORKDIR}" |