From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7004754512489480192 X-Received: by 2002:a05:6512:50f:: with SMTP id o15mr8087668lfb.689.1633351013152; Mon, 04 Oct 2021 05:36:53 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6512:3994:: with SMTP id j20ls215787lfu.3.gmail; Mon, 04 Oct 2021 05:36:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzkEin770aXyiYqHyoVV6c0fJML6gEUsELbyNowodrxFe0Yxknx1E8gqtfDmrbP3NHPgYtE X-Received: by 2002:a05:6512:c01:: with SMTP id z1mr13964063lfu.136.1633351012075; Mon, 04 Oct 2021 05:36:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633351012; cv=none; d=google.com; s=arc-20160816; b=SVgc5F82XX6HSzye/Wj8rMtKBCN3O9EyVjItG+uQn/ayyTP4/h9R33PuzE1ixjKgc3 HvhM48n4ZLmlTPMTAQrbAWUGmYsy0bwB3LcAAidsS3C6iF0d5du0ZXiqm97sESeCEr2E a/31UR+ztL309K54QA4eTWf61nYuj24kWHO98zioIdKw5Xozf+2cDwTLScICru3il4jd vMukgyZzf2/yz16E61xqJNaOWjekzt/GwRG385EkEAdAnbggvVObKYbgeLORHTEwLDSo z01J2NDaaB8aqitC3dPxG/OTcbeSATNSFCWngK9x5qYwwXgd36QLcg/aNCiBbFOrM+7A DMUg== 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:cc:to:from:date; bh=wm91w7PGABfTVLKQFWovvXxVmElyPLuLOMSpsAm2W6A=; b=xvc672smmFHaYFvrzZblx2MBDHqgLEb7gBW7yaZSYxULDYB134YiNHrndk7crYq2bX AUanf/G+akIQcL59kfglGxYsZJuZ5CsLLjuxOIAZabLCMr+U5dTXAmPWWR5agK2e9j75 R2mwEd/kRIaJtaSfFo+yM7JeRYI8sClWf6lDi5AGT7WgGEifFa2jOpgOTuUVuizYZ2T9 Q5zSFOR5m7yq1Jjv6o9EUO5up70GWz7w9ET6EJ2NT7NGRwnPjKSni8c2hlKSE+I8IgGx /rBnDqSBppIFMfJyHci8xWcNTk7cmSMARrQmd5ziDu87iPp7+PgjxKr1c50YF0jNJ+3g oIKQ== 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 o4si547832ljj.3.2021.10.04.05.36.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Oct 2021 05:36:52 -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 194CapQP005859 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 4 Oct 2021 14:36:51 +0200 Received: from md1za8fc.ad001.siemens.net ([139.25.0.59]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id 194CapJq016716; Mon, 4 Oct 2021 14:36:51 +0200 Date: Mon, 4 Oct 2021 14:36:50 +0200 From: Henning Schild To: Cc: , Subject: Re: [PATCH v2] rootfs: clean package log files that are not owned by packages Message-ID: <20211004143650.13c04f29@md1za8fc.ad001.siemens.net> In-Reply-To: References: <20210906124831.202ce22f@md1za8fc.ad001.siemens.net> <20211001143748.8711-1-venkata.pyla@toshiba-tsip.com> X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-TUID: b6xXMyS5CLqq Am Mon, 4 Oct 2021 10:47:10 +0000 schrieb : > Hi Jan, >=20 > Thanks for the review, please find my inline comments. >=20 > >-----Original Message----- > >From: Jan Kiszka > >Sent: 04 October 2021 15:26 > >To: pyla venkata(=EF=BC=B4=EF=BC=B3=EF=BC=A9=EF=BC=B0) ; isar- > >users@googlegroups.com > >Cc: henning.schild@siemens.com > >Subject: Re: [PATCH v2] rootfs: clean package log files that are not > >owned by packages > > > >On 01.10.21 16:37, venkata.pyla@toshiba-tsip.com wrote: =20 > >> From: venkata pyla > >> > >> /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 +=3D clean-log-files > >> =20 > > > >Style: Do not indent the commit body. I think this will survive "git > >am" and will make the result look inconsistent. =20 >=20 > Thanks for correcting me, I will send the patch again with corrected > comments. =20 >=20 > > =20 > >> Signed-off-by: venkata pyla > >> --- > >> 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 ?=3D "" > >> # '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 ?=3D "" > >> > >> ROOTFS_APT_ARGS=3D"install --yes -o Debug::pkgProblemResolver=3Dyes" > >> @@ -213,6 +214,15 @@ rootfs_postprocess_clean_package_cache() { > >> sudo rm -rf "${ROOTFSDIR}/var/lib/apt/lists/"* > >> } > >> > >> +ROOTFS_POSTPROCESS_COMMAND +=3D =20 > >"${@bb.utils.contains('ROOTFS_FEATURES', 'clean-log-files', > >'rootfs_postprocess_clean_log_files', '', d)}" =20 > >> +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 +=3D =20 > >"${@bb.utils.contains('ROOTFS_FEATURES', 'generate-manifest', > >'rootfs_generate_manifest', '', d)}" =20 > >> rootfs_generate_manifest () { > >> mkdir -p ${ROOTFS_MANIFEST_DEPLOY_DIR} > >> =20 > > > >Is there any reason why this feature should be default-off? If not, > >I would also add it to image.bbclass, ROOTFS_FEATURES. =20 >=20 > No reasons to set it to off, I taught to enable this feature where it > is required (isar-cip-core), But, It is good idea to enable in > upstream also. >=20 > If no objection I can send the patch with enabling this feature in > image.bbclass Seems to boil down to what i suggested ... even not making it optional at all as long as we do not know of any reason to not clean up. Saving space is someone we can assume anyone will want. Reproducability is just a nice side effect ;) Henning > > > >Jan > > > >-- > >Siemens AG, T RDA IOT > >Corporate Competence Center Embedded Linux =20