[RFC] rootfs: clean debconf cache files

Message ID 20220506094532.15696-1-venkata.pyla@toshiba-tsip.com
State Superseded, archived
Headers show
Series [RFC] rootfs: clean debconf cache files | expand

Commit Message

venkata.pyla@toshiba-tsip.com May 6, 2022, 1:45 a.m. UTC
From: venkata pyla <venkata.pyla@toshiba-tsip.com>

Cleaning the debconf cache files for the purpose of generating
reproducible system image.

The debconf cache database sometime generates with non-reproducible
contents because of some packages behaviour (e.g: localepurge), reported
this to package bug tracking system[1], but because this problem is not
with one particular package and can happen with other packages also,
this should be solved in common place to address reproducibility
problem, discussing with Reproducible-builds community[2] to find some
common solution for this problem.

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1009639
[2] https://lists.reproducible-builds.org/pipermail/rb-general/2022-April/002546.html

Signed-off-by: venkata pyla <venkata.pyla@toshiba-tsip.com>
Suggested-by: Henning Schild <henning.schild@siemens.com>
---
 meta/classes/image.bbclass  | 2 +-
 meta/classes/rootfs.bbclass | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)

Comments

venkata.pyla@toshiba-tsip.com May 9, 2022, 11:19 p.m. UTC | #1
Hi,

Sorry, somehow my replay mail to the below patch was not went to the mailing list earlier, I am resending.

Please provide your comments for the below patch that will remove the debconf cache files in the isar image.

I am removing these files for the purpose of the solving non-reproducible problem in debconf cache file.
I am also finding solution to not remove these files, by fixing the actual problem in packages who produces the non-reproducible content (information is present in the below commit log)

Also I am checking why not remove these files in isar image.
As I understood, the debconf cache files are used to store the answers of  debconf's questions asked during package installation and same cached information will be used in the next package update/re-install time.
I think in the isar build system the package installation is noninteractive and the debconf cache generates with default data, which is not necessary to store.
If my above understanding is correct, I think we can safely delete the debconf cache file in isar image.

Kindly let me know your feedback on this understanding and provide your suggestions.

Thanks,
Venkata.

