public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [1/1] rootfs: Use curl instead of apt download
@ 2026-07-30  7:17 Aliaksei Karpovich
  2026-07-30  7:39 ` 'MOESSBAUER, Felix' via isar-users
  0 siblings, 1 reply; 2+ messages in thread
From: Aliaksei Karpovich @ 2026-07-30  7:17 UTC (permalink / raw)
  To: isar-users; +Cc: Aliaksei Karpovich

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"
 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.

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

end of thread, other threads:[~2026-07-30  7:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-30  7:17 [1/1] rootfs: Use curl instead of apt download Aliaksei Karpovich
2026-07-30  7:39 ` 'MOESSBAUER, Felix' via isar-users

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox