From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6694185847943593984 X-Received: by 2002:a2e:2b58:: with SMTP id q85mr50667842lje.179.1558623620397; Thu, 23 May 2019 08:00:20 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a19:f70a:: with SMTP id z10ls598535lfe.6.gmail; Thu, 23 May 2019 08:00:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqxD7XW6Nemo9lDXbAKhsv2m5KzvpmWl+5c8uRbkmaZ6PLQWuiGQqSgE0incfAHUm1LJoc+p X-Received: by 2002:ac2:48a8:: with SMTP id u8mr1814937lfg.141.1558623619930; Thu, 23 May 2019 08:00:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558623619; cv=none; d=google.com; s=arc-20160816; b=K1nfmB+d3WE7rqzuUFZPVdX76ztTph8DneLc+2KUiIUsulcBad/ur5LX82U5b6iQK2 mDytV7XH14K27ytkvu/U8wfSgIdKflI3ASbvpHJEmun222bI8GN81pjcU8aOZe76+g51 05soD4viBNoAW+yFZAfve68Mh2kWpHXSOvhdTGVklmOtuav0i0Pw9HGxdym/vZMG1dY9 14QtuTNuoGyIOpjyemvRpYM0aS6YBxdRpQNWhI92xVmYZ6nYy1D1QuLImO9kEgD9mbbq QYMj1NlkFZIeko6zsdMY8w5ogYpKd017F7ctAsHG6YMBsqsBnR+8VN8EWvIxNt7qFsRk p1iQ== 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=wR8CczAlxTa2+MAkhkVZGZWR1M7DRa2ELaR0TSRjbz0zR4Q++4Efam75yJ77YagydN PqZYqDuKALwcaerCs1SorfxKM4GwsFa8WJZElEzHfkJR+KAW10PVnKNPBNZrIOUoVjnD 5eskdm9wCjlNc1Q2lT06yd6Rba0MG47kFNKrK+gmb6+tdmVw9uNsMLL1j7+bngP1QDkQ D5SKNEpjLa7Kmen0DpMFv4M8UhWRpyy/Oj6vx11ECTQpKKdhwH/Pj+kd1t1uO8WlKeD4 fDniPx5X+YcKN4RuP0lAIWokkDZoP1fOf+TWwYfKZGH3s7WrF0ERffH8sGtanMKQhuKW dxBg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of claudius.heine.ext@siemens.com designates 192.35.17.28 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 goliath.siemens.de (goliath.siemens.de. [192.35.17.28]) by gmr-mx.google.com with ESMTPS id h3si2033174lfm.3.2019.05.23.08.00.19 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 May 2019 08:00:19 -0700 (PDT) Received-SPF: pass (google.com: domain of claudius.heine.ext@siemens.com designates 192.35.17.28 as permitted sender) client-ip=192.35.17.28; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of claudius.heine.ext@siemens.com designates 192.35.17.28 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 goliath.siemens.de (8.15.2/8.15.2) with ESMTPS id x4NF0IGi020195 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 23 May 2019 17:00:18 +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 x4NF0IaC026127; Thu, 23 May 2019 17:00:18 +0200 From: claudius.heine.ext@siemens.com To: isar-users@googlegroups.com Cc: Claudius Heine 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 Message-Id: <20190523150015.23341-6-claudius.heine.ext@siemens.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190523150015.23341-1-claudius.heine.ext@siemens.com> References: <20190523150015.23341-1-claudius.heine.ext@siemens.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUID: KGx1tfRP8Vzv 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