Skip to contentSkip to conversation

libwebsockets: Avoid absolute paths in *.cmake files in the sysroot

PATCH New Peter Kjellerstedt 1 participant 2 messages Aug 9, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 libwebsockets: Avoid absolute paths in *.cmake files in the sysroot

---
 .../recipes-connectivity/libwebsockets/libwebsockets_4.2.2.bb  | 3 +++
 1 file changed, 3 insertions(+)
meta-oe/recipes-connectivity/libwebsockets/libwebsockets_4.2.2.bb +3 -0
index a5fcb8d72..2a3a4ebd0 100644
@@ -41,3 +41,6 @@ RDEPENDS:${PN} += " ${@bb.utils.contains('PACKAGECONFIG', 'libuv', '${PN}-evlib-
 RDEPENDS:${PN} += " ${@bb.utils.contains('PACKAGECONFIG', 'libev', '${PN}-evlib-ev', '', d)}"
 
 RDEPENDS:${PN}-dev += " ${@bb.utils.contains('PACKAGECONFIG', 'static', '${PN}-staticdev', '', d)}"
+
+# Avoid absolute paths to end up in the sysroot.
+SSTATE_SCAN_FILES += "*.cmake"
#1 lore raw

PATCH 2/2 cryptsetup: Add support for building without SSH tokens

Cryptsetup SSH tokens is the only feature that has a dependency on libssh. Add a packageconfig to control this dependency.

---
 meta-oe/recipes-crypto/cryptsetup/cryptsetup_2.4.3.bb | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
meta-oe/recipes-crypto/cryptsetup/cryptsetup_2.4.3.bb +10 -1
index 8f9f663a3..4f8bbf035 100644
@@ -14,7 +14,6 @@ DEPENDS = " \
     libdevmapper \
     popt \
     util-linux-libuuid \
-    libssh \
 "
 
 DEPENDS:append:libc-musl = " argp-standalone"
@@ -39,6 +38,7 @@ PACKAGECONFIG ??= " \
     blkid \
     luks-adjust-xts-keysize \
     openssl \
+    ssh-token \
 "
 PACKAGECONFIG:append:class-target = " \
     udev \
@@ -69,6 +69,7 @@ PACKAGECONFIG[nss] = "--with-crypto_backend=nss,,nss"
 PACKAGECONFIG[kernel] = "--with-crypto_backend=kernel"
 PACKAGECONFIG[nettle] = "--with-crypto_backend=nettle,,nettle"
 PACKAGECONFIG[luks2] = "--with-default-luks-format=LUKS2,--with-default-luks-format=LUKS1"
+PACKAGECONFIG[ssh-token] = "--enable-ssh-token,--disable-ssh-token,libssh"
 
 EXTRA_OECONF = "--enable-static"
 # Building without largefile is not supported by upstream
@@ -78,6 +79,14 @@ EXTRA_OECONF += "--disable-static-cryptsetup"
 # There's no recipe for libargon2 yet
 EXTRA_OECONF += "--disable-libargon2"
 
+do_install:append() {
+    # The /usr/lib/cryptsetup directory is always created, even when ssh-token
+    # is disabled. In that case it is empty and causes a packaging error. Since
+    # there is no reason to distribute the empty directory, the easiest solution
+    # is to remove it if it is empty.
+    rmdir -p --ignore-fail-on-non-empty ${D}${libdir}/${BPN}
+}
+
 FILES:${PN} += "${@bb.utils.contains('DISTRO_FEATURES','systemd','${exec_prefix}/lib/tmpfiles.d/cryptsetup.conf', '', d)}"
 
 RDEPENDS:${PN} = " \