>-----Original Message-----
>From: venkata.pyla@toshiba-tsip.com <venkata.pyla@toshiba-tsip.com>
>Sent: 06 May 2022 15:16
>To: isar-users@googlegroups.com
>Cc: pyla venkata(TSIP) <Venkata.Pyla@toshiba-tsip.com>;
>henning.schild@siemens.com; jan.kiszka@siemens.com; dinesh kumar(TSI
>P) <dinesh.kumar@toshiba-tsip.com>; hayashi kazuhiro(林 和宏 □SWC◯AC
>T) <kazuhiro3.hayashi@toshiba.co.jp>
>Subject: [isar][RFC] rootfs: clean debconf cache files
>
>From: venkata pyla <venkata.pyla@toshiba-tsip.com>
>
>Cleaning the debconf cache files for the purpose of generating reproducible
>system image.
>
>The debconf cache database sometime generates with non-reproducible
>contents because of some packages behaviour (e.g: localepurge), reported this
>to package bug tracking system[1], but because this problem is not with one
>particular package and can happen with other packages also, this should be
>solved in common place to address reproducibility problem, discussing with
>Reproducible-builds community[2] to find some common solution for this
>problem.
>
>[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1009639
>[2] https://lists.reproducible-builds.org/pipermail/rb-general/2022-
>April/002546.html
>
>Signed-off-by: venkata pyla <venkata.pyla@toshiba-tsip.com>
>Suggested-by: Henning Schild <henning.schild@siemens.com>
>---
> meta/classes/image.bbclass  | 2 +-
> meta/classes/rootfs.bbclass | 6 ++++++
> 2 files changed, 7 insertions(+), 1 deletion(-)
>
>diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index
>eb879ff..a306bd2 100644
>--- a/meta/classes/image.bbclass
>+++ b/meta/classes/image.bbclass
>@@ -71,7 +71,7 @@ image_do_mounts() {
> }
>
> ROOTFSDIR = "${IMAGE_ROOTFS}"
>-ROOTFS_FEATURES += "clean-package-cache generate-manifest export-dpkg-
>status clean-log-files"
>+ROOTFS_FEATURES += "clean-package-cache generate-manifest export-dpkg-
>status clean-log-files clean-debconf-cache"
> ROOTFS_PACKAGES += "${IMAGE_PREINSTALL} ${IMAGE_INSTALL}"
> ROOTFS_MANIFEST_DEPLOY_DIR ?= "${DEPLOY_DIR_IMAGE}"
> ROOTFS_DPKGSTATUS_DEPLOY_DIR ?= "${DEPLOY_DIR_IMAGE}"
>diff --git a/meta/classes/rootfs.bbclass b/meta/classes/rootfs.bbclass index
>b021e72..78f4ba6 100644
>--- a/meta/classes/rootfs.bbclass
>+++ b/meta/classes/rootfs.bbclass
>@@ -243,6 +243,12 @@ rootfs_postprocess_clean_log_files() {
>         -exec rm -f {} ';'
> }
>
>+ROOTFS_POSTPROCESS_COMMAND +=
>"${@bb.utils.contains('ROOTFS_FEATURES', 'clean-debconf-cache',
>'rootfs_postprocess_clean_debconf_cache', '', d)}"
>+rootfs_postprocess_clean_debconf_cache() {
>+    # Delete debconf cache files
>+    sudo rm -rf "${ROOTFSDIR}/var/cache/debconf/"*
>+}
>+
> ROOTFS_POSTPROCESS_COMMAND +=
>"${@bb.utils.contains('ROOTFS_FEATURES', 'generate-manifest',
>'rootfs_generate_manifest', '', d)}"
> rootfs_generate_manifest () {
>     mkdir -p ${ROOTFS_MANIFEST_DEPLOY_DIR}
>--
>2.20.1
venkata.pyla@toshiba-tsip.com June 8, 2022, 6:40 a.m. UTC | #2
Hi,

Any comments or suggestions on the below patch.

Thanks,
Venkata.
>-----Original Message-----
>From: pyla venkata(TSIP) <Venkata.Pyla@toshiba-tsip.com>
>Sent: 10 May 2022 12:50
>To: isar-users@googlegroups.com
>Cc: henning.schild@siemens.com; jan.kiszka@siemens.com; dinesh kumar(TS
>IP) <dinesh.kumar@toshiba-tsip.com>; hayashi kazuhiro(林 和宏 □SWC◯A
>CT) <kazuhiro3.hayashi@toshiba.co.jp>; pyla venkata(TSIP)
><Venkata.Pyla@toshiba-tsip.com>
>Subject: RE: [isar][RFC] rootfs: clean debconf cache files
>
>Hi,
>
>Sorry, somehow my replay mail to the below patch was not went to the mailing
>list earlier, I am resending.
>
>Please provide your comments for the below patch that will remove the debconf
>cache files in the isar image.
>
>I am removing these files for the purpose of the solving non-reproducible
>problem in debconf cache file.
>I am also finding solution to not remove these files, by fixing the actual problem
>in packages who produces the non-reproducible content (information is present
>in the below commit log)
>
>Also I am checking why not remove these files in isar image.
>As I understood, the debconf cache files are used to store the answers of
>debconf's questions asked during package installation and same cached
>information will be used in the next package update/re-install time.
>I think in the isar build system the package installation is noninteractive and the
>debconf cache generates with default data, which is not necessary to store.
>If my above understanding is correct, I think we can safely delete the debconf
>cache file in isar image.
>
>Kindly let me know your feedback on this understanding and provide your
>suggestions.
>
>Thanks,
>Venkata.
>
>>-----Original Message-----
>>From: venkata.pyla@toshiba-tsip.com <venkata.pyla@toshiba-tsip.com>
>>Sent: 06 May 2022 15:16
>>To: isar-users@googlegroups.com
>>Cc: pyla venkata(TSIP) <Venkata.Pyla@toshiba-tsip.com>;
>>henning.schild@siemens.com; jan.kiszka@siemens.com; dinesh kumar(TSI
>>P) <dinesh.kumar@toshiba-tsip.com>; hayashi kazuhiro(林 和宏 □SWC◯A
>C
>>T) <kazuhiro3.hayashi@toshiba.co.jp>
>>Subject: [isar][RFC] rootfs: clean debconf cache files
>>
>>From: venkata pyla <venkata.pyla@toshiba-tsip.com>
>>
>>Cleaning the debconf cache files for the purpose of generating
>>reproducible system image.
>>
>>The debconf cache database sometime generates with non-reproducible
>>contents because of some packages behaviour (e.g: localepurge),
>>reported this to package bug tracking system[1], but because this
>>problem is not with one particular package and can happen with other
>>packages also, this should be solved in common place to address
>>reproducibility problem, discussing with Reproducible-builds
>>community[2] to find some common solution for this problem.
>>
>>[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1009639
>>[2] https://lists.reproducible-builds.org/pipermail/rb-general/2022-
>>April/002546.html
>>
>>Signed-off-by: venkata pyla <venkata.pyla@toshiba-tsip.com>
>>Suggested-by: Henning Schild <henning.schild@siemens.com>
>>---
>> meta/classes/image.bbclass  | 2 +-
>> meta/classes/rootfs.bbclass | 6 ++++++
>> 2 files changed, 7 insertions(+), 1 deletion(-)
>>
>>diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
>>index
>>eb879ff..a306bd2 100644
>>--- a/meta/classes/image.bbclass
>>+++ b/meta/classes/image.bbclass
>>@@ -71,7 +71,7 @@ image_do_mounts() {
>> }
>>
>> ROOTFSDIR = "${IMAGE_ROOTFS}"
>>-ROOTFS_FEATURES += "clean-package-cache generate-manifest export-dpkg-
>>status clean-log-files"
>>+ROOTFS_FEATURES += "clean-package-cache generate-manifest export-dpkg-
>>status clean-log-files clean-debconf-cache"
>> ROOTFS_PACKAGES += "${IMAGE_PREINSTALL} ${IMAGE_INSTALL}"
>> ROOTFS_MANIFEST_DEPLOY_DIR ?= "${DEPLOY_DIR_IMAGE}"
>> ROOTFS_DPKGSTATUS_DEPLOY_DIR ?= "${DEPLOY_DIR_IMAGE}"
>>diff --git a/meta/classes/rootfs.bbclass b/meta/classes/rootfs.bbclass
>>index
>>b021e72..78f4ba6 100644
>>--- a/meta/classes/rootfs.bbclass
>>+++ b/meta/classes/rootfs.bbclass
>>@@ -243,6 +243,12 @@ rootfs_postprocess_clean_log_files() {
>>         -exec rm -f {} ';'
>> }
>>
>>+ROOTFS_POSTPROCESS_COMMAND +=
>>"${@bb.utils.contains('ROOTFS_FEATURES', 'clean-debconf-cache',
>>'rootfs_postprocess_clean_debconf_cache', '', d)}"
>>+rootfs_postprocess_clean_debconf_cache() {
>>+    # Delete debconf cache files
>>+    sudo rm -rf "${ROOTFSDIR}/var/cache/debconf/"*
>>+}
>>+
>> ROOTFS_POSTPROCESS_COMMAND +=
>>"${@bb.utils.contains('ROOTFS_FEATURES', 'generate-manifest',
>>'rootfs_generate_manifest', '', d)}"
>> rootfs_generate_manifest () {
>>     mkdir -p ${ROOTFS_MANIFEST_DEPLOY_DIR}
>>--
>>2.20.1
Jan Kiszka June 8, 2022, 10:04 p.m. UTC | #3
On 06.05.22 11:45, venkata.pyla@toshiba-tsip.com wrote:
> From: venkata pyla <venkata.pyla@toshiba-tsip.com>
> 
> Cleaning the debconf cache files for the purpose of generating
> reproducible system image.
> 
> The debconf cache database sometime generates with non-reproducible
> contents because of some packages behaviour (e.g: localepurge), reported
> this to package bug tracking system[1], but because this problem is not
> with one particular package and can happen with other packages also,
> this should be solved in common place to address reproducibility
> problem, discussing with Reproducible-builds community[2] to find some
> common solution for this problem.
> 
> [1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1009639
> [2] https://lists.reproducible-builds.org/pipermail/rb-general/2022-April/002546.html
> 
> Signed-off-by: venkata pyla <venkata.pyla@toshiba-tsip.com>
> Suggested-by: Henning Schild <henning.schild@siemens.com>
> ---
>  meta/classes/image.bbclass  | 2 +-
>  meta/classes/rootfs.bbclass | 6 ++++++
>  2 files changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
> index eb879ff..a306bd2 100644
> --- a/meta/classes/image.bbclass
> +++ b/meta/classes/image.bbclass
> @@ -71,7 +71,7 @@ image_do_mounts() {
>  }
>  
>  ROOTFSDIR = "${IMAGE_ROOTFS}"
> -ROOTFS_FEATURES += "clean-package-cache generate-manifest export-dpkg-status clean-log-files"
> +ROOTFS_FEATURES += "clean-package-cache generate-manifest export-dpkg-status clean-log-files clean-debconf-cache"
>  ROOTFS_PACKAGES += "${IMAGE_PREINSTALL} ${IMAGE_INSTALL}"
>  ROOTFS_MANIFEST_DEPLOY_DIR ?= "${DEPLOY_DIR_IMAGE}"
>  ROOTFS_DPKGSTATUS_DEPLOY_DIR ?= "${DEPLOY_DIR_IMAGE}"
> diff --git a/meta/classes/rootfs.bbclass b/meta/classes/rootfs.bbclass
> index b021e72..78f4ba6 100644
> --- a/meta/classes/rootfs.bbclass
> +++ b/meta/classes/rootfs.bbclass
> @@ -243,6 +243,12 @@ rootfs_postprocess_clean_log_files() {
>          -exec rm -f {} ';'
>  }
>  
> +ROOTFS_POSTPROCESS_COMMAND += "${@bb.utils.contains('ROOTFS_FEATURES', 'clean-debconf-cache', 'rootfs_postprocess_clean_debconf_cache', '', d)}"
> +rootfs_postprocess_clean_debconf_cache() {
> +    # Delete debconf cache files
> +    sudo rm -rf "${ROOTFSDIR}/var/cache/debconf/"*
> +}
> +
>  ROOTFS_POSTPROCESS_COMMAND += "${@bb.utils.contains('ROOTFS_FEATURES', 'generate-manifest', 'rootfs_generate_manifest', '', d)}"
>  rootfs_generate_manifest () {
>      mkdir -p ${ROOTFS_MANIFEST_DEPLOY_DIR}

Looks good to me.

Jan
Anton Mikanovich June 9, 2022, 11:41 p.m. UTC | #4
08.06.2022 17:40, Venkata.Pyla@toshiba-tsip.com wrote:
> Hi,
>
> Any comments or suggestions on the below patch.
>
> Thanks,
> Venkata.

Hello,

Patch is ok, we will apply it after upcoming release.
Can you please resend it as a '[PATCH]' meantime?
venkata.pyla@toshiba-tsip.com June 15, 2022, 7:54 p.m. UTC | #5
Hi,

Thanks for the comments, I will resend the patch again.

Thanks,
Venkata.

From: isar-users@googlegroups.com <isar-users@googlegroups.com> On Behalf Of Anton Mikanovich
Sent: 10 June 2022 13:12
To: pyla venkata(TSIP) <Venkata.Pyla@toshiba-tsip.com>; isar-users@googlegroups.com
Cc: henning.schild@siemens.com; jan.kiszka@siemens.com; dinesh kumar(TSIP) <dinesh.kumar@toshiba-tsip.com>; hayashi kazuhiro(林 和宏 □SWC◯ACT) <kazuhiro3.hayashi@toshiba.co.jp>
Subject: Re: [isar][RFC] rootfs: clean debconf cache files

08.06.2022 17:40, Venkata.Pyla@toshiba-tsip.com<mailto:Venkata.Pyla@toshiba-tsip.com> wrote:

Hi,



Any comments or suggestions on the below patch.



Thanks,

Venkata.

Hello,

Patch is ok, we will apply it after upcoming release.
Can you please resend it as a '[PATCH]' meantime?
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com<mailto:isar-users+unsubscribe@googlegroups.com>.
To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/86ba121e-b936-d57c-5fe1-c192730f4b6d%40ilbers.de<https://groups.google.com/d/msgid/isar-users/86ba121e-b936-d57c-5fe1-c192730f4b6d%40ilbers.de?utm_medium=email&utm_source=footer>.

Patch

diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index eb879ff..a306bd2 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -71,7 +71,7 @@  image_do_mounts() {
 }
 
 ROOTFSDIR = "${IMAGE_ROOTFS}"
-ROOTFS_FEATURES += "clean-package-cache generate-manifest export-dpkg-status clean-log-files"
+ROOTFS_FEATURES += "clean-package-cache generate-manifest export-dpkg-status clean-log-files clean-debconf-cache"
 ROOTFS_PACKAGES += "${IMAGE_PREINSTALL} ${IMAGE_INSTALL}"
 ROOTFS_MANIFEST_DEPLOY_DIR ?= "${DEPLOY_DIR_IMAGE}"
 ROOTFS_DPKGSTATUS_DEPLOY_DIR ?= "${DEPLOY_DIR_IMAGE}"
diff --git a/meta/classes/rootfs.bbclass b/meta/classes/rootfs.bbclass
index b021e72..78f4ba6 100644
--- a/meta/classes/rootfs.bbclass
+++ b/meta/classes/rootfs.bbclass
@@ -243,6 +243,12 @@  rootfs_postprocess_clean_log_files() {
         -exec rm -f {} ';'
 }
 
+ROOTFS_POSTPROCESS_COMMAND += "${@bb.utils.contains('ROOTFS_FEATURES', 'clean-debconf-cache', 'rootfs_postprocess_clean_debconf_cache', '', d)}"
+rootfs_postprocess_clean_debconf_cache() {
+    # Delete debconf cache files
+    sudo rm -rf "${ROOTFSDIR}/var/cache/debconf/"*
+}
+
 ROOTFS_POSTPROCESS_COMMAND += "${@bb.utils.contains('ROOTFS_FEATURES', 'generate-manifest', 'rootfs_generate_manifest', '', d)}"
 rootfs_generate_manifest () {
     mkdir -p ${ROOTFS_MANIFEST_DEPLOY_DIR}