]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
gnutls: fix postinst script for ${PN}-fips for multilibs
authorLiu Yiding <liuyd.fnst@fujitsu.com>
Fri, 12 Dec 2025 08:31:31 +0000 (16:31 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 15 Dec 2025 18:00:31 +0000 (18:00 +0000)
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.

[RP: The -p option doesn't error if the directory already exists]
Signed-off-by: Liu Yiding <liuyd.fnst@fujitsu.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-support/gnutls/gnutls_3.8.11.bb

index faeb1a4ede7bc637a776fc1958cad86f00a14a1d..6c979430cd6595295b90282f555d35feaa8bafc5 100644 (file)
@@ -91,7 +91,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