mock
支持根据不同的配置文件跨操作系统隔离OS环境,mock
最常用的方式是制作RPM
包,共构造环境的能力看,与Docker很类似。本文介绍基于mock
和rpm-build
沟通RPM
打包环境。
环境搭建
yum install -y mock rpm-build
usermod -a -G mock builder
使用
初始化mock环境
$ mock -r epel-7-x86_64 --no-clean --no-cleanup-after --init
安装依赖RPM包
$ mock -r epel-7-x86_64 --no-clean --no-cleanup-after --init install wget
rebuild
$ mock -r epel-7-x86_64 --no-clean --no-cleanup-after --rebuild ${topdir}/SRPMS/${srpm_file} -vvv
定制YUM源
根据环境不同,修改/etc/mock
目录下的文件,示例需要修改/etc/mock/epel-7-x86_64.cfg
,该文件渲染/var/lib/mock/epel-7-x86_64/root/etc/yum/yum.conf
文件。
chroot 进入mock root
进入后类似于操作系统,mock
基于该方式实现隔离
[root@f413143d0418 rpmbuild]# cd /var/lib/mock/epel-7-x86_64/root/
[root@f413143d0418 root]# chroot .
sh-4.2# pwd
/
sh-4.2# ls -lhart
total 72K
drwxr-xr-x 2 root root 4.0K Apr 11 2016 srv
dr-xr-x--- 2 root root 4.0K Apr 11 2016 root
drwxr-xr-x 2 root root 4.0K Apr 11 2016 opt
drwxr-xr-x 2 root root 4.0K Apr 11 2016 mnt
drwxr-xr-x 2 root root 4.0K Apr 11 2016 media
drwxr-xr-x 2 root root 4.0K Apr 11 2016 home
dr-xr-xr-x 2 root root 4.0K Apr 11 2016 boot
lrwxrwxrwx 1 root root 8 Mar 8 10:09 sbin -> usr/sbin
lrwxrwxrwx 1 root root 9 Mar 8 10:09 lib64 -> usr/lib64
lrwxrwxrwx 1 root root 7 Mar 8 10:09 lib -> usr/lib
lrwxrwxrwx 1 root root 7 Mar 8 10:09 bin -> usr/bin
drwxr-xr-x 13 root root 4.0K Mar 8 10:09 usr
drwxr-xr-x 18 root root 4.0K Mar 8 10:10 var
-rw-rw-r-- 1 root root 0 Mar 8 10:10 .initialized
drwxrwxr-x 2 root root 4.0K Mar 8 13:25 proc
drwxrwxr-x 2 root root 4.0K Mar 8 13:25 sys
drwxrwxrwt 8 root root 4.0K Mar 8 13:25 tmp
drwxrwxr-x 4 root root 4.0K Mar 8 13:25 dev
drwxr-xr-x 48 root root 4.0K Mar 8 13:25 etc
dr-xr-xr-x 18 root root 4.0K Mar 8 13:25 ..
dr-xr-xr-x 18 root root 4.0K Mar 8 13:25 .
drwx------ 3 mockbuild mockbuild 4.0K Mar 8 13:25 builddir
drwxr-xr-x 12 root root 4.0K Mar 8 13:25 run
sh-4.2#
使用exit
退出
debug示例
[builder@e6406fa42d5d rpmbuild]$ /usr/bin/mock -r epel-7-x86_64 clean
INFO: mock.py version 1.2.17 starting (python version = 2.7.5)...
Start: init plugins
INFO: selinux disabled
Finish: init plugins
Start: run
Start: clean chroot
Finish: clean chroot
Finish: run
[builder@e6406fa42d5d rpmbuild]$
[builder@e6406fa42d5d rpmbuild]$ /usr/bin/mock -r epel-7-x86_64 --no-clean --no-cleanup-after --init -vvv
INFO: mock.py version 1.2.17 starting (python version = 2.7.5)...
Start: init plugins
DEBUG: ensuring that dir exists: /var/cache/mock/epel-7-x86_64/yum_cache/
INFO: selinux disabled
Finish: init plugins
Start: run
DEBUG: mock final configuration:
DEBUG: scm: False
DEBUG: resultdir: %(basedir)s/%(root)s/result
DEBUG: yum_builddep_command: /usr/bin/yum-builddep
DEBUG: dist: el7
DEBUG: verbose: 2
DEBUG: exclude_from_homedir_cleanup: ['build/SOURCES', '.bash_history', '.bashrc']
DEBUG: use_host_resolv: True
DEBUG: createrepo_command: /usr/bin/createrepo_c -d -q -x *.src.rpm
DEBUG: target_arch: x86_64
DEBUG: more_buildreqs: {}
DEBUG: chrootuid: 1000
DEBUG: update_before_build: True
DEBUG: root_log_fmt_str: %(levelname)s %(filename)s:%(lineno)d: %(message)s
DEBUG: state_log_fmt_str: %(asctime)s - %(message)s
DEBUG: backup_base_dir: /var/lib/mock/backup
DEBUG: internal_dev_setup: True
DEBUG: environment: {'LANG': 'en_US.UTF-8', 'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOSTNAME': 'mock', 'PROMPT_COMMAND': 'printf "\x1b]0;<mock-chroot>\x07<mock-chroot>"', 'HOME': '/builddir', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin'}
DEBUG: releasever: 7
DEBUG: dnf_command: /usr/bin/dnf
DEBUG: extra_chroot_dirs: []
DEBUG: build_log_fmt_name: unadorned
DEBUG: chrootgid: 135
DEBUG: files: {}
DEBUG: print_main_output: True
DEBUG: log_config_file: logging.ini
DEBUG: cache_alterations: False
DEBUG: cleanup_on_success: False
DEBUG: useradd: /usr/sbin/useradd -o -m -u %(uid)s -g %(gid)s -d %(home)s -n %(user)s
DEBUG: root_log_fmt_name: detailed
DEBUG: chroot_name: epel-7-x86_64
DEBUG: plugin_conf: {'package_state_enable': False, 'chroot_scan_enable': False, 'bind_mount_opts': {'dirs': [], 'resultdir': '/var/lib/mock/epel-7-x86_64/result', 'create_dirs': False, 'basedir': '/var/lib/mock/epel-7-x86_64', 'cachedir': '/var/cache/mock/epel-7-x86_64', 'cache_topdir': '/var/cache/mock', 'root': 'epel-7-x86_64'}, 'selinux_opts': {'resultdir': '/var/lib/mock/epel-7-x86_64/result', 'basedir': '/var/lib/mock/epel-7-x86_64', 'root': 'epel-7-x86_64', 'cachedir': '/var/cache/mock/epel-7-x86_64', 'cache_topdir': '/var/cache/mock'}, 'ccache_opts': {'resultdir': '/var/lib/mock/epel-7-x86_64/result', 'basedir': '/var/lib/mock/epel-7-x86_64', 'compress': None, 'max_cache_size': '4G', 'cachedir': '/var/cache/mock/epel-7-x86_64', 'cache_topdir': '/var/cache/mock', 'root': 'epel-7-x86_64', 'dir': '%(cache_topdir)s/%(root)s/ccache/u%(chrootuid)s/'}, 'chroot_scan_opts': {'resultdir': '/var/lib/mock/epel-7-x86_64/result', 'regexes': ['^[^k]?core(\\.\\d+)?$', '\\.log$'], 'basedir': '/var/lib/mock/epel-7-x86_64', 'only_failed': True, 'cachedir': '/var/cache/mock/epel-7-x86_64', 'cache_topdir': '/var/cache/mock', 'root': 'epel-7-x86_64'}, 'yum_cache_enable': True, 'sign_opts': {'resultdir': '/var/lib/mock/epel-7-x86_64/result', 'basedir': '/var/lib/mock/epel-7-x86_64', 'cmd': 'rpmsign', 'cachedir': '/var/cache/mock/epel-7-x86_64', 'cache_topdir': '/var/cache/mock', 'root': 'epel-7-x86_64', 'opts': '--addsign %(rpms)s'}, 'lvm_root_opts': {'pool_name': 'mockbuild', 'resultdir': '/var/lib/mock/epel-7-x86_64/result', 'basedir': '/var/lib/mock/epel-7-x86_64', 'cachedir': '/var/cache/mock/epel-7-x86_64', 'cache_topdir': '/var/cache/mock', 'root': 'epel-7-x86_64'}, 'package_state_opts': {'resultdir': '/var/lib/mock/epel-7-x86_64/result', 'basedir': '/var/lib/mock/epel-7-x86_64', 'root': 'epel-7-x86_64', 'cachedir': '/var/cache/mock/epel-7-x86_64', 'cache_topdir': '/var/cache/mock'}, 'pm_request_enable': False, 'root_cache_opts': {'exclude_dirs': ['./proc', './sys', './dev', './tmp/ccache', './var/cache/yum', './var/cache/dnf'], 'compress_program': 'pigz', 'extension': '.gz', 'resultdir': '/var/lib/mock/epel-7-x86_64/result', 'root': 'epel-7-x86_64', 'basedir': '/var/lib/mock/epel-7-x86_64', 'cachedir': '/var/cache/mock/epel-7-x86_64', 'age_check': True, 'cache_topdir': '/var/cache/mock', 'max_age_days': 15, 'dir': '%(cache_topdir)s/%(root)s/root_cache/'}, 'lvm_root_enable': False, 'ccache_enable': False, 'yum_cache_opts': {'resultdir': '/var/lib/mock/epel-7-x86_64/result', 'package_manager': 'yum', 'max_metadata_age_days': 30, 'target_dir': '/var/cache/%(package_manager)s/', 'basedir': '/var/lib/mock/epel-7-x86_64', 'cachedir': '/var/cache/mock/epel-7-x86_64', 'online': True, 'root': 'epel-7-x86_64', 'cache_topdir': '/var/cache/mock', 'max_age_days': 30, 'dir': '%(cache_topdir)s/%(root)s/%(package_manager)s_cache/'}, 'root_cache_enable': True, 'bind_mount_enable': True, 'selinux_enable': True, 'pm_request_opts': {'resultdir': '/var/lib/mock/epel-7-x86_64/result', 'basedir': '/var/lib/mock/epel-7-x86_64', 'root': 'epel-7-x86_64', 'cachedir': '/var/cache/mock/epel-7-x86_64', 'cache_topdir': '/var/cache/mock'}, 'tmpfs_enable': False, 'tmpfs_opts': {'resultdir': '/var/lib/mock/epel-7-x86_64/result', 'keep_mounted': False, 'basedir': '/var/lib/mock/epel-7-x86_64', 'required_ram_mb': 900, 'cache_topdir': '/var/cache/mock', 'cachedir': '/var/cache/mock/epel-7-x86_64', 'mode': '0755', 'max_fs_size': None, 'root': 'epel-7-x86_64'}, 'mount_opts': {'resultdir': '/var/lib/mock/epel-7-x86_64/result', 'basedir': '/var/lib/mock/epel-7-x86_64', 'root': 'epel-7-x86_64', 'cachedir': '/var/cache/mock/epel-7-x86_64', 'cache_topdir': '/var/cache/mock'}, 'sign_enable': False, 'mount_enable': False}
DEBUG: nosync_force: False
DEBUG: rhnplugin.conf:
[main]
enabled=0
DEBUG: state_log_fmt_name: state
DEBUG: plugin_dir: /usr/lib/python2.7/site-packages/mockbuild/plugins
DEBUG: rpm_command: /bin/rpm
DEBUG: config_paths: ['/etc/mock/site-defaults.cfg', '/etc/mock/epel-7-x86_64.cfg']
DEBUG: root: epel-7-x86_64
DEBUG: build_log_fmt_str: %(message)s
DEBUG: post_install: False
DEBUG: legal_host_arches: ('x86_64',)
DEBUG: package_manager: yum
DEBUG: internal_setarch: True
DEBUG: scm_opts: {'exclude_vcs': True, 'git_timestamps': False, 'write_tar': False, 'svn_get': 'svn co file:///srv/svn/SCM_PKG/SCM_BRN SCM_PKG', 'spec': 'SCM_PKG.spec', 'git_get': 'git clone SCM_BRN git://localhost/SCM_PKG.git SCM_PKG', 'cvs_get': 'cvs -d /srv/cvs co SCM_BRN SCM_PKG', 'ext_src_dir': '/dev/null', 'method': 'git'}
DEBUG: rpmbuild_networking: False
DEBUG: yum_command: /usr/bin/yum
DEBUG: yum_builddep_opts:
DEBUG: yum.conf:
[main]
keepcache=1
debuglevel=2
reposdir=/dev/null
logfile=/var/log/yum.log
retries=20
obsoletes=1
gpgcheck=0
assumeyes=1
syslog_ident=mock
syslog_device=
mdpolicy=group:primary
# repos
[base]
name=BaseOS
mirrorlist=http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os
failovermethod=priority
gpgkey=file:///etc/pki/mock/RPM-GPG-KEY-CentOS-7
gpgcheck=1
[updates]
name=updates
enabled=1
mirrorlist=http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=updates
failovermethod=priority
gpgkey=file:///etc/pki/mock/RPM-GPG-KEY-CentOS-7
gpgcheck=1
[epel]
name=epel
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-7&arch=x86_64
failovermethod=priority
gpgkey=file:///etc/pki/mock/RPM-GPG-KEY-EPEL-7
gpgcheck=1
[extras]
name=extras
mirrorlist=http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=extras
failovermethod=priority
gpgkey=file:///etc/pki/mock/RPM-GPG-KEY-EPEL-7
gpgcheck=1
[testing]
name=epel-testing
enabled=0
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=testing-epel7&arch=x86_64
failovermethod=priority
[local]
name=local
baseurl=http://kojipkgs.fedoraproject.org/repos/epel7-build/latest/x86_64/
cost=2000
enabled=0
[epel-debug]
name=epel-debug
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-debug-7&arch=x86_64
failovermethod=priority
enabled=0
DEBUG: cleanup_on_failure: False
DEBUG: enable_disable_repos: []
DEBUG: plugins: ['tmpfs', 'root_cache', 'yum_cache', 'bind_mount', 'ccache', 'selinux', 'package_state', 'chroot_scan', 'lvm_root', 'compress_logs', 'sign', 'pm_request', 'mount']
DEBUG: no_root_shells: False
DEBUG: check: True
DEBUG: nosync: False
DEBUG: priorities.conf:
[main]
enabled=0
DEBUG: yum_common_opts: []
DEBUG: chroothome: /builddir
DEBUG: rpmbuild_command: /usr/bin/rpmbuild
DEBUG: basedir: /var/lib/mock
DEBUG: macros: {'%_rpmfilename': '%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm', '%_topdir': '/builddir/build'}
DEBUG: version: 1.2.17
DEBUG: online: True
DEBUG: rpmbuild_arch: x86_64
DEBUG: config_file: /etc/mock/epel-7-x86_64.cfg
DEBUG: createrepo_on_rpms: False
DEBUG: rpmbuild_timeout: 0
DEBUG: chroot_setup_cmd: install @buildsys-build
DEBUG: use_nspawn: False
DEBUG: subscription-manager.conf:
DEBUG: clean: False
DEBUG: backup_on_clean: False
DEBUG: cache_topdir: /var/cache/mock
DEBUG: Unsharing. Flags: 67239936
DEBUG: ensuring that dir exists: /var/lib/mock/epel-7-x86_64
DEBUG: creating dir: /var/lib/mock/epel-7-x86_64
Start: chroot init
DEBUG: ensuring that dir exists: /var/lib/mock/epel-7-x86_64
DEBUG: ensuring that dir exists: /var/lib/mock/epel-7-x86_64/root
DEBUG: creating dir: /var/lib/mock/epel-7-x86_64/root
DEBUG: ensuring that dir exists: /var/lib/mock/epel-7-x86_64/result
DEBUG: creating dir: /var/lib/mock/epel-7-x86_64/result
INFO: calling preinit hooks
INFO: enabled root cache
DEBUG: ensuring that dir exists: /var/cache/mock/epel-7-x86_64/root_cache/
Start: unpacking root cache
DEBUG: ensuring that dir exists: /var/lib/mock/epel-7-x86_64/root
DEBUG: child environment: None
DEBUG: Executing command: ['tar', '--use-compress-program', 'pigz', '-xf', '/var/cache/mock/epel-7-x86_64/root_cache/cache.tar.gz', '-C', '/var/lib/mock/epel-7-x86_64/root'] with env {'LANG': 'en_US.UTF-8', 'TERM': 'vt100', 'SHELL': '/bin/sh', 'HOSTNAME': 'mock', 'HOME': '/builddir', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin'} and shell False
DEBUG: Child return code was: 0
DEBUG: ensuring that dir exists: /var/lib/mock/epel-7-x86_64/root/./proc
DEBUG: creating dir: /var/lib/mock/epel-7-x86_64/root/./proc
DEBUG: ensuring that dir exists: /var/lib/mock/epel-7-x86_64/root/./sys
DEBUG: creating dir: /var/lib/mock/epel-7-x86_64/root/./sys
DEBUG: ensuring that dir exists: /var/lib/mock/epel-7-x86_64/root/./dev
DEBUG: creating dir: /var/lib/mock/epel-7-x86_64/root/./dev
DEBUG: ensuring that dir exists: /var/lib/mock/epel-7-x86_64/root/./tmp/ccache
DEBUG: creating dir: /var/lib/mock/epel-7-x86_64/root/./tmp/ccache
DEBUG: ensuring that dir exists: /var/lib/mock/epel-7-x86_64/root/./var/cache/yum
DEBUG: creating dir: /var/lib/mock/epel-7-x86_64/root/./var/cache/yum
DEBUG: ensuring that dir exists: /var/lib/mock/epel-7-x86_64/root/./var/cache/dnf
DEBUG: creating dir: /var/lib/mock/epel-7-x86_64/root/./var/cache/dnf
Finish: unpacking root cache
INFO: enabled yum cache
DEBUG: ensuring that dir exists: /var/lib/mock/epel-7-x86_64/root/var/cache/yum/
Start: cleaning yum metadata
Finish: cleaning yum metadata
DEBUG: create skeleton dirs
DEBUG: ensuring that dir exists: /var/lib/mock/epel-7-x86_64/root/var/lib/rpm
DEBUG: ensuring that dir exists: /var/lib/mock/epel-7-x86_64/root/var/lib/yum
DEBUG: ensuring that dir exists: /var/lib/mock/epel-7-x86_64/root/var/lib/dbus
DEBUG: ensuring that dir exists: /var/lib/mock/epel-7-x86_64/root/var/log
DEBUG: ensuring that dir exists: /var/lib/mock/epel-7-x86_64/root/var/cache/yum
DEBUG: ensuring that dir exists: /var/lib/mock/epel-7-x86_64/root/etc/rpm
DEBUG: ensuring that dir exists: /var/lib/mock/epel-7-x86_64/root/tmp
DEBUG: ensuring that dir exists: /var/lib/mock/epel-7-x86_64/root/tmp/ccache
DEBUG: ensuring that dir exists: /var/lib/mock/epel-7-x86_64/root/var/tmp
DEBUG: ensuring that dir exists: /var/lib/mock/epel-7-x86_64/root/etc/yum.repos.d
DEBUG: ensuring that dir exists: /var/lib/mock/epel-7-x86_64/root/etc/yum
DEBUG: ensuring that dir exists: /var/lib/mock/epel-7-x86_64/root/proc
DEBUG: ensuring that dir exists: /var/lib/mock/epel-7-x86_64/root/sys
DEBUG: ensuring that dir exists: /var/lib/mock/epel-7-x86_64/result
Mock Version: 1.2.17
INFO: Mock Version: 1.2.17
INFO: Mock Version: 1.2.17
DEBUG: ensuring that dir exists: /var/lib/mock/epel-7-x86_64/root/dev/pts
DEBUG: creating dir: /var/lib/mock/epel-7-x86_64/root/dev/pts
DEBUG: ensuring that dir exists: /var/lib/mock/epel-7-x86_64/root/dev/shm
DEBUG: creating dir: /var/lib/mock/epel-7-x86_64/root/dev/shm
DEBUG: kernel version == 4.19.121-linuxkit
DEBUG: touching file: /var/lib/mock/epel-7-x86_64/root/etc/fstab
DEBUG: touching file: /var/lib/mock/epel-7-x86_64/root/etc/yum.conf
DEBUG: touching file: /var/lib/mock/epel-7-x86_64/root/etc/dnf.conf
DEBUG: touching file: /var/lib/mock/epel-7-x86_64/root/var/log/yum.log
DEBUG: child environment: None
DEBUG: Executing command: ['/bin/mount', '-n', '-t', 'proc', 'proc', '/var/lib/mock/epel-7-x86_64/root/proc'] with env {'LANG': 'en_US.UTF-8', 'TERM': 'vt100', 'SHELL': '/bin/sh', 'HOSTNAME': 'mock', 'HOME': '/builddir', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin'} and shell False
DEBUG: Child return code was: 0
DEBUG: child environment: None
DEBUG: Executing command: ['/bin/mount', '-n', '-t', 'sysfs', 'sysfs', '/var/lib/mock/epel-7-x86_64/root/sys'] with env {'LANG': 'en_US.UTF-8', 'TERM': 'vt100', 'SHELL': '/bin/sh', 'HOSTNAME': 'mock', 'HOME': '/builddir', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin'} and shell False
DEBUG: Child return code was: 0
DEBUG: child environment: None
DEBUG: Executing command: ['/bin/mount', '-n', '-t', 'tmpfs', 'tmpfs', '/var/lib/mock/epel-7-x86_64/root/dev/shm'] with env {'LANG': 'en_US.UTF-8', 'TERM': 'vt100', 'SHELL': '/bin/sh', 'HOSTNAME': 'mock', 'HOME': '/builddir', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin'} and shell False
DEBUG: Child return code was: 0
DEBUG: child environment: None
DEBUG: Executing command: ['/bin/mount', '-n', '-t', 'devpts', '-o', 'gid=5,mode=0620,ptmxmode=0666,newinstance', 'devpts', '/var/lib/mock/epel-7-x86_64/root/dev/pts'] with env {'LANG': 'en_US.UTF-8', 'TERM': 'vt100', 'SHELL': '/bin/sh', 'HOSTNAME': 'mock', 'HOME': '/builddir', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin'} and shell False
DEBUG: Child return code was: 0
DEBUG: child environment: None
DEBUG: Executing command: ['/bin/mount', '-n', '--bind', '/var/cache/mock/epel-7-x86_64/yum_cache/', '/var/lib/mock/epel-7-x86_64/root/var/cache/yum/'] with env {'LANG': 'en_US.UTF-8', 'TERM': 'vt100', 'SHELL': '/bin/sh', 'HOSTNAME': 'mock', 'HOME': '/builddir', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin'} and shell False
DEBUG: Child return code was: 0
DEBUG: rootdir = /var/lib/mock/epel-7-x86_64/root
DEBUG: resultdir = /var/lib/mock/epel-7-x86_64/result
DEBUG: ensuring that dir exists: /var/lib/mock/epel-7-x86_64/root/etc/pki/mock
DEBUG: ensuring that dir exists: /var/lib/mock/epel-7-x86_64/root/etc/yum/pluginconf.d
DEBUG: configure yum
DEBUG: configure yum priorities
DEBUG: configure yum rhnplugin
DEBUG: touching file: /var/lib/mock/epel-7-x86_64/root/.initialized
Finish: chroot init
Finish: run
DEBUG: kill orphans
DEBUG: child environment: None
DEBUG: Executing command: ['/bin/umount', '-n', '/var/lib/mock/epel-7-x86_64/root/var/cache/yum/'] with env {'LANG': 'en_US.UTF-8', 'TERM': 'vt100', 'SHELL': '/bin/sh', 'HOSTNAME': 'mock', 'HOME': '/builddir', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin'} and shell False
DEBUG: Child return code was: 0
DEBUG: child environment: None
DEBUG: Executing command: ['/bin/umount', '-n', '-l', '/var/lib/mock/epel-7-x86_64/root/dev/pts'] with env {'LANG': 'en_US.UTF-8', 'TERM': 'vt100', 'SHELL': '/bin/sh', 'HOSTNAME': 'mock', 'HOME': '/builddir', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin'} and shell False
DEBUG: Child return code was: 0
DEBUG: child environment: None
DEBUG: Executing command: ['/bin/umount', '-n', '-l', '/var/lib/mock/epel-7-x86_64/root/dev/shm'] with env {'LANG': 'en_US.UTF-8', 'TERM': 'vt100', 'SHELL': '/bin/sh', 'HOSTNAME': 'mock', 'HOME': '/builddir', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin'} and shell False
DEBUG: Child return code was: 0
DEBUG: child environment: None
DEBUG: Executing command: ['/bin/umount', '-n', '-l', '/var/lib/mock/epel-7-x86_64/root/sys'] with env {'LANG': 'en_US.UTF-8', 'TERM': 'vt100', 'SHELL': '/bin/sh', 'HOSTNAME': 'mock', 'HOME': '/builddir', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin'} and shell False
DEBUG: Child return code was: 0
DEBUG: child environment: None
DEBUG: Executing command: ['/bin/umount', '-n', '-l', '/var/lib/mock/epel-7-x86_64/root/proc'] with env {'LANG': 'en_US.UTF-8', 'TERM': 'vt100', 'SHELL': '/bin/sh', 'HOSTNAME': 'mock', 'HOME': '/builddir', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin'} and shell False
DEBUG: Child return code was: 0
[builder@e6406fa42d5d rpmbuild]$
debug
/usr/bin/yum --installroot /var/lib/mock/epel-7-x86_64/root/ --releasever 7 repolist -v
进入mock环境
mock -r epel-7-x86_64 shell