public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: claudius.heine.ext@siemens.com
To: isar-users@googlegroups.com
Cc: Claudius Heine <ch@denx.de>
Subject: [PATCH v2 5/7] base-apt: fix issues with creating and using the base-apt repository
Date: Thu, 23 May 2019 17:00:13 +0200	[thread overview]
Message-ID: <20190523150015.23341-6-claudius.heine.ext@siemens.com> (raw)
In-Reply-To: <20190523150015.23341-1-claudius.heine.ext@siemens.com>

From: Claudius Heine <ch@denx.de>

Currently we only support one repository for one image, but since the
image creation uses two root file systems in case of cross-building,
package of both will land into the same repository. This should not be
an issue if both root file system use the same distribution + codename,
since shared ('all' arch) packages where shared in the upstream
repository as well. But in case those differ, different versions could
be used when building out of the base-apt later.

This fix is two fold, for once it disables the creation of base-apt
repositories if the distribution+codename of the two root file systems
differ and second it adds a 'apt-get install --fix-broken' call before
the 'dist-upgrade' one, in order to remove broken dependencies, that
where installed when such a base-apt repository was used.

Signed-off-by: Claudius Heine <ch@denx.de>
---
 meta/classes/image-cache-extension.bbclass          | 10 ++++++++++
 meta/recipes-core/isar-bootstrap/isar-bootstrap.inc |  1 +
 2 files changed, 11 insertions(+)

diff --git a/meta/classes/image-cache-extension.bbclass b/meta/classes/image-cache-extension.bbclass
index af17e0b..30db549 100644
--- a/meta/classes/image-cache-extension.bbclass
+++ b/meta/classes/image-cache-extension.bbclass
@@ -11,6 +11,16 @@ do_cache_base_repo[depends] = "base-apt:do_cache_config"
 do_cache_base_repo[lockfiles] = "${REPO_BASE_DIR}/isar.lock"
 do_cache_base_repo[stamp-extra-info] = "${DISTRO}-${MACHINE}"
 do_cache_base_repo() {
+    if [ -d '${BUILDCHROOT_HOST_DIR}/var/cache/apt' ] &&
+        [ '${DISTRO}' != '${HOST_DISTRO}' ]; then
+        # We would need two separate repository paths for that.
+        # Otherwise packages (especially the 'all' arch ones) from one
+        # distribution can influence the package versions of the other
+        # distribution.
+        bbfatal "Different host and target distributions are currently not supported." \
+                "Try it without cross-build."
+    fi
+
     if [ -d ${WORKDIR}/apt_cache ]; then
         populate_base_apt ${WORKDIR}/apt_cache
     fi
diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
index 18e5e8f..2bc5ea5 100644
--- a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
+++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
@@ -333,6 +333,7 @@ isar_bootstrap() {
             fi
 
             chroot "${ROOTFSDIR}" /usr/bin/apt-get update -y
+            chroot "${ROOTFSDIR}" /usr/bin/apt-get install -y -f
             chroot "${ROOTFSDIR}" /usr/bin/apt-get dist-upgrade -y \
                                   -o Debug::pkgProblemResolver=yes
 
-- 
2.20.1


  parent reply	other threads:[~2019-05-23 15:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-23 15:00 [PATCH v2 0/7] Fixing base-apt and ci claudius.heine.ext
2019-05-23 15:00 ` [PATCH v2 1/7] meta/image.bbclass: add warning if IMAGE_TRANSIENT_PACKAGES is set claudius.heine.ext
2019-05-23 15:00 ` [PATCH v2 2/7] sdkchroot: remove 'copy-package-cache' from ROOTFS_FEATURES claudius.heine.ext
2019-05-23 15:00 ` [PATCH v2 3/7] bitbake: added DISTRO to REPO_BASE_{DB_}DIR claudius.heine.ext
2019-05-23 15:00 ` [PATCH v2 4/7] isar-bootstrap: fix DISTRO_APT_PREMIRRORS regex in case of cached build claudius.heine.ext
2019-05-23 15:00 ` claudius.heine.ext [this message]
2019-05-23 15:00 ` [PATCH v2 6/7] ci_build: fix shebang claudius.heine.ext
2019-05-23 15:00 ` [PATCH v2 7/7] ci_build/repro: add qemuarm-buster to build configurations claudius.heine.ext
2019-05-29 12:37 ` [PATCH v2 0/7] Fixing base-apt and ci Maxim Yu. Osipov

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=20190523150015.23341-6-claudius.heine.ext@siemens.com \
    --to=claudius.heine.ext@siemens.com \
    --cc=ch@denx.de \
    --cc=isar-users@googlegroups.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