From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6554347564595937280 X-Received: by 2002:a2e:9254:: with SMTP id v20-v6mr886831ljg.7.1526290041722; Mon, 14 May 2018 02:27:21 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a2e:7813:: with SMTP id t19-v6ls1634686ljc.5.gmail; Mon, 14 May 2018 02:27:21 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoFbBqWzoOezM9PQ3XsJ0q/NrulYcrc3n0EhlZoX+jEErMer30+EgsYP/DFr8iUzBmmBuQ6 X-Received: by 2002:a2e:21da:: with SMTP id h87-v6mr859374lji.21.1526290041201; Mon, 14 May 2018 02:27:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526290041; cv=none; d=google.com; s=arc-20160816; b=tNn/sUvpWgpJy4h1xib/W6SsyrIs9O/3+f0b8VKPicNeeYckYdiKiQ+9cp6Ce7FQwu 9KAAq3/pHn+7yL5o3W30WZSFBYfhVkKPARAwpBkt1bmdR6tszFHDYviCXuzKAKM5I6QW f94yAIt47YWAaEUZJ1E4C7WTUshYGr/I5K9ZfSRYLWcGwTn9h+oQu5qAReT9mfalPFIE PcdPzgix3yGR1qYWMz5YG5C5qdODH34G4svfKjsAqki1Aak/ZKLxm2T8Qtw+877S75bD QTc8Dj9y9aM49zmAiPqFUiMB8Xw3pgJq5SA5GHHqBhuLjJE10nC+ec2aOtu9uLx5InZC atPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:to:subject :arc-authentication-results; bh=ybf3ZXxN4xbMtVGc996CkfXvDMQOf6IwjiM2rOILqmg=; b=l2P74MqcNuuKSzHgVneId+fa2kd3kgLAKsxJ2v/PkQgQd9ppa2qHV0y0EPFlBBorWY 8kxHUBt2r14sh87Texe8T7JS77P1Jy/wxOY5249ygvkL6xGvve183uYbe8w8AOEnZJSd uJKnl3OFs6kQCaQnuo7jdlWLNJRhfPcpl4f+M+8dC86cA9vjodnRpKY4qdN8fHCdMw7a OGYUH2tG1yf4cPmbEs2Vixcvv8P9O1BQS3a0V6BbA0Uh2BH9z36wUlChQYpWhsGTP/hA FU5bb0nSNayAt5Vb1j6nu3MpVGQFzKKzKtnH4oNBPHTbF/jQ8KhSnnLC54ZJq3y1D1lA at7A== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of claudius.heine.ext@siemens.com designates 194.138.37.40 as permitted sender) smtp.mailfrom=claudius.heine.ext@siemens.com Return-Path: Received: from gecko.sbs.de (gecko.sbs.de. [194.138.37.40]) by gmr-mx.google.com with ESMTPS id h5-v6si433056lfc.4.2018.05.14.02.27.21 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 May 2018 02:27:21 -0700 (PDT) Received-SPF: pass (google.com: domain of claudius.heine.ext@siemens.com designates 194.138.37.40 as permitted sender) client-ip=194.138.37.40; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of claudius.heine.ext@siemens.com designates 194.138.37.40 as permitted sender) smtp.mailfrom=claudius.heine.ext@siemens.com Received: from mail1.sbs.de (mail1.sbs.de [192.129.41.35]) by gecko.sbs.de (8.15.2/8.15.2) with ESMTPS id w4E9RK9x026836 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 14 May 2018 11:27:20 +0200 Received: from [139.25.69.69] (linux-ses-ext02.ppmd.siemens.net [139.25.69.69]) by mail1.sbs.de (8.15.2/8.15.2) with ESMTP id w4E9RKw2014757; Mon, 14 May 2018 11:27:20 +0200 Subject: Re: [PATCH] debootstrap: Add fallback apt cache support To: Alexander Smirnov , isar-users@googlegroups.com References: <20180511153538.13665-1-asmirnov@ilbers.de> From: Claudius Heine Message-ID: <8de008f9-7bb8-415a-8dcb-08cfa846a701@siemens.com> Date: Mon, 14 May 2018 11:27:20 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180511153538.13665-1-asmirnov@ilbers.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TUID: abP1F3PuP4/3 Hi Alex, so I guess that this patch replaces the 'isar-bootstrap: Increase cache room' one right? On 2018-05-11 17:35, Alexander Smirnov wrote: > 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 | 2 ++ > .../isar-bootstrap/files/isar-apt-fallback.conf | 4 ++++ > meta/recipes-core/isar-bootstrap/isar-bootstrap.bb | 17 ++++++++++++++++- > 3 files changed, 22 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 00e926a..d65b1f1 100644 > --- a/meta-isar/recipes-core/images/isar-image-base.bb > +++ b/meta-isar/recipes-core/images/isar-image-base.bb > @@ -53,4 +53,6 @@ do_rootfs() { > sudo rmdir ${IMAGE_ROOTFS}/isar-apt > sudo umount -l ${IMAGE_ROOTFS}/dev > sudo umount -l ${IMAGE_ROOTFS}/proc > + [ -e "${IMAGE_ROOTFS}/etc/apt/apt.conf.d/55isar-fallback.conf" ] && \ > + sudo rm "${IMAGE_ROOTFS}/etc/apt/apt.conf.d/55isar-fallback.conf" || true Why not just '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 a38dd88..a3a3a2b 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}" > @@ -165,6 +167,13 @@ do_bootstrap() { > } > addtask bootstrap before do_build after do_apt_config_prepare > > +def get_host_release(): > + import platform > + rel = platform.release() > + return rel > + > +HOST_KERN_VER = "${@get_host_release().split('.')[0]}" If you need this variable in just one place. It might be useful to just add it there. > + > do_apt_config_install[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}" > do_apt_config_install() { > sudo mkdir -p "${ROOTFSDIR}/etc/apt/preferences.d" > @@ -177,6 +186,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" ] && [ "${HOST_KERN_VER}" -lt "4" ]; then Like this: if [ "${@get_distro_suite(d)}" = "stretch" ] && [ "${@get_host_release().split('.')[0]}" -lt "4" ]; then Or is it useful to overwrite this variable somewhere? > + 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 Apart from those small nitpicks it looks good, Claudius -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-54 Fax: (+49)-8142-66989-80 Email: ch@denx.de