From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6716822677311455232 X-Received: by 2002:ac2:44b1:: with SMTP id c17mr26901171lfm.87.1563954617251; Wed, 24 Jul 2019 00:50:17 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a19:4f47:: with SMTP id a7ls3717881lfk.1.gmail; Wed, 24 Jul 2019 00:50:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqyPf6dFDOL9HWuyyUs5zlebpvU7d+BCpnJLnO54hHtwfxD9TPqB/zQF/xyFNnKycUEV8qm9 X-Received: by 2002:ac2:4d1c:: with SMTP id r28mr36296784lfi.159.1563954616636; Wed, 24 Jul 2019 00:50:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563954616; cv=none; d=google.com; s=arc-20160816; b=vp4Ehv1TK27cWWr1iWcXYP0RipuvFEjn0+gw08sUoiHulldLdX4cqBwFnIjXFuKPJU 5QAxzm5HogGF63AQIoM+1KXXPc4n09v3+4gcKNzyturmJdWNo+Lktjs2fdnAbeDHm+/p MzKDkfCbCXanIcAmAN1kievbP/tA8PsHkfZ9W0wc6HKHxc5XYObnNOJG/+XW+6ZAo8Db Y1XFyK74845gr/40FMjOl1zGLQvgm87BGL41rPY/vRHjTwRcCULdyKSIf5zjAS5CVLnp A8BAb988ERG9Cmkpw0nW/hOxxrT4xEExtCLHRDu71wxn82v/Sv65AxT7FWoouEg/tI97 U87Q== 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:to:from:date; bh=miSh94oCByfNf61GHrE+Ut6TSnGNfBaaaJ0Wcf5pp0E=; b=waJHBjWjvQNLFpZHkLLgnyNKVPbN0ZNnF1cCyFetT+0lA0A1Tu1ryVxzSbVd44GdSt Yaft1qniUq7uG9qZe/JxGodXj27FeNG629DMdYeH8xDe5VJenE54Qp3LuzYzbZOCKffl RtRC5cp2KtyjlZUIyFQatJvcVOJOHBYzbpKD/RUhOXnWRYD3dnxAV9TOUV1rTsN/H6Tx KPNLT+N3F8pOjoauudNs4R7Ts6dG6H/rQNkxXjBkan5LaBnV4COy7W2RaSrwKXfvIGkx kaakUaXXTtGiAqs43Ti3gZw5VrDF+RqH2gr3VHW+wXKINV2y5rETFwdU/Yrf2PZMGMsa 2XZQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.14 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 david.siemens.de (david.siemens.de. [192.35.17.14]) by gmr-mx.google.com with ESMTPS id r27si1937652ljn.3.2019.07.24.00.50.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Jul 2019 00:50:16 -0700 (PDT) Received-SPF: pass (google.com: domain of henning.schild@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 henning.schild@siemens.com designates 192.35.17.14 as permitted sender) smtp.mailfrom=henning.schild@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by david.siemens.de (8.15.2/8.15.2) with ESMTPS id x6O7oFTg028627 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 24 Jul 2019 09:50:15 +0200 Received: from md1za8fc.ad001.siemens.net ([139.25.0.86]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id x6O7oFhX021039 for ; Wed, 24 Jul 2019 09:50:15 +0200 Date: Wed, 24 Jul 2019 09:50:14 +0200 From: Henning Schild To: isar-users Subject: Re: [PATCH 1/2] meta: recipes-support shrink with preconfig instead of postproc Message-ID: <20190724095014.1225974e@md1za8fc.ad001.siemens.net> In-Reply-To: <20190723114224.22776-1-henning.schild@siemens.com> References: <20190723114224.22776-1-henning.schild@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: FFxuENTtoKJK The config files are taken from ubuntu docker containers. That should be mentioned as origin somewhere. Maybe we can even SRC_URI them from ubuntu? Henning Am Tue, 23 Jul 2019 13:42:23 +0200 schrieb Henning Schild : > 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. > > 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}" +}