From: "'MOESSBAUER, Felix' via isar-users" <isar-users@googlegroups.com>
To: Aliaksei Karpovich <akarpovich@ilbers.de>,
"isar-users@googlegroups.com" <isar-users@googlegroups.com>
Subject: Re: [1/1] rootfs: Use curl instead of apt download
Date: Thu, 30 Jul 2026 07:39:54 +0000 [thread overview]
Message-ID: <d1522e212f4f93912a0424db11ce72183dc75585.camel@siemens.com> (raw)
In-Reply-To: <20260730071848.2521390-1-akarpovich@ilbers.de>
On Thu, 2026-07-30 at 09:17 +0200, Aliaksei Karpovich wrote:
> It fixes two issues:
>
> 1) Current implementation extracts package name from URL and gets
> it along with percent-encoding which leads to following error:
> | DEBUG: Executing shell function rootfs_install_pkgs_isar_download
> | Starting pkgProblemResolver with broken count: 0
> | Starting 2 pkgProblemResolver with broken count: 0
> | Done
> | E: Unable to locate package libstdc%2b%2b-12-dev
> | E: Unable to locate package g%2b%2b-12
> | E: Unable to locate package g%2b%2b
>
> To fix it the second field (extracted by sed) will be used as
> deb file name.
>
> 2) In case of cross compile the arch of package is lost. F.e. the
> gcc-14-base_14.2.0-19_arm64.deb will be transformed in
> gcc-14-base name and amd64 version will be downloaded instead of
> arm64.
>
> With this fix the specified version of deb package will be
> downloaded as the URL is used for download.
>
> Signed-off-by: Aliaksei Karpovich <akarpovich@ilbers.de>
> ---
> meta/classes-recipe/rootfs.bbclass | 5 +++--
> meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap.inc | 2 +-
> 2 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/meta/classes-recipe/rootfs.bbclass b/meta/classes-recipe/rootfs.bbclass
> index 77e6aefc..2a2dead8 100644
> --- a/meta/classes-recipe/rootfs.bbclass
> +++ b/meta/classes-recipe/rootfs.bbclass
> @@ -370,14 +370,15 @@ rootfs_install_pkgs_isar_download() {
> # Command apt-get install do not cache packages from local repos
> # We can obtain non cached package URIs by recalling install command here
> # No need in export those files to dl_dir, so we can run it right after
> + # Sed below extracts URL and name of deb packages for curl to download.
> rootfs_cmd --bind "${ROOTFSDIR}/var/cache/apt/archives" /var/cache/apt/archives \
> --bind "${WORKDIR}/dpkg/lock" /var/lib/dpkg/lock \
> --bind "${WORKDIR}/dpkg/lock-frontend" /var/lib/dpkg/lock-frontend \
> --chdir "/var/cache/apt/archives" \
> ${ROOTFSDIR} \
> -- /usr/bin/sh -c "apt-get ${ROOTFS_APT_ARGS} --print-uris ${ROOTFS_PACKAGES} | \
> - sed -n \"s|^.*/\\(.*\\)_[^_]*_[^_]*\\.deb'.*|\\1|p\" | \
> - xargs -r apt-get download"
> + sed -En \"s/^'([^']+\.deb)' ([^ ]+).*/\1 -o \2/p\" | \
> + xargs -r -L1 curl"
> }
>
> ROOTFS_INSTALL_COMMAND += "${@ 'rootfs_install_clean_files' if (d.getVar('ROOTFS_CLEAN_FILES') or '').strip() else ''}"
> diff --git a/meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap.inc b/meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap.inc
> index 994da174..a8afb0a6 100644
> --- a/meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap.inc
> +++ b/meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap.inc
> @@ -9,7 +9,7 @@ inherit bootstrap
> inherit compat
> inherit deb-dl-dir
>
> -DISTRO_BOOTSTRAP_BASE_PACKAGES += "locales apt"
> +DISTRO_BOOTSTRAP_BASE_PACKAGES += "locales apt curl"
While implementing my patch, I noticed this dependency as well. I now
have a simpler solution which just uses cp. Once it passes the fast CI,
I'll send it.
Felix
> DISTRO_BOOTSTRAP_BASE_PACKAGES:append:https-support = " ca-certificates"
>
> BOOTSTRAP_TMPDIR = "${WORKDIR}/tempdir"
> --
> 2.43.0
>
> --
> You received this message because you are subscribed to the Google Groups "isar-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/isar-users/20260730071848.2521390-1-akarpovich%40ilbers.de.
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/d1522e212f4f93912a0424db11ce72183dc75585.camel%40siemens.com.
prev parent reply other threads:[~2026-07-30 7:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-30 7:17 Aliaksei Karpovich
2026-07-30 7:39 ` 'MOESSBAUER, Felix' via isar-users [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d1522e212f4f93912a0424db11ce72183dc75585.camel@siemens.com \
--to=isar-users@googlegroups.com \
--cc=akarpovich@ilbers.de \
--cc=felix.moessbauer@siemens.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox