diff options
Diffstat (limited to 'meta/recipes-core/volatile-binds/volatile-binds.bb')
-rw-r--r-- | meta/recipes-core/volatile-binds/volatile-binds.bb | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/meta/recipes-core/volatile-binds/volatile-binds.bb b/meta/recipes-core/volatile-binds/volatile-binds.bb index 3c8b18291e..cca8a65fb4 100644 --- a/meta/recipes-core/volatile-binds/volatile-binds.bb +++ b/meta/recipes-core/volatile-binds/volatile-binds.bb | |||
@@ -16,10 +16,10 @@ inherit allarch systemd features_check | |||
16 | REQUIRED_DISTRO_FEATURES = "systemd" | 16 | REQUIRED_DISTRO_FEATURES = "systemd" |
17 | 17 | ||
18 | VOLATILE_BINDS ?= "\ | 18 | VOLATILE_BINDS ?= "\ |
19 | /var/volatile/lib /var/lib\n\ | 19 | ${localstatedir}/volatile/lib ${localstatedir}/lib\n\ |
20 | /var/volatile/cache /var/cache\n\ | 20 | ${localstatedir}/volatile/cache ${localstatedir}/cache\n\ |
21 | /var/volatile/spool /var/spool\n\ | 21 | ${localstatedir}/volatile/spool ${localstatedir}/spool\n\ |
22 | /var/volatile/srv /srv\n\ | 22 | ${localstatedir}/volatile/srv /srv\n\ |
23 | " | 23 | " |
24 | VOLATILE_BINDS[type] = "list" | 24 | VOLATILE_BINDS[type] = "list" |
25 | VOLATILE_BINDS[separator] = "\n" | 25 | VOLATILE_BINDS[separator] = "\n" |
@@ -33,9 +33,12 @@ def volatile_systemd_services(d): | |||
33 | services.append("%s.service" % what[1:].replace("/", "-")) | 33 | services.append("%s.service" % what[1:].replace("/", "-")) |
34 | return " ".join(services) | 34 | return " ".join(services) |
35 | 35 | ||
36 | SYSTEMD_SERVICE_${PN} = "${@volatile_systemd_services(d)}" | 36 | SYSTEMD_SERVICE:${PN} = "${@volatile_systemd_services(d)}" |
37 | 37 | ||
38 | FILES_${PN} += "${systemd_unitdir}/system/*.service ${servicedir}" | 38 | FILES:${PN} += "${systemd_system_unitdir}/*.service ${servicedir}" |
39 | |||
40 | # Set to 1 to forcibly skip OverlayFS, and default to copy+bind | ||
41 | AVOID_OVERLAYFS = "0" | ||
39 | 42 | ||
40 | do_compile () { | 43 | do_compile () { |
41 | while read spec mountpoint; do | 44 | while read spec mountpoint; do |
@@ -43,21 +46,22 @@ do_compile () { | |||
43 | continue | 46 | continue |
44 | fi | 47 | fi |
45 | 48 | ||
46 | servicefile="${spec#/}" | 49 | servicefile="$(echo "${spec#/}" | tr / -).service" |
47 | servicefile="$(echo "$servicefile" | tr / -).service" | 50 | [ "$mountpoint" != ${localstatedir}/lib ] || var_lib_servicefile=$servicefile |
48 | sed -e "s#@what@#$spec#g; s#@where@#$mountpoint#g" \ | 51 | sed -e "s#@what@#$spec#g; s#@where@#$mountpoint#g" \ |
49 | -e "s#@whatparent@#${spec%/*}#g; s#@whereparent@#${mountpoint%/*}#g" \ | 52 | -e "s#@whatparent@#${spec%/*}#g; s#@whereparent@#${mountpoint%/*}#g" \ |
53 | -e "s#@avoid_overlayfs@#${@d.getVar('AVOID_OVERLAYFS')}#g" \ | ||
50 | volatile-binds.service.in >$servicefile | 54 | volatile-binds.service.in >$servicefile |
51 | done <<END | 55 | done <<END |
52 | ${@d.getVar('VOLATILE_BINDS').replace("\\n", "\n")} | 56 | ${@d.getVar('VOLATILE_BINDS').replace("\\n", "\n")} |
53 | END | 57 | END |
54 | 58 | ||
55 | if [ -e var-volatile-lib.service ]; then | 59 | if [ -e "$var_lib_servicefile" ]; then |
56 | # As the seed is stored under /var/lib, ensure that this service runs | 60 | # As the seed is stored under /var/lib, ensure that this service runs |
57 | # after the volatile /var/lib is mounted. | 61 | # after the volatile /var/lib is mounted. |
58 | sed -i -e "/^Before=/s/\$/ systemd-random-seed.service/" \ | 62 | sed -i -e "/^Before=/s/\$/ systemd-random-seed.service/" \ |
59 | -e "/^WantedBy=/s/\$/ systemd-random-seed.service/" \ | 63 | -e "/^WantedBy=/s/\$/ systemd-random-seed.service/" \ |
60 | var-volatile-lib.service | 64 | "$var_lib_servicefile" |
61 | fi | 65 | fi |
62 | } | 66 | } |
63 | do_compile[dirs] = "${WORKDIR}" | 67 | do_compile[dirs] = "${WORKDIR}" |
@@ -67,14 +71,14 @@ do_install () { | |||
67 | install -d ${D}${servicedir} | 71 | install -d ${D}${servicedir} |
68 | install -m 0755 mount-copybind ${D}${base_sbindir}/ | 72 | install -m 0755 mount-copybind ${D}${base_sbindir}/ |
69 | 73 | ||
70 | install -d ${D}${systemd_unitdir}/system | 74 | install -d ${D}${systemd_system_unitdir} |
71 | for service in ${SYSTEMD_SERVICE_${PN}}; do | 75 | for service in ${SYSTEMD_SERVICE:${PN}}; do |
72 | install -m 0644 $service ${D}${systemd_unitdir}/system/ | 76 | install -m 0644 $service ${D}${systemd_system_unitdir}/ |
73 | done | 77 | done |
74 | 78 | ||
75 | # Suppress attempts to process some tmpfiles that are not temporary. | 79 | # Suppress attempts to process some tmpfiles that are not temporary. |
76 | # | 80 | # |
77 | install -d ${D}${sysconfdir}/tmpfiles.d ${D}/var/cache | 81 | install -d ${D}${sysconfdir}/tmpfiles.d ${D}${localstatedir}/cache |
78 | ln -s /dev/null ${D}${sysconfdir}/tmpfiles.d/etc.conf | 82 | ln -s /dev/null ${D}${sysconfdir}/tmpfiles.d/etc.conf |
79 | ln -s /dev/null ${D}${sysconfdir}/tmpfiles.d/home.conf | 83 | ln -s /dev/null ${D}${sysconfdir}/tmpfiles.d/home.conf |
80 | } | 84 | } |