Skip to contentSkip to conversation

chrony: Make it possible to enable editline support again

PATCH New Peter Kjellerstedt 1 participant 2 messages Nov 12, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 chrony: Make it possible to enable editline support again

Support for readline was dropped in Chrony 4.2. However, the --disable-readline option still remains (it is used to completely ignore all forms of command line editing, even though the only remaining variant is editline). So keeping the readline PACKAGECONFIG and making it pass --disable-readline when it is not enabled disabled support for editline, and if it was enabled it instead passed --without-editline, which also disabled support for editline. Thus there was no way to enable editline support.

---
 .../recipes-support/chrony/chrony_4.3.bb            | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)
meta-networking/recipes-support/chrony/chrony_4.3.bb +4 -9
index d0e2c4b54..dad09f826 100644
@@ -53,14 +53,6 @@ USERADD_PACKAGES = "${@bb.utils.contains('PACKAGECONFIG', 'privdrop', '${PN}', '
 USERADD_PARAM:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'privdrop', '--system -d / -M --shell /bin/nologin chronyd;', '', d)}"
 
 # Configuration options:
-# - For command line editing support in chronyc, you may specify either
-#   'editline' or 'readline' but not both.  editline is smaller, but
-#   many systems already have readline for other purposes so you might want
-#   to choose that instead.  However, beware license incompatibility
-#   since chrony is GPLv2 and readline versions after 6.0 are GPLv3+.
-#   You can of course choose neither, but if you're that tight on space
-#   consider dropping chronyc entirely (you can use it remotely with
-#   appropriate chrony.conf options).
 # - Security-related:
 #   - 'sechash' is omitted by default because it pulls in nss which is huge.
 #   - 'privdrop' allows chronyd to run as non-root; would need changes to
@@ -70,7 +62,6 @@ USERADD_PARAM:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'privdrop', '--sys
 PACKAGECONFIG ??= "editline \
     ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \
 "
-PACKAGECONFIG[readline] = "--without-editline,--disable-readline,readline"
 PACKAGECONFIG[editline] = ",--without-editline,libedit"
 PACKAGECONFIG[sechash] = "--without-tomcrypt,--disable-sechash,nss"
 PACKAGECONFIG[privdrop] = "--with-libcap,--disable-privdrop --without-libcap,libcap"
@@ -79,6 +70,10 @@ PACKAGECONFIG[ipv6] = ",--disable-ipv6,"
 PACKAGECONFIG[nss] = "--with-nss,--without-nss,nss"
 PACKAGECONFIG[libcap] = "--with-libcap,--without-libcap,libcap"
 
+# This is left for backwards compatibility, to avoid breaking existing
+# configurations.
+PACKAGECONFIG[readline] = ""
+
 # --disable-static isn't supported by chrony's configure script.
 DISABLE_STATIC = ""
 
#1 lore raw

PATCH 2/2 chrony: Remove the libcap and nss PACKAGECONFIGs

There is no need for these configs on their own and they would only mess up the sechash and privdrop configs. To actually enable sechash one also had to enable nss, and to enable privdrop one also had to enable libcap.

This also avoids passing --with-libcap if privdrop is enabled since the option does not exist.

Change-Id I64a49741f61385e87ddbc83b9e87213a6fc7668e
---
 meta-networking/recipes-support/chrony/chrony_4.3.bb | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
meta-networking/recipes-support/chrony/chrony_4.3.bb +4 -4
index dad09f826..870c9d8d6 100644
@@ -64,14 +64,14 @@ PACKAGECONFIG ??= "editline \
 "
 PACKAGECONFIG[editline] = ",--without-editline,libedit"
 PACKAGECONFIG[sechash] = "--without-tomcrypt,--disable-sechash,nss"
-PACKAGECONFIG[privdrop] = "--with-libcap,--disable-privdrop --without-libcap,libcap"
+PACKAGECONFIG[privdrop] = ",--disable-privdrop,libcap"
 PACKAGECONFIG[scfilter] = "--enable-scfilter,--without-seccomp,libseccomp"
 PACKAGECONFIG[ipv6] = ",--disable-ipv6,"
-PACKAGECONFIG[nss] = "--with-nss,--without-nss,nss"
-PACKAGECONFIG[libcap] = "--with-libcap,--without-libcap,libcap"
 
-# This is left for backwards compatibility, to avoid breaking existing
+# These are left for backwards compatibility, to avoid breaking existing
 # configurations.
+PACKAGECONFIG[libcap] = ""
+PACKAGECONFIG[nss] = ""
 PACKAGECONFIG[readline] = ""
 
 # --disable-static isn't supported by chrony's configure script.