From 7810db935d368329565aa65329d2c9c135ee1e01 Mon Sep 17 00:00:00 2001 From: Gyorgy Sarvari Date: Mon, 10 Nov 2025 23:21:47 +1300 Subject: [PATCH] ca-certificates: fix on-target postinstall script 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 (From OE-Core rev: 9a2bd3b6e2e53071a1463d2804d0d4fb17b1814f) Signed-off-by: Gyorgy Sarvari Signed-off-by: Richard Purdie (cherry picked from commit cf39461e97098a1b28693299677888ba7e8bfccf) Signed-off-by: Ankur Tyagi Signed-off-by: Steve Sakoman --- .../ca-certificates/ca-certificates_20250419.bb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meta/recipes-support/ca-certificates/ca-certificates_20250419.bb b/meta/recipes-support/ca-certificates/ca-certificates_20250419.bb index f06a30bd6d..01f594095e 100644 --- a/meta/recipes-support/ca-certificates/ca-certificates_20250419.bb +++ b/meta/recipes-support/ca-certificates/ca-certificates_20250419.bb @@ -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"