diff options
| -rw-r--r-- | meta-networking/recipes-support/chrony/chrony_4.1.bb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/meta-networking/recipes-support/chrony/chrony_4.1.bb b/meta-networking/recipes-support/chrony/chrony_4.1.bb index 6a450c3e88..f009bae75c 100644 --- a/meta-networking/recipes-support/chrony/chrony_4.1.bb +++ b/meta-networking/recipes-support/chrony/chrony_4.1.bb | |||
| @@ -47,6 +47,11 @@ DEPENDS = "pps-tools" | |||
| 47 | # chrony does not use GNU Autotools. | 47 | # chrony does not use GNU Autotools. |
| 48 | inherit update-rc.d systemd | 48 | inherit update-rc.d systemd |
| 49 | 49 | ||
| 50 | # Add chronyd user if privdrop packageconfig is selected | ||
| 51 | inherit ${@bb.utils.contains('PACKAGECONFIG', 'privdrop', 'useradd', '', d)} | ||
| 52 | USERADD_PACKAGES = "${@bb.utils.contains('PACKAGECONFIG', 'privdrop', '${PN}', '', d)}" | ||
| 53 | USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'privdrop', '--system -d / -M --shell /bin/nologin chronyd;', '', d)}" | ||
| 54 | |||
| 50 | # Configuration options: | 55 | # Configuration options: |
| 51 | # - For command line editing support in chronyc, you may specify either | 56 | # - For command line editing support in chronyc, you may specify either |
| 52 | # 'editline' or 'readline' but not both. editline is smaller, but | 57 | # 'editline' or 'readline' but not both. editline is smaller, but |
| @@ -68,7 +73,7 @@ PACKAGECONFIG ??= "editline \ | |||
| 68 | PACKAGECONFIG[readline] = "--without-editline,--without-readline,readline" | 73 | PACKAGECONFIG[readline] = "--without-editline,--without-readline,readline" |
| 69 | PACKAGECONFIG[editline] = ",--without-editline,libedit" | 74 | PACKAGECONFIG[editline] = ",--without-editline,libedit" |
| 70 | PACKAGECONFIG[sechash] = "--without-tomcrypt,--disable-sechash,nss" | 75 | PACKAGECONFIG[sechash] = "--without-tomcrypt,--disable-sechash,nss" |
| 71 | PACKAGECONFIG[privdrop] = ",--disable-privdrop,libcap" | 76 | PACKAGECONFIG[privdrop] = "--with-libcap,--disable-privdrop --without-libcap,libcap" |
| 72 | PACKAGECONFIG[scfilter] = "--enable-scfilter,--without-seccomp,libseccomp" | 77 | PACKAGECONFIG[scfilter] = "--enable-scfilter,--without-seccomp,libseccomp" |
| 73 | PACKAGECONFIG[ipv6] = ",--disable-ipv6," | 78 | PACKAGECONFIG[ipv6] = ",--disable-ipv6," |
| 74 | PACKAGECONFIG[nss] = "--with-nss,--without-nss,nss" | 79 | PACKAGECONFIG[nss] = "--with-nss,--without-nss,nss" |
| @@ -97,6 +102,10 @@ do_install() { | |||
| 97 | # Config file | 102 | # Config file |
| 98 | install -d ${D}${sysconfdir} | 103 | install -d ${D}${sysconfdir} |
| 99 | install -m 644 ${WORKDIR}/chrony.conf ${D}${sysconfdir} | 104 | install -m 644 ${WORKDIR}/chrony.conf ${D}${sysconfdir} |
| 105 | if ${@bb.utils.contains('PACKAGECONFIG', 'privdrop', 'true', 'false', d)}; then | ||
| 106 | echo "# Define user to drop to after dropping root privileges" >> ${D}${sysconfdir}/chrony.conf | ||
| 107 | echo "user chronyd" >> ${D}${sysconfdir}/chrony.conf | ||
| 108 | fi | ||
| 100 | 109 | ||
| 101 | # System V init script | 110 | # System V init script |
| 102 | install -d ${D}${sysconfdir}/init.d | 111 | install -d ${D}${sysconfdir}/init.d |
