Description of problem:
Adding bind mount directory in plugin dir config does not correctly exclude from tar file root cache archive.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. add a mount point in /etc/mock/MYCONFIG.cfg:
2. mock --scrub=all; mock --verbose --trace --init
3. tar tzvf cache_topdir/MYCONFIG/root_cache/archive.tar.gz | grep /binddir
archive.tar.gz has /binddir and all its subdirectories
/binddir and its subdirectories should not be added in archive.tar.gz
I use a custom config_opts['basedir']='/MOCKBASEDIR' and config_opts['cache_topdir']='/MOCKBASEDIR/cache'
The output of mock --verbose --trace shows that the /binddir is excluded, but instead of in the form of "--exclude ./binddir" as in other directories, it has the form "--exclude /MOCKBASEDIR/root/binddir". I believe this is incorrect.
There is a workaround: for each bind directory, add a copy in cache_root plugin exclude_dir manually in the configuration.
Just to let you know, the source directory and mock base are in the same filesystem, so --one-file-system option of tar wouldn't have excluded the bind mount directory.
I could not reproduce.
$ sudo mkdir /foobar
$ sudo touch /foobar/bar
$ cp /etc/mock/fedora-21-x86_64.cfg /tmp/my-fedora-21-x86_64.cfg
I put at the top of /tmp/my-fedora-21-x86_64.cfg:
config_opts['plugin_conf']['bind_mount_enable'] = True
$ mock --scrub=all -r /tmp/my-fedora-21-x86_64.cfg
$ ls /var/cache/mock/fedora-21-x86_64/root_cache/cache.tar.gz
ls: cannot access /var/cache/mock/fedora-21-x86_64/root_cache/cache.tar.gz: No such file or directory
$ mock -r /tmp/my-fedora-21-x86_64.cfg --init
$ tar tzvf /var/cache/mock/fedora-21-x86_64/root_cache/cache.tar.gz |grep bindir
$ ls -l /var/cache/mock/fedora-21-x86_64/root_cache/cache.tar.gz
-rw-rw-r-- 1 root mock 170400232 Apr 10 18:10 /var/cache/mock/fedora-21-x86_64/root_cache/cache.tar.gz
Ahh.. you are using different basedir and cache_topdir. This will be the cause. Looking into it.
Oh I have typo in that grep.
So I can reproduce it even without moving basedir and cache_topdir.
tar tzvf /var/cache/mock/fedora-21-x86_64/root_cache/cache.tar.gz |grep binddir
drwxr-xr-x root/root 0 2015-04-10 17:58 ./binddir/
-rw-r--r-- root/root 0 2015-04-10 17:58 ./binddir/bar
Notes for myself:
['--exclude=./proc', '--exclude=./sys', '--exclude=./dev', '--exclude=./tmp/ccache', '--exclude=./var/cache/yum', '--exclude=./var/lib/mock/fedora-21-x86_64/root/proc', '--exclude=./var/lib/mock/fedora-21-x86_64/root/sys', '--exclude=./var/lib/mock/fedora-21-x86_64/root/dev/shm', '--exclude=./var/lib/mock/fedora-21-x86_64/root/dev/pts', '--exclude=./var/lib/mock/fedora-21-x86_64/root/var/cache/yum', '--exclude=./var/lib/mock/fedora-21-x86_64/root/binddir', '--exclude=./var/lib/mock/fedora-21-x86_64/root/tmp/ccache']
so we should not pass source of mount but destination of mount.
* 13ebf5a if mountpoint is inside chroot, remove chroot part [RHBZ#1208299]
mock-1.2.8-1.fc22 has been submitted as an update for Fedora 22.
mock-1.2.8-1.fc21 has been submitted as an update for Fedora 21.
mock-1.2.8-1.fc20 has been submitted as an update for Fedora 20.
mock-1.2.8-1.el7 has been submitted as an update for Fedora EPEL 7.
mock-1.2.8-1.el6 has been submitted as an update for Fedora EPEL 6.
* should fix your issue,
* was pushed to the Fedora EPEL 7 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=epel-testing mock-1.2.8-1.el7'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).
mock-1.2.8-1.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.
mock-1.2.8-1.fc21 has been pushed to the Fedora 21 stable repository. If problems still persist, please make note of it in this bug report.
mock-1.2.8-1.fc20 has been pushed to the Fedora 20 stable repository. If problems still persist, please make note of it in this bug report.
mock-1.2.10-1.el7 has been submitted as an update for Fedora EPEL 7.
mock-1.2.10-1.el6 has been submitted as an update for Fedora EPEL 6.
mock-1.2.10-1.el6 has been pushed to the Fedora EPEL 6 stable repository. If problems still persist, please make note of it in this bug report.
mock-1.2.10-1.el7 has been pushed to the Fedora EPEL 7 stable repository. If problems still persist, please make note of it in this bug report.