From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6716822677311455232 X-Received: by 2002:a5d:5303:: with SMTP id e3mr1671037wrv.239.1563885997575; Tue, 23 Jul 2019 05:46:37 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a1c:f711:: with SMTP id v17ls10548472wmh.4.gmail; Tue, 23 Jul 2019 05:46:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqyCp0/HESBm/KUqzCez53+QUPrdfZ6mJSYSImAo35A5rajzac16NIy8QY75Oi4aR5PQCHNy X-Received: by 2002:a05:600c:204c:: with SMTP id p12mr68767164wmg.121.1563885997271; Tue, 23 Jul 2019 05:46:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563885997; cv=none; d=google.com; s=arc-20160816; b=hJ33qiVH6iEkR1+8sfUqdUR6FYlZd81ASoJaK1fOQEWyL6/S2n1DWYMKGgt7cJgmep m3g1BA6JkvEi1bGy2XA2gmfTSAeXTAfgAIQpoZ4gQeHPOMn/PYQKXXD46mUBrkhXeyVD NVHepKE0vqzvaaTwP0MLFInUA4c9goQNIro5LoXLRM+OxjM8KX+DbB/Q8ftWmvHwISS9 5e7MqFP/yL04So2c8WUVzK+CrLbNl9Jli+gitK9zDptQczgz0Uu7v4SyVl4qd3xbIjT7 vcXsYJtLCXPfcHrCwLdgyokej65zHs8SI4bVGVEn5aVl1oofCIfOlH8rO3n94i6ivqWE 8e6Q== 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; bh=x6xHycMoWG+J5/0UsYBwMRilXwBAEAsJzhczO9pkEqI=; b=SyuA435jqvDP5yH7AhmrBqnHNWXGw9eRzemxAZgtIpz17fX0Aern4iupcaorDoCVvZ pmbR5n8E1vLkPN1tLPOe9kKIJpKa5qbukPL4Gauc0olvXl4GmdzQYKkcfa3EfEytkCNR ffS8fHVH5fyoVfrzZSgJOMDqifdBTOtQDIuwjzGuCgRBMCr0G7ARzFRBEGw39LTMmm6c 7uuWdchnQbaMacPxbk1HVM0F3cinqGBKkWtC5BH0YqjQo3AuMHIj0MLL9ackkpUIWE0T 8eErCGMb7aDIcYy9Ddkh5PxjorH2st8h0j+IGKKFkMGKT6+IMfHm6Iq9a4ZmjvXPFtCa NjNw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of claudius.heine.ext@siemens.com designates 192.35.17.14 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 david.siemens.de (david.siemens.de. [192.35.17.14]) by gmr-mx.google.com with ESMTPS id f13si2367481wmc.3.2019.07.23.05.46.37 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Jul 2019 05:46:37 -0700 (PDT) Received-SPF: pass (google.com: domain of claudius.heine.ext@siemens.com designates 192.35.17.14 as permitted sender) client-ip=192.35.17.14; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of claudius.heine.ext@siemens.com designates 192.35.17.14 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 david.siemens.de (8.15.2/8.15.2) with ESMTPS id x6NCkHUc015729 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 23 Jul 2019 14:46:36 +0200 Received: from [139.25.69.208] (linux-ses-ext02.ppmd.siemens.net [139.25.69.208]) by mail1.sbs.de (8.15.2/8.15.2) with ESMTP id x6NCkH2e004049; Tue, 23 Jul 2019 14:46:17 +0200 Subject: Re: [PATCH 1/2] meta: recipes-support shrink with preconfig instead of postproc To: "[ext] Henning Schild" , isar-users References: <20190723114224.22776-1-henning.schild@siemens.com> From: Claudius Heine Message-ID: <7006ba0c-b2af-f7f7-3c12-4c3074f03d9f@siemens.com> Date: Tue, 23 Jul 2019 14:46:17 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.1 MIME-Version: 1.0 In-Reply-To: <20190723114224.22776-1-henning.schild@siemens.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TUID: fHaa7w2Jh2hw 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. 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}" > +} > -- 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