Mock and binding directory to chroot

asked 2016-08-11 03:25:57 -0500

cyprix gravatar image

Hi. I have mock (mock-1.2.18-1.el7.noarch) installed on Centos 7 7.2.1511, and need build nginx RPMs for different distro (el 6 and el7). I'm building rpms from user "rpmbuild" who added to group mock. All configs, modules and patches from nginx stored in %topdir/SOURCES/nginx (topdir is /rpmbuild full path will be /rpmbuild/SOURCES/nginx ) and I need to bind this directory to chrooted enviroment for correct building.

I've added in ~/.config/mock.cfg:

config_opts['plugin_conf']['bind_mount_enable'] = True config_opts['plugin_conf']['bind_mount_opts']['dirs'].append(('/rpmbuild/SOURCES', '/builddir/build/SOURCES' ))

And mock give me the error:

ERROR: [Errno 1] Operation not permitted: '/var/lib/mock/epel-7-x86_64/root/builddir/build' ERROR: The most common cause for this error is trying to run /usr/sbin/mock as an unprivileged user. ERROR: Check your path to make sure that /usr/bin/ is listed before /usr/sbin, or manually run /usr/bin/mock to see if that fixes this problem.

I'm build rpm from sources and command for it: mock -r epel-7-x86_64 --spec=nginx-mock.spec --sources=/rpmbuild/SOURCES/ --resultdir=mock/result --buildsrpm

Where is my error?

edit retag flag offensive close merge delete


Your user must be a member of the mock group

aeperezt gravatar imageaeperezt ( 2016-08-11 10:17:04 -0500 )edit

In question you can see:

I'm building rpms from user "rpmbuild" who added to group mock

cyprix gravatar imagecyprix ( 2016-08-11 10:47:02 -0500 )edit