public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH 1/2] meta: recipes-support shrink with preconfig instead of postproc
@ 2019-07-23 11:42 Henning Schild
  2019-07-23 11:42 ` [PATCH 2/2] ci_build: test image shrinking packages Henning Schild
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Henning Schild @ 2019-07-23 11:42 UTC (permalink / raw)
  To: isar-users; +Cc: Henning Schild

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.

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}"
+}
-- 
2.21.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 2/2] ci_build: test image shrinking packages
  2019-07-23 11:42 [PATCH 1/2] meta: recipes-support shrink with preconfig instead of postproc Henning Schild
@ 2019-07-23 11:42 ` Henning Schild
  2019-07-23 12:46 ` [PATCH 1/2] meta: recipes-support shrink with preconfig instead of postproc Claudius Heine
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Henning Schild @ 2019-07-23 11:42 UTC (permalink / raw)
  To: isar-users; +Cc: Henning Schild

From: Henning Schild <henning.schild@siemens.com>

Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
 meta-isar/conf/local.conf.sample | 4 +++-
 scripts/ci_build.sh              | 2 ++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/meta-isar/conf/local.conf.sample b/meta-isar/conf/local.conf.sample
index 6f1405f..5b3a0a1 100644
--- a/meta-isar/conf/local.conf.sample
+++ b/meta-isar/conf/local.conf.sample
@@ -161,7 +161,9 @@ CONF_VERSION = "1"
 
 #
 # The default list of extra packages to be installed.
-IMAGE_INSTALL = "hello-isar example-raw example-module-${KERNEL_NAME} enable-fsck"
+IMAGE_INSTALL = "hello-isar example-raw example-module-${KERNEL_NAME} enable-fsck isar-exclude-docs"
+## "cache_base_repo" relies on the cache ...
+#IMAGE_INSTALL += "isar-disable-apt-cache"
 
 #
 # Enable cross-compilation support
diff --git a/scripts/ci_build.sh b/scripts/ci_build.sh
index 01f09b6..f4a8b06 100755
--- a/scripts/ci_build.sh
+++ b/scripts/ci_build.sh
@@ -136,6 +136,8 @@ if [ -n "$REPRO_BUILD" ]; then
     sed -i -e 's/ISAR_USE_CACHED_BASE_REPO ?= "1"/#ISAR_USE_CACHED_BASE_REPO ?= "1"/g' conf/local.conf
 fi
 
+sed -i -e 's/#IMAGE_INSTALL += "isar-disable-apt-cache"/IMAGE_INSTALL += "isar-disable-apt-cache"/g' conf/local.conf
+
 # Start cross build for the defined set of configurations
 sed -i -e 's/ISAR_CROSS_COMPILE ?= "0"/ISAR_CROSS_COMPILE ?= "1"/g' conf/local.conf
 bitbake $BB_ARGS $CROSS_TARGETS_SET
-- 
2.21.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] meta: recipes-support shrink with preconfig instead of postproc
  2019-07-23 11:42 [PATCH 1/2] meta: recipes-support shrink with preconfig instead of postproc Henning Schild
  2019-07-23 11:42 ` [PATCH 2/2] ci_build: test image shrinking packages Henning Schild
@ 2019-07-23 12:46 ` Claudius Heine
  2019-07-24  7:53   ` Henning Schild
  2019-07-24  7:50 ` Henning Schild
  2019-08-05  9:22 ` Baurzhan Ismagulov
  3 siblings, 1 reply; 6+ messages in thread
From: Claudius Heine @ 2019-07-23 12:46 UTC (permalink / raw)
  To: [ext] Henning Schild, isar-users

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.

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}"
> +}
> 

-- 
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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] meta: recipes-support shrink with preconfig instead of postproc
  2019-07-23 11:42 [PATCH 1/2] meta: recipes-support shrink with preconfig instead of postproc 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:50 ` Henning Schild
  2019-08-05  9:22 ` Baurzhan Ismagulov
  3 siblings, 0 replies; 6+ messages in thread
From: Henning Schild @ 2019-07-24  7:50 UTC (permalink / raw)
  To: isar-users

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 <henning.schild@siemens.com>:

> 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.
> 
> 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}" +}


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] meta: recipes-support shrink with preconfig instead of postproc
  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
  0 siblings, 0 replies; 6+ messages in thread
From: Henning Schild @ 2019-07-24  7:53 UTC (permalink / raw)
  To: Claudius Heine; +Cc: isar-users

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}" +}
> >   
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] meta: recipes-support shrink with preconfig instead of postproc
  2019-07-23 11:42 [PATCH 1/2] meta: recipes-support shrink with preconfig instead of postproc Henning Schild
                   ` (2 preceding siblings ...)
  2019-07-24  7:50 ` Henning Schild
@ 2019-08-05  9:22 ` Baurzhan Ismagulov
  3 siblings, 0 replies; 6+ messages in thread
From: Baurzhan Ismagulov @ 2019-08-05  9:22 UTC (permalink / raw)
  To: isar-users

On Tue, Jul 23, 2019 at 01:42:23PM +0200, Henning Schild wrote:
> 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.

Thanks, applied to next.

With kind regards,
Baurzhan.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-08-05  9:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-23 11:42 [PATCH 1/2] meta: recipes-support shrink with preconfig instead of postproc 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
2019-07-24  7:50 ` Henning Schild
2019-08-05  9:22 ` Baurzhan Ismagulov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox