All of lore.kernel.org
 help / color / mirror / Atom feed
* ca-certificates: postinst shift count out of range error
@ 2025-05-22 18:40 WXbet
  2025-05-23  9:41 ` [OE-core] " Gyorgy Sarvari
  0 siblings, 1 reply; 3+ messages in thread
From: WXbet @ 2025-05-22 18:40 UTC (permalink / raw)
  To: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 1456 bytes --]

We see the following error maybe introduced with commit ca-certificates: submit sysroot patch upstream, drop default-sysroot.… · openembedded/openembedded-core@90d9f0b ( https://github.com/openembedded/openembedded-core/commit/90d9f0ba674d4fe8e9291f0513c13dff3775c545#diff-fea5ef51cd53e027c02d43f853be31c492bdbe8de48cfbe268bb6b1bcad5f162 )

Configuring ca-certificates.
/usr/sbin/update-ca-certificates: line 75: shift: shift count out of range
error: pkg_run_script: package "ca-certificates" postinst script returned status 1.
error: opkg_configure: ca-certificates.postinst returned 1.

The postinst part in ipkg looks like:
set -e
$D/usr/sbin/update-ca-certificates --sysroot $D

Created from: https://github.com/openembedded/openembedded-core/commit/90d9f0ba674d4fe8e9291f0513c13dff3775c545#diff-d521676128cddb868864b5c8355a22f3245674db0e721c3458f7c35681ebd712R64-R65
Parameter $D is empty and so the shift-command fails.

Looks like there is a missing slash at the end of `$D${sbindir}/update-ca-certificates --sysroot $D`

or

the shift error in update-ca-certificates could be avoided with a patch like this:

diff --git a/sbin/update-ca-certificates b/sbin/update-ca-certificates
index 91d8024..0122c99 100755
--- a/sbin/update-ca-certificates
+++ b/sbin/update-ca-certificates
@@ -71,7 +71,7 @@ do
echo "$0: [--verbose] [--fresh]"
exit;;
esac
-  shift
+  [ $# -gt 0 ] && shift
done

if [ ! -s "$CERTSCONF" ]

[-- Attachment #2: Type: text/html, Size: 1872 bytes --]

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [OE-core] ca-certificates: postinst shift count out of range error
  2025-05-22 18:40 ca-certificates: postinst shift count out of range error WXbet
@ 2025-05-23  9:41 ` Gyorgy Sarvari
  2025-05-23  9:43   ` Alexander Kanavin
  0 siblings, 1 reply; 3+ messages in thread
From: Gyorgy Sarvari @ 2025-05-23  9:41 UTC (permalink / raw)
  To: WXbet, openembedded-core

On 5/22/25 20:40, WXbet via lists.openembedded.org wrote:
> We see the following error maybe introduced with commit
> ca-certificates: submit sysroot patch upstream, drop default-sysroot.…
> · openembedded/openembedded-core@90d9f0b
> <https://github.com/openembedded/openembedded-core/commit/90d9f0ba674d4fe8e9291f0513c13dff3775c545#diff-fea5ef51cd53e027c02d43f853be31c492bdbe8de48cfbe268bb6b1bcad5f162>
>
> Configuring ca-certificates.
> /usr/sbin/update-ca-certificates: line 75: shift: shift count out of range
> error: pkg_run_script: package "ca-certificates" postinst script
> returned status 1.
> error: opkg_configure: ca-certificates.postinst returned 1.
>  
>
> The postinst part in ipkg looks like:
> set -e
>     $D/usr/sbin/update-ca-certificates --sysroot $D
>
> Created from:
> https://github.com/openembedded/openembedded-core/commit/90d9f0ba674d4fe8e9291f0513c13dff3775c545#diff-d521676128cddb868864b5c8355a22f3245674db0e721c3458f7c35681ebd712R64-R65
> Parameter $D is empty and so the shift-command fails.
>
> Looks like there is a missing slash at the end of
> `$D${sbindir}/update-ca-certificates --sysroot $D`

I think it should be either the slash at the end, of maybe something
like this:

[ -n "$D" ] && sysroot_args="--sysroot $D"
$D${sbindir}/update-ca-certificates $sysroot_args

To me, the below conditional shifting seems a bit like hiding a user error.

>  
> or
>  
> the shift error in update-ca-certificates could be avoided with a
> patch like this:
>
> diff --git a/sbin/update-ca-certificates b/sbin/update-ca-certificates
> index 91d8024..0122c99 100755
> --- a/sbin/update-ca-certificates
> +++ b/sbin/update-ca-certificates
> @@ -71,7 +71,7 @@ do
>        echo "$0: [--verbose] [--fresh]"
>        exit;;
>    esac
> -  shift
> +  [ $# -gt 0 ] && shift
>  done
>  
>  if [ ! -s "$CERTSCONF" ]
>
>  
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#217144): https://lists.openembedded.org/g/openembedded-core/message/217144
> Mute This Topic: https://lists.openembedded.org/mt/113252836/6084445
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [skandigraun@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [OE-core] ca-certificates: postinst shift count out of range error
  2025-05-23  9:41 ` [OE-core] " Gyorgy Sarvari
@ 2025-05-23  9:43   ` Alexander Kanavin
  0 siblings, 0 replies; 3+ messages in thread
From: Alexander Kanavin @ 2025-05-23  9:43 UTC (permalink / raw)
  To: wxbet; +Cc: openembedded-core, skandigraun

On Fri, 23 May 2025 at 11:41, Gyorgy Sarvari via
lists.openembedded.org <skandigraun=gmail.com@lists.openembedded.org>
wrote:
> I think it should be either the slash at the end, of maybe something
> like this:
>
> [ -n "$D" ] && sysroot_args="--sysroot $D"
> $D${sbindir}/update-ca-certificates $sysroot_args
>
> To me, the below conditional shifting seems a bit like hiding a user error.

Yes, we should fix the postinst. Can you prepare a patch?

Alex


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-05-23  9:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-22 18:40 ca-certificates: postinst shift count out of range error WXbet
2025-05-23  9:41 ` [OE-core] " Gyorgy Sarvari
2025-05-23  9:43   ` Alexander Kanavin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.