From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6694185848247681024 X-Received: by 2002:adf:e902:: with SMTP id f2mr58185225wrm.301.1558611599012; Thu, 23 May 2019 04:39:59 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a5d:4492:: with SMTP id j18ls1444774wrq.9.gmail; Thu, 23 May 2019 04:39:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqz9Zp8uX4kPU67hSERflZrdtT93/iEyPpIIRE9biXORqnZxEbSsGUlruPSXDNjIcS5uFfta X-Received: by 2002:a5d:6b03:: with SMTP id v3mr15035214wrw.309.1558611598666; Thu, 23 May 2019 04:39:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558611598; cv=none; d=google.com; s=arc-20160816; b=ZqH3elwW+EfxfKuxmHriKi2pU01d7xL0710+2P/G0p3s1l8xFPPkniZhJAVPeNGR8N OeglIy6+cwjpHL3X69m7bUsOtnYI4tS/ZKRoF6juD9I+ncL1qoNKgxnx4arKDqnHytta poXnBlDN8Ys/u1+L348YdPj/StgO35paI/6qATtzwntgfmj6XedcFDPJckeu3tdyV1mL CANsQyK1eGBH8945jn24DmY+wy6xAFEgRxofMk37sANTgZbRn1miTOuyD6DVDYshxdlu Gkq5oHMwpTJ0f7uMPVDlpRcGM262L3i8MvlrVXWuy5Ogy3U8LtgLGtsTccw3shlBa0WD lHuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=PYovoE5KC38CEVtZWkrbEo2ldT70OQu9QjFIGugYyN8=; b=DXXXpOZ5qkxeDaXXsKuoj0xqHbgC8JzozhMT/ElisDGL+THBgl+hZE8GLVV0GiX5lQ q5zsppdFqP4QUx2mck+TgBcfhBUrev9cgixzv6+I37sbdT/wPChJFh++xwSoEyJKOHCq uz3uG+W27B769TqNNNVPT+Dfox5gKdWXSIl/DJB6qA9f0pF4lBGQvcUxYsazCmDRHtRD nIX+RVnSMSkbuOyjRB19bsAFoQ5OEe833gmod8XpfRgSCOYpPn/kxgkIwKCUXXAzsXGr DOVyWqKHl3CpDWx2W2TGWN1NcmgA9fT3bx3hrU44ggC0kXFET6wtXQGVKl3p0HL94p6N 3Kzw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of claudius.heine.ext@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=claudius.heine.ext@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from thoth.sbs.de (thoth.sbs.de. [192.35.17.2]) by gmr-mx.google.com with ESMTPS id y70si487229wmd.0.2019.05.23.04.39.58 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 May 2019 04:39:58 -0700 (PDT) Received-SPF: pass (google.com: domain of claudius.heine.ext@siemens.com designates 192.35.17.2 as permitted sender) client-ip=192.35.17.2; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of claudius.heine.ext@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=claudius.heine.ext@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from mail1.sbs.de (mail1.sbs.de [192.129.41.35]) by thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id x4NBdvP3022876 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 23 May 2019 13:39:58 +0200 Received: from ring.ppmd.siemens.net (linux-ses-ext02.ppmd.siemens.net [139.25.69.232]) by mail1.sbs.de (8.15.2/8.15.2) with ESMTP id x4NBdvWI032541; Thu, 23 May 2019 13:39:57 +0200 From: claudius.heine.ext@siemens.com To: isar-users@googlegroups.com Cc: Claudius Heine Subject: [PATCH 4/6] base-apt: fix issues with creating and using the base-apt repository Date: Thu, 23 May 2019 13:39:47 +0200 Message-Id: <20190523113949.20080-5-claudius.heine.ext@siemens.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190523113949.20080-1-claudius.heine.ext@siemens.com> References: <20190523113949.20080-1-claudius.heine.ext@siemens.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUID: C3T2p9cRcXDM From: Claudius Heine 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 --- 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