From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6554347564595937280 X-Received: by 2002:adf:e7c7:: with SMTP id e7-v6mr762616wrn.25.1526306320471; Mon, 14 May 2018 06:58:40 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:adf:e981:: with SMTP id h1-v6ls4581115wrm.7.gmail; Mon, 14 May 2018 06:58:40 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpSSwW+x7WPWIi+PQkaKov4AR7E+2oLv+rYWxOSVZtpzOVuO5nxG8PDtPQZaVpr7Q6HtDYo X-Received: by 2002:adf:9141:: with SMTP id j59-v6mr773806wrj.3.1526306320052; Mon, 14 May 2018 06:58:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526306320; cv=none; d=google.com; s=arc-20160816; b=YbaXJhVLEGIu83srBjCu0AUbDzMcH/idywWjXkVwYwOAURyzcaWpz4MnaZRMx7GGT7 5wAWKkkwl/m487XByNh+wF0Y4iHpTExsSgnAkxVFN0tNOO7oYz06ByGLNzM6Dr8+cUuv u+o4QFA8I/vq/Hp/5clGL6CBp0wJibTBw4AsYpExXlLuy03xXOU437LVF9lFept319cW qP1FsM9JcwBgtF5NYLS0wi4rNSU/wjcLKehhR3adTBI40YD34yhG5sBQdVHUnZRVHQA9 Rj8UeyEa3e1zn+gZyBUggHYePFqEqnI/G243jlp+3PUqZwXkZFkgJDtr5/InKKHAWdS5 l9Lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:arc-authentication-results; bh=QN+LmTaOzJYjeHkd7iXwtzRIsapuzRQXdBIFI0GjGbE=; b=Q0eKwqd00w7yGSp7EpMrxFqh+Icwap1wd9byA3CKQDoNTQedLrKrUgVVp+ObJEZo0h meEKelfhRdJs7XG2sUej5xYsy0A8xXmpmIaeVWYd4HoazEsHQcUuAZEJ3sx+8oCDh9r2 JmCNkM0CVTtopJ79A6fpdbq8qkEVdunNji0BGg+NRutLVzSK0GQmK2Q0j4yzMfnZi+Fh UzkA2tYEdhCtHnHuABThBAyU5w1ikaM+eQF1knbR7x9Ml/hQtC/LQMx3Ap2mr9+vYFJY XvxXUIuYg9PMFSiOpD4rY9oPUVqpOE+BEt2lnztn1qcD4rjZOQnzsMdprg3G2SoPWTd3 lOwQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: best guess record for domain of asmirnov@ilbers.de designates 85.214.62.211 as permitted sender) smtp.mailfrom=asmirnov@ilbers.de Return-Path: Received: from aqmola.ilbers.de (aqmola.ilbers.de. [85.214.62.211]) by gmr-mx.google.com with ESMTPS id z83-v6si476950wmc.0.2018.05.14.06.58.39 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 May 2018 06:58:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of asmirnov@ilbers.de designates 85.214.62.211 as permitted sender) client-ip=85.214.62.211; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: best guess record for domain of asmirnov@ilbers.de designates 85.214.62.211 as permitted sender) smtp.mailfrom=asmirnov@ilbers.de Received: from localhost.localdomain ([188.227.110.165]) (authenticated bits=0) by aqmola.ilbers.de (8.14.4/8.14.4/Debian-4+deb7u1) with ESMTP id w4EDwNYm011764 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 14 May 2018 15:58:30 +0200 From: Alexander Smirnov To: isar-users@googlegroups.com Cc: Alexander Smirnov Subject: [PATCH v3] debootstrap: Add fallback apt cache support Date: Mon, 14 May 2018 16:58:16 +0300 Message-Id: <20180514135816.6914-1-asmirnov@ilbers.de> X-Mailer: git-send-email 2.9.5 X-TUID: ip9rG7KuySUI Add apt config file to switch caching mechanism from MMap to array-based. This needed to provide possibility to build fresh Isar suites on old hosts. For example, building Isar stretch on jessie host fails with the following error: Hit:1 http://security.debian.org stretch/updates InRelease Ign:2 http://ftp.de.debian.org/debian stretch InRelease Hit:3 http://ftp.de.debian.org/debian stretch-updates InRelease Hit:4 http://ftp.de.debian.org/debian stretch Release E: Dynamic MMap ran out of room. Please increase the size of APT::Cache-Start. Current value: 25165824. (man 5 apt.conf) qemu: uncaught target signal 11 (Segmentation fault) - core dumped Segmentation fault Now Isar performs the following: 1. Checking if user attempts to build stretch on old kernels 2. Temporarly installing this apt config file. 3. Removing this file after image rootfs creation So this file will not go to target rootfs. Signed-off-by: Alexander Smirnov --- meta-isar/recipes-core/images/isar-image-base.bb | 1 + .../isar-bootstrap/files/isar-apt-fallback.conf | 4 ++++ meta/recipes-core/isar-bootstrap/isar-bootstrap.bb | 15 ++++++++++++++- 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-core/isar-bootstrap/files/isar-apt-fallback.conf diff --git a/meta-isar/recipes-core/images/isar-image-base.bb b/meta-isar/recipes-core/images/isar-image-base.bb index 04c92ab..5ad6df3 100644 --- a/meta-isar/recipes-core/images/isar-image-base.bb +++ b/meta-isar/recipes-core/images/isar-image-base.bb @@ -45,4 +45,5 @@ do_rootfs() { sudo rmdir ${IMAGE_ROOTFS}/isar-apt sudo umount -l ${IMAGE_ROOTFS}/dev sudo umount -l ${IMAGE_ROOTFS}/proc + sudo rm -f "${IMAGE_ROOTFS}/etc/apt/apt.conf.d/55isar-fallback.conf" } diff --git a/meta/recipes-core/isar-bootstrap/files/isar-apt-fallback.conf b/meta/recipes-core/isar-bootstrap/files/isar-apt-fallback.conf new file mode 100644 index 0000000..12ddbea --- /dev/null +++ b/meta/recipes-core/isar-bootstrap/files/isar-apt-fallback.conf @@ -0,0 +1,4 @@ +# Switch apt caching mechanism from mmap to array-based. +# This helps to build fresh Isar suites on old hosts. + +APT::Cache-Fallback "1"; diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.bb b/meta/recipes-core/isar-bootstrap/isar-bootstrap.bb index 97b6640..c9a3d98 100644 --- a/meta/recipes-core/isar-bootstrap/isar-bootstrap.bb +++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap.bb @@ -10,7 +10,9 @@ Description = "Minimal debian root file system" LICENSE = "gpl-2.0" LIC_FILES_CHKSUM = "file://${LAYERDIR_isar}/licenses/COPYING.GPLv2;md5=751419260aa954499f7abaabaa882bbe" FILESPATH_prepend := "${THISDIR}/files:" -SRC_URI = "file://isar-apt.conf" +SRC_URI = " \ + file://isar-apt.conf \ + file://isar-apt-fallback.conf" PV = "1.0" WORKDIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/${PN}" @@ -189,6 +191,11 @@ do_bootstrap() { } addtask bootstrap before do_build after do_generate_keyring +def get_host_release(): + import platform + rel = platform.release() + return rel + do_apt_config_install[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}" do_apt_config_install() { sudo mkdir -p "${ROOTFSDIR}/etc/apt/preferences.d" @@ -201,6 +208,12 @@ do_apt_config_install() { sudo mkdir -p "${ROOTFSDIR}/etc/apt/apt.conf.d" sudo install -v -m644 "${WORKDIR}/isar-apt.conf" \ "${ROOTFSDIR}/etc/apt/apt.conf.d/50isar.conf" + + if [ "${@get_distro_suite(d)}" = "stretch" ] && [ "${@get_host_release().split('.')[0]}" -lt "4" ]; then + sudo install -v -m644 "${WORKDIR}/isar-apt-fallback.conf" \ + "${ROOTFSDIR}/etc/apt/apt.conf.d/55isar-fallback.conf" + fi + } addtask apt_config_install before do_build after do_bootstrap do_apt_config_prepare -- 2.1.4