]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
ca-certificates: fix on-target postinstall script
authorGyorgy Sarvari <skandigraun@gmail.com>
Mon, 10 Nov 2025 10:21:47 +0000 (23:21 +1300)
committerSteve Sakoman <steve@sakoman.com>
Mon, 10 Nov 2025 15:03:44 +0000 (07:03 -0800)
When the package is installed directly on the machine (instead of
installing it in the rootfs directly), the postinstall script fails with
the following error:

/usr/sbin/update-ca-certificates: line 75: shift: shift count out of range

The reason is that the "update-ca-certificates" script is executed with
the "--sysroot" argument, and as the sysroot $D is passed. However on the
target system this variable doesn't exist, so the argument is passed without
this mandatory value, and the execution fails.

To avoid this error, check if the $D variable exists, and pass the --sysroot
argument only when it does.

Reported-by: WXbet <Wxbet@proton.me>
Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit cf39461e97098a1b28693299677888ba7e8bfccf)
Signed-off-by: Ankur Tyagi <ankur.tyagi85@gmail.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
meta/recipes-support/ca-certificates/ca-certificates_20250419.bb

index f06a30bd6d1bc0a159695004118cde572b4a62e4..01f594095e9c9c9f6f789038f6a3ff4b53072441 100644 (file)
@@ -60,7 +60,8 @@ do_install:append:class-target () {
 }
 
 pkg_postinst:${PN}:class-target () {
-    $D${sbindir}/update-ca-certificates --sysroot $D
+    [ -n "$D" ] && sysroot_args="--sysroot $D"
+    $D${sbindir}/update-ca-certificates $sysroot_args
 }
 
 CONFFILES:${PN} += "${sysconfdir}/ca-certificates.conf"