public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Henning Schild <henning.schild@siemens.com>
To: Claudius Heine <claudius.heine.ext@siemens.com>
Cc: isar-users <isar-users@googlegroups.com>
Subject: Re: [PATCH 1/2] meta: recipes-support shrink with preconfig instead of postproc
Date: Wed, 24 Jul 2019 09:53:31 +0200	[thread overview]
Message-ID: <20190724095331.74f96df5@md1za8fc.ad001.siemens.net> (raw)
In-Reply-To: <7006ba0c-b2af-f7f7-3c12-4c3074f03d9f@siemens.com>

Am Tue, 23 Jul 2019 14:46:17 +0200
schrieb Claudius Heine <claudius.heine.ext@siemens.com>:

> Hi Henning,
> 
> On 23/07/2019 13.42, [ext] Henning Schild wrote:
> > From: Henning Schild <henning.schild@siemens.com>
> > 
> > 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 <henning.schild@siemens.com>
> > ---
> >   .../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 <isar-users@googlegroups.com>"
> > +
> > +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 <isar-users@googlegroups.com>"
> > +
> > +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}" +}
> >   
> 


  reply	other threads:[~2019-07-24  7:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-23 11:42 Henning Schild
2019-07-23 11:42 ` [PATCH 2/2] ci_build: test image shrinking packages Henning Schild
2019-07-23 12:46 ` [PATCH 1/2] meta: recipes-support shrink with preconfig instead of postproc Claudius Heine
2019-07-24  7:53   ` Henning Schild [this message]
2019-07-24  7:50 ` Henning Schild
2019-08-05  9:22 ` Baurzhan Ismagulov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190724095331.74f96df5@md1za8fc.ad001.siemens.net \
    --to=henning.schild@siemens.com \
    --cc=claudius.heine.ext@siemens.com \
    --cc=isar-users@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox