Skip to contentSkip to conversation

gnutls: fix postinst script for ${PN}-fips for multilibs

PATCH New Liu Yiding 1 participant 1 message Dec 12, 2025

lore
Share & tools
lore

Liu Yiding

author
#0 lore raw

PATCH v2 1/1 gnutls: fix postinst script for ${PN}-fips for multilibs

Append "-p" parameter to mkdir to fix failure like following:

When use "gnutls-cli --fips140-mode" command in multilib environment, it shows library not found error.

  root@qemux86-64:~# gnutls-cli --fips140-mode
  library is NOT in FIPS140-2 mode

And it was caused by lacking hmac files.

  root@qemux86-64:~# ls /usr/lib64/.*hmac
  ls: cannot access '/usr/lib64/.libgnutl*': No such file or directory

The reason is as following:

  When '${sysconfdir}/gnutls' was created by 'mkdir' with lib32-gnutls, the dir will not be created again by 'mkdir' with lib-gnutls again, and the subsequent command will not be executed, so hmac files were missing in lib64 environment.
  ${bindir}/fipshmac ${libdir}/libgnutls.so.30.*.* > ${libdir}/.libgnutls.so.30.hmac

So append "-p" parameter can avoid this error.

---
 meta/recipes-support/gnutls/gnutls_3.8.10.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-support/gnutls/gnutls_3.8.10.bb +1 -1
index 2ef71a1213..56a84f76f0 100644
@@ -90,7 +90,7 @@ BBCLASSEXTEND = "native nativesdk"
 pkg_postinst_ontarget:${PN}-fips () {
     if test -x ${bindir}/fipshmac
     then
-        mkdir ${sysconfdir}/gnutls
+        mkdir -p ${sysconfdir}/gnutls
         touch ${sysconfdir}/gnutls/config
         ${bindir}/fipshmac ${libdir}/libgnutls.so.30.*.* > ${libdir}/.libgnutls.so.30.hmac
         ${bindir}/fipshmac ${libdir}/libnettle.so.8.* > ${libdir}/.libnettle.so.8.hmac
Signature · 1 line
2.43.0