From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6716822677311455232 X-Received: by 2002:a2e:8613:: with SMTP id a19mr24832637lji.163.1563954814381; Wed, 24 Jul 2019 00:53:34 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a2e:9643:: with SMTP id z3ls5174709ljh.7.gmail; Wed, 24 Jul 2019 00:53:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqzZ6BcLxJXRVxtBUPUAQ5ZhpBqGPznGvMNb7kDRI3qGNEKrmTZZoo6PLvIn4y8NAxjz72uj X-Received: by 2002:a2e:b047:: with SMTP id d7mr1934094ljl.8.1563954813933; Wed, 24 Jul 2019 00:53:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563954813; cv=none; d=google.com; s=arc-20160816; b=RTQ00iKW+J8ofS8QyOwG6LpXSOisLpHraAgtUTa5EgTPhn5vBUe7llT0eg4l1H/6zQ vBm17FS+4FM4GEacrOmg4vE0vx+WpfgUPrnbRjZRM4tmC3q/MBNIUcG04XtySIE7dv9g 97PWIiKcksC5uk10JHYbxIlYiChXX5k2aBwxKufwoOCSyLUsHcf+oTKDlhmA2pA/Nfk4 moBHOGXS6D/ugEN0rCH4nFoOXdQQFyfCQWUqGoLA5DYh0W/RTCKZhPecd8VEUGezKfcf 6ms1wKaEaNFl+95edrfvGPJ9hNQZNJhL98locbbQnfXBbu9aolPJJLEKgxdCVcnFHukf B1PA== 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:subject:cc:to:from:date; bh=N+oWxxZMFjD6Vf9Efm+NTl7EiJySVl0Dt54sunqKcVo=; b=XCjc6od9EAK3qf0Qjpr3XNmxoGGq6C07HW7vBL7H4q19RssklmYUp8+R+H9c92DZqu Bkkp8vzYUutREyyRaa658ltAO2ckyNLmh5F71XNS6LshVmBCvJirIaBbqrsxnATFFT3x J4yqMfjKtjK8FoiH0AFxlofY5V3bbxls66fnCwDdzNxx9trOpas4NpWKGbzSosjPdeSf o14m9NHMEG3yilDXZt+3vXjggtGbAneZvmuUEc1cTDrxScYQbMo1ux6C/D4eg+5dyrG6 nK5TMvT89oYI3PchEy5z4UruY7iSY/LPl+8VZGBVTC0Cd+6Qk19ktQA+Y1rcjVOLa0Fo q3mQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.39 as permitted sender) smtp.mailfrom=henning.schild@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from lizzard.sbs.de (lizzard.sbs.de. [194.138.37.39]) by gmr-mx.google.com with ESMTPS id m84si1503132lje.1.2019.07.24.00.53.33 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Jul 2019 00:53:33 -0700 (PDT) Received-SPF: pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.39 as permitted sender) client-ip=194.138.37.39; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.39 as permitted sender) smtp.mailfrom=henning.schild@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 lizzard.sbs.de (8.15.2/8.15.2) with ESMTPS id x6O7rXOY001402 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 24 Jul 2019 09:53:33 +0200 Received: from md1za8fc.ad001.siemens.net ([139.25.0.86]) by mail1.sbs.de (8.15.2/8.15.2) with ESMTP id x6O7rWNT003970; Wed, 24 Jul 2019 09:53:33 +0200 Date: Wed, 24 Jul 2019 09:53:31 +0200 From: Henning Schild To: Claudius Heine Cc: isar-users Subject: Re: [PATCH 1/2] meta: recipes-support shrink with preconfig instead of postproc Message-ID: <20190724095331.74f96df5@md1za8fc.ad001.siemens.net> In-Reply-To: <7006ba0c-b2af-f7f7-3c12-4c3074f03d9f@siemens.com> References: <20190723114224.22776-1-henning.schild@siemens.com> <7006ba0c-b2af-f7f7-3c12-4c3074f03d9f@siemens.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TUID: /YqoEJEXy89w Am Tue, 23 Jul 2019 14:46:17 +0200 schrieb Claudius Heine : > Hi Henning, > > On 23/07/2019 13.42, [ext] Henning Schild wrote: > > From: Henning Schild > > > > This adds two support packages to shrink an image and keep it small > > in case apt/dpkg will be used on the system later on. > > An alternative would be postprocess functions, they would be > > run-once and if the system continues to receive package updates new > > files will not be cleaned up. > > I really like this solution for this issue. But we should probably > remove the base-apt dependency on the apt cache first so that this > does not break it. That was a reason i posted them so late. But i was also sick of waiting, now those patches are at least public and waiting on a staging branch of my github clone. Since the cache will probably not be repaired any time soon, i could also include a bbwarn in do_install of isar-disable-apt-cache. That way people would see the warning early on and could potentially understand why generating the cache with this package installed will not work. Henning > Cheers, > Claudius > > > > > > Signed-off-by: Henning Schild > > --- > > .../files/isar-disable-apt-cache | 3 +++ > > .../isar-disable-apt-cache_0.1.bb | 13 > > +++++++++++++ .../isar-exclude-docs/files/isar-exclude-docs | > > 11 +++++++++++ .../isar-exclude-docs/files/postinst > > | 7 +++++++ .../isar-exclude-docs/isar-exclude-docs_0.1.bb | > > 14 ++++++++++++++ 5 files changed, 48 insertions(+) > > create mode 100644 > > meta/recipes-support/isar-disable-apt-cache/files/isar-disable-apt-cache > > create mode 100644 > > meta/recipes-support/isar-disable-apt-cache/isar-disable-apt-cache_0.1.bb > > create mode 100644 > > meta/recipes-support/isar-exclude-docs/files/isar-exclude-docs > > create mode 100644 > > meta/recipes-support/isar-exclude-docs/files/postinst create mode > > 100644 > > meta/recipes-support/isar-exclude-docs/isar-exclude-docs_0.1.bb > > > > diff --git > > a/meta/recipes-support/isar-disable-apt-cache/files/isar-disable-apt-cache > > b/meta/recipes-support/isar-disable-apt-cache/files/isar-disable-apt-cache > > new file mode 100644 index 0000000..ff10041 --- /dev/null > > +++ > > b/meta/recipes-support/isar-disable-apt-cache/files/isar-disable-apt-cache > > @@ -0,0 +1,3 @@ +DPkg::Post-Invoke { "rm > > -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin > > || true"; }; +APT::Update::Post-Invoke { "rm > > -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin > > || true"; }; +Dir::Cache::pkgcache ""; Dir::Cache::srcpkgcache ""; > > diff --git > > a/meta/recipes-support/isar-disable-apt-cache/isar-disable-apt-cache_0.1.bb > > b/meta/recipes-support/isar-disable-apt-cache/isar-disable-apt-cache_0.1.bb > > new file mode 100644 index 0000000..7dbd6ed --- /dev/null +++ > > b/meta/recipes-support/isar-disable-apt-cache/isar-disable-apt-cache_0.1.bb > > @@ -0,0 +1,13 @@ +# This software is a part of ISAR. +inherit > > dpkg-raw + > > +DESCRIPTION = "Configuration to disable apt cache" > > +MAINTAINER = "isar-users " > > + > > +SRC_URI = "file://${PN}" > > + > > +do_install[cleandirs] += "${D}/etc/apt/apt.conf.d/" > > + > > +do_install() { > > + install -v -m 644 "${WORKDIR}/${PN}" > > "${D}/etc/apt/apt.conf.d/99${PN}" +} > > diff --git > > a/meta/recipes-support/isar-exclude-docs/files/isar-exclude-docs > > b/meta/recipes-support/isar-exclude-docs/files/isar-exclude-docs > > new file mode 100644 index 0000000..5bec626 --- /dev/null > > +++ b/meta/recipes-support/isar-exclude-docs/files/isar-exclude-docs > > @@ -0,0 +1,11 @@ > > +# Drop all man pages > > +path-exclude=/usr/share/man/* > > + > > +# Drop all documentation ... > > +path-exclude=/usr/share/doc/* > > + > > +# ... except copyright files ... > > +path-include=/usr/share/doc/*/copyright > > + > > +# ... and Debian changelogs > > +path-include=/usr/share/doc/*/changelog.Debian.* > > diff --git a/meta/recipes-support/isar-exclude-docs/files/postinst > > b/meta/recipes-support/isar-exclude-docs/files/postinst new file > > mode 100644 index 0000000..f6c0d1b > > --- /dev/null > > +++ b/meta/recipes-support/isar-exclude-docs/files/postinst > > @@ -0,0 +1,7 @@ > > +#!/bin/sh > > +# we need to do this once right after install, so we can install > > this at any +# time and do not need to be "the first" package > > +# what we delete needs to be in sync with the dpkg configuration > > we ship + > > +rm -rf /usr/share/man/* > > +find /usr/share/doc/ -type f ! -name "copyright" ! -name > > "changelog.Debian.*" -exec rm -rf {} \; diff --git > > a/meta/recipes-support/isar-exclude-docs/isar-exclude-docs_0.1.bb > > b/meta/recipes-support/isar-exclude-docs/isar-exclude-docs_0.1.bb > > new file mode 100644 index 0000000..05c8953 --- /dev/null > > +++ > > b/meta/recipes-support/isar-exclude-docs/isar-exclude-docs_0.1.bb > > @@ -0,0 +1,14 @@ +# This software is a part of ISAR. > > +inherit dpkg-raw > > + > > +DESCRIPTION = "Configuration to exclude most documentation" > > +MAINTAINER = "isar-users " > > + > > +SRC_URI = "file://${PN} \ > > + file://postinst" > > + > > +do_install[cleandirs] += "${D}/etc/dpkg/dpkg.conf.d/" > > + > > +do_install() { > > + install -v -m 644 "${WORKDIR}/${PN}" > > "${D}/etc/dpkg/dpkg.conf.d/99${PN}" +} > > >