Closed kgilmer closed 4 years ago
Thank you for reporting and investigating the problem.
As you might guess, clearing cache allows to build smaller images. Usually cache data is just a mean of speeding up things, so ideally it should not be a problem to remove it... Some distributions even mount this directory in RAM!
So it would be better to narrow down the problem, and maybe improve the filter to keep precisely the files we need. Could you check if, in your case, there are other things in var/cache
when this cleanup procedure is called? And are you sure the error message you get about missing locale is related to this problem?
Thank you!
Could you check if, in your case, there are other things in var/cache when this cleanup procedure is called?
Yes, here is what I see in the chroot directory if I disable the deletion of /var/cache
:
$ ls /tmp/chroot21/chroot/var/cache/
apparmor cracklib dictionaries-common ldconfig man private
apt debconf fontconfig lightdm PackageKit
And are you sure the error message you get about missing locale is related to this problem?
I cannot prove a causal relationship. However the following findings lead me to believe this is the root cause to my issue:
$ cat /tmp/chroot21/chroot/etc/debconf.conf | grep -v ^#
Config: configdb Templates: templatedb
Name: config Driver: File Mode: 644 Reject-Type: password Filename: /var/cache/debconf/config.dat
Name: passwords Driver: File Mode: 600 Backup: false Required: false Accept-Type: password Filename: /var/cache/debconf/passwords.dat
Name: configdb Driver: Stack Stack: config, passwords
Name: templatedb Driver: File Mode: 644 Filename: /var/cache/debconf/templates.dat
2. When I first try to run Ubiqity and get the error, then run `dpkg-reconfigure ubiqutiy` I diff the file system and the only changes (outside of virtual filesystems like /proc and /sys) are the files in `/var/cache/debconf`.
3. The error given by debconf when ubiquty crashes reference strings that are contained in that cache file (`debian-installer/locale`)
4. I have tried many things in my chroot configuration script and none have them have any impact to the error, leading me to believe it's something that occurs after [my chroot script](https://github.com/regolith-linux/regolith-builder/blob/master/iso-build/init-chroot.sh) is complete.
5. By not deleting `/var/cache/debconf` the problem goes away.
I found this page regarding the policy of /var/cache
and it seems that debconf should not be using this directory if it results in an application not being able to start. Hard to say if the fault is in Ubiquity, d-i, or debconf itself.
OK. Thanks for the investigation. Then I would suggest we specifically preserve /var/cache/debconf
and remove all the rest in /var/cache
. (Some files there can be quite big, such as the apt cache.)
Something like this:
rm -rf proc/* sys/* dev/* tmp/* \
$(find run -type f) $(ls -1d /var/cache/* | grep -v 'debconf$') var/lock
I am building an Ubuntu based live installer environment using debootstick. I find that upon first boot of an image (via kvm) that the ubiquity installer fails with an error. I believe this error is due to the removal of
/var/cache/debconf
increate-image/common/finalize
, as when I update this script to not delete that directory, ubiquity works as expected. The update is to removevar/cache/*
from the following line in finalize:Steps to reproduce:
expected result:
actual result:
/var/log/installer/debug
.