public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: venkata.pyla@toshiba-tsip.com, isar-users@googlegroups.com
Cc: henning.schild@siemens.com
Subject: Re: [PATCH v2] rootfs: clean package log files that are not owned by packages
Date: Mon, 4 Oct 2021 11:55:46 +0200	[thread overview]
Message-ID: <e715c9b5-e7db-4370-5422-cc7c24d7db1a@siemens.com> (raw)
In-Reply-To: <20211001143748.8711-1-venkata.pyla@toshiba-tsip.com>

On 01.10.21 16:37, venkata.pyla@toshiba-tsip.com wrote:
> From: venkata pyla <venkata.pyla@toshiba-tsip.com>
> 
>  /var/log/* files that are created during build stage and not owned
>  by any package are not neccessary to be present in rootfs image, as
>  these log files adds additional size to rootfs image, and also it
>  create problems for reproducible build functionality.
> 
>  so this ROOTFS feature 'clean-log-files' should help to clean the log
>  files when it is enalbed, disable it if we need the log files for
>  debugging purpose.
> 
>  ROOTFS_FEATURE += clean-log-files
> 

Style: Do not indent the commit body. I think this will survive "git am"
and will make the result look inconsistent.

> Signed-off-by: venkata pyla <venkata.pyla@toshiba-tsip.com>
> ---
>  meta/classes/rootfs.bbclass | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/meta/classes/rootfs.bbclass b/meta/classes/rootfs.bbclass
> index f9151c5..ff0ecad 100644
> --- a/meta/classes/rootfs.bbclass
> +++ b/meta/classes/rootfs.bbclass
> @@ -12,6 +12,7 @@ ROOTFS_PACKAGES ?= ""
>  # 'clean-package-cache' - delete package cache from rootfs
>  # 'generate-manifest' - generate a package manifest of the rootfs into ${ROOTFS_MANIFEST_DEPLOY_DIR}
>  # 'export-dpkg-status' - exports /var/lib/dpkg/status file to ${ROOTFS_DPKGSTATUS_DEPLOY_DIR}
> +# 'clean-log-files' - delete log files that are not owned by packages
>  ROOTFS_FEATURES ?= ""
>  
>  ROOTFS_APT_ARGS="install --yes -o Debug::pkgProblemResolver=yes"
> @@ -213,6 +214,15 @@ rootfs_postprocess_clean_package_cache() {
>      sudo rm -rf "${ROOTFSDIR}/var/lib/apt/lists/"*
>  }
>  
> +ROOTFS_POSTPROCESS_COMMAND += "${@bb.utils.contains('ROOTFS_FEATURES', 'clean-log-files', 'rootfs_postprocess_clean_log_files', '', d)}"
> +rootfs_postprocess_clean_log_files() {
> +    # Delete log files that are not owned by packages
> +    sudo -E chroot '${ROOTFSDIR}' \
> +        /usr/bin/find /var/log/ \
> +        -exec sh -c '! dpkg -S {} > /dev/null 2>&1' ';' \
> +        -exec rm -rf {} ';'
> +}
> +
>  ROOTFS_POSTPROCESS_COMMAND += "${@bb.utils.contains('ROOTFS_FEATURES', 'generate-manifest', 'rootfs_generate_manifest', '', d)}"
>  rootfs_generate_manifest () {
>      mkdir -p ${ROOTFS_MANIFEST_DEPLOY_DIR}
> 

Is there any reason why this feature should be default-off? If not, I
would also add it to image.bbclass, ROOTFS_FEATURES.

Jan

-- 
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux

  reply	other threads:[~2021-10-04  9:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-06  9:45 [isar] rootfs: Add new ROOTFS_FEATURE 'slimfy' to minimize the footprint venkata.pyla
2021-09-06 10:13 ` Jan Kiszka
2021-09-06 10:48 ` Henning Schild
2021-10-01 14:37   ` [PATCH v2] rootfs: clean package log files that are not owned by packages venkata.pyla
2021-10-04  9:55     ` Jan Kiszka [this message]
2021-10-04 10:47       ` Venkata.Pyla
2021-10-04 12:36         ` Henning Schild
2021-10-04 12:05     ` Henning Schild
2021-10-04 12:51       ` Venkata.Pyla
2021-10-04 13:48         ` Henning Schild
2021-10-04 15:07           ` Venkata.Pyla
2021-10-04 16:45             ` Henning Schild

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=e715c9b5-e7db-4370-5422-cc7c24d7db1a@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=henning.schild@siemens.com \
    --cc=isar-users@googlegroups.com \
    --cc=venkata.pyla@toshiba-tsip.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