diff options
| author | Vishwas Udupa <vudupa@qti.qualcomm.com> | 2025-11-13 16:57:12 +0530 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2025-11-13 10:15:06 -0800 |
| commit | 89b44b73dca64634f7e77d0edc37fe49f648f025 (patch) | |
| tree | 23b760bf6257bcc29599a223bc9cbf8a70c98e21 | |
| parent | d5d773469ba07da54b653a9c4436e73d9b60281f (diff) | |
| download | meta-openembedded-89b44b73dca64634f7e77d0edc37fe49f648f025.tar.gz | |
chrony: remove buildtime installation of /var/lib/chrony
Since commit 3200122d68 (chrony: create /var/lib/chrony by systemd-tmpfiles)
tmpfiles.d mechanism already ensures populating /var/lib/chrony at runtime.
Introduce volatiles mechanism to make sure the directory is created
at runtime for sysvinit as well.
Since /var/lib/chrony is populated at runtime, stop packaging at build time.
this helps to align towards stateless system expectations
or when updates are done via meta-updater.
Signed-off-by: Vishwas Udupa <vudupa@qti.qualcomm.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
| -rw-r--r-- | meta-networking/recipes-support/chrony/chrony_4.8.bb | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/meta-networking/recipes-support/chrony/chrony_4.8.bb b/meta-networking/recipes-support/chrony/chrony_4.8.bb index 826bffc323..f50576c272 100644 --- a/meta-networking/recipes-support/chrony/chrony_4.8.bb +++ b/meta-networking/recipes-support/chrony/chrony_4.8.bb | |||
| @@ -102,9 +102,6 @@ do_install() { | |||
| 102 | install -d ${D}${systemd_unitdir}/system | 102 | install -d ${D}${systemd_unitdir}/system |
| 103 | install -m 0644 ${S}/examples/chronyd.service ${D}${systemd_unitdir}/system/ | 103 | install -m 0644 ${S}/examples/chronyd.service ${D}${systemd_unitdir}/system/ |
| 104 | 104 | ||
| 105 | # Variable data (for drift and/or rtc file) | ||
| 106 | install -d ${D}${localstatedir}/lib/chrony | ||
| 107 | |||
| 108 | # Fix hard-coded paths in config files and init scripts | 105 | # Fix hard-coded paths in config files and init scripts |
| 109 | sed -i -e 's!/var/!${localstatedir}/!g' -e 's!/etc/!${sysconfdir}/!g' \ | 106 | sed -i -e 's!/var/!${localstatedir}/!g' -e 's!/etc/!${sysconfdir}/!g' \ |
| 110 | -e 's!/usr/sbin/!${sbindir}/!g' -e 's!/usr/bin/!${bindir}/!g' \ | 107 | -e 's!/usr/sbin/!${sbindir}/!g' -e 's!/usr/bin/!${bindir}/!g' \ |
| @@ -114,12 +111,17 @@ do_install() { | |||
| 114 | sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${sysconfdir}/init.d/chronyd | 111 | sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${sysconfdir}/init.d/chronyd |
| 115 | sed -i 's!^EnvironmentFile=.*!EnvironmentFile=-${sysconfdir}/default/chronyd!' ${D}${systemd_unitdir}/system/chronyd.service | 112 | sed -i 's!^EnvironmentFile=.*!EnvironmentFile=-${sysconfdir}/default/chronyd!' ${D}${systemd_unitdir}/system/chronyd.service |
| 116 | 113 | ||
| 117 | install -d ${D}${sysconfdir}/tmpfiles.d | 114 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then |
| 118 | echo "d /var/lib/chrony 0755 root root -" > ${D}${sysconfdir}/tmpfiles.d/chronyd.conf | 115 | install -d ${D}${sysconfdir}/tmpfiles.d |
| 116 | echo "d /var/lib/chrony 0755 root root -" > ${D}${sysconfdir}/tmpfiles.d/chronyd.conf | ||
| 117 | else | ||
| 118 | install -d ${D}${sysconfdir}/default/volatiles | ||
| 119 | echo "d root root 0755 /var/lib/chrony none" > "${D}${sysconfdir}/default/volatiles/00_runtime_chrony_dirs" | ||
| 120 | fi | ||
| 119 | 121 | ||
| 120 | } | 122 | } |
| 121 | 123 | ||
| 122 | FILES:${PN} = "${sbindir}/chronyd ${sysconfdir} ${localstatedir}/lib/chrony ${localstatedir}" | 124 | FILES:${PN} = "${sbindir}/chronyd ${sysconfdir}" |
| 123 | CONFFILES:${PN} = "${sysconfdir}/chrony.conf" | 125 | CONFFILES:${PN} = "${sysconfdir}/chrony.conf" |
| 124 | INITSCRIPT_NAME = "chronyd" | 126 | INITSCRIPT_NAME = "chronyd" |
| 125 | INITSCRIPT_PARAMS = "defaults" | 127 | INITSCRIPT_PARAMS = "defaults" |
