From 90394b0e91f17861173ebebe1ebb3759704bc42f Mon Sep
17 00:00:00 2001
From: insilications <boboniboni(a)gmail.com>
Date: Sun, 2 Aug 2020 03:37:19 -0300
Subject: [PATCH mock] Patches for 2.4.1
---
...d-custom-makefile-for-Clear-Linux-OS.patch | 19 +-
0002-clearlinux-stateless-configuration.patch | 28 +-
...k-group-as-it-might-be-defined-in-th.patch | 40 +-
0004-Add-entry-for-mock-in-sudoers.patch | 17 +-
...Allow-the-groupadd-g-command-to-fail.patch | 24 +-
...U-tar-in-Clear-Linux-OS-is-named-tar.patch | 39 +-
0007-Set-chroot-group-to-mockbuild.patch | 17 +-
...ystemd-nspawn-to-prevent-stdin-being.patch | 22 +-
0009-Disable-Jinja2-use.patch | 89 ----
...09-Do-not-disable-unavailable-plugin.patch | 17 +-
0010-Add-site-defaults.cfg.patch | 497 ++++++++++++++++++
0011-Fix-clear.cfg.patch | 37 ++
0012-Add-Clear-Linux-cert_path.patch | 26 +
Makefile | 2 +-
options.conf | 2 +-
series | 6 +-
16 files changed, 690 insertions(+), 192 deletions(-)
delete mode 100644 0009-Disable-Jinja2-use.patch
rename 0010-Do-not-disable-unavailable-plugin.patch =>
0009-Do-not-disable-unavailable-plugin.patch (66%)
create mode 100644 0010-Add-site-defaults.cfg.patch
create mode 100644 0011-Fix-clear.cfg.patch
create mode 100644 0012-Add-Clear-Linux-cert_path.patch
diff --git a/0001-Add-custom-makefile-for-Clear-Linux-OS.patch
b/0001-Add-custom-makefile-for-Clear-Linux-OS.patch
index c2ebf13..703cbe1 100644
--- a/0001-Add-custom-makefile-for-Clear-Linux-OS.patch
+++ b/0001-Add-custom-makefile-for-Clear-Linux-OS.patch
@@ -1,12 +1,8 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Patrick McCarty <patrick.mccarty(a)intel.com>
-Date: Mon, 22 Apr 2019 14:32:55 -0700
-Subject: [PATCH] Add custom makefile for Clear Linux OS
+From 43a6f9cb275f2a57f5feed4fb0bbfac8533056b8 Mon Sep 17 00:00:00 2001
+From: insilications <boboniboni(a)gmail.com>
+Date: Sun, 2 Aug 2020 02:52:12 -0300
+Subject: [PATCH 01/12] Add custom makefile for Clear Linux OS
-This makefile is directly adapted from the mock.spec in the upstream
-source tree.
-
-Signed-off-by: Patrick McCarty <patrick.mccarty(a)intel.com>
---
Makefile | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
@@ -14,7 +10,7 @@ Signed-off-by: Patrick McCarty <patrick.mccarty(a)intel.com>
diff --git a/Makefile b/Makefile
new file mode 100644
-index 0000000..6e14cb1
+index 0000000..b359fd9
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,34 @@
@@ -51,4 +47,7 @@ index 0000000..6e14cb1
+ install -d $(DESTDIR)/$$pysite; \
+ cp -a py/mockbuild $(DESTDIR)/$$pysite/; \
+ install -d $(DESTDIR)/usr/share/man/man1; \
-+ cp -a docs/mock.1 docs/mock-parse-buildlog.1 $(DESTDIR)/usr/share/man/man1/;
++ cp -a docs/mock.1 docs/mock-parse-buildlog.1 $(DESTDIR)/usr/share/man/man1/;
+--
+2.27.0
+
diff --git a/0002-clearlinux-stateless-configuration.patch
b/0002-clearlinux-stateless-configuration.patch
index d92305f..43b887b 100644
--- a/0002-clearlinux-stateless-configuration.patch
+++ b/0002-clearlinux-stateless-configuration.patch
@@ -1,13 +1,10 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: "Simental Magana, Marcos" <marcos.simental.magana(a)intel.com>
-Date: Wed, 24 Jan 2018 11:17:28 -0600
-Subject: [PATCH] clearlinux stateless configuration
+From 36fef9635d7057b464c8129fc77f5902c64cb801 Mon Sep 17 00:00:00 2001
+From: insilications <boboniboni(a)gmail.com>
+Date: Sun, 2 Aug 2020 02:54:50 -0300
+Subject: [PATCH 02/12] clearlinux stateless configuration
Changes for the 1.4.21 release: fall back to /usr/share/defaults/mock
for bash completions and for the logging.ini file.
-
-Signed-off-by: Simental Magana, Marcos <marcos.simental.magana(a)intel.com>
-Signed-off-by: Patrick McCarty <patrick.mccarty(a)intel.com>
---
mock/docs/mock.1 | 9 ++++---
mock/etc/bash_completion.d/mock | 4 ++--
@@ -17,7 +14,7 @@ Signed-off-by: Patrick McCarty <patrick.mccarty(a)intel.com>
create mode 100644 mock/etc/mock/clear.cfg
diff --git a/mock/docs/mock.1 b/mock/docs/mock.1
-index f44a0dd..5e56ecb 100644
+index b5b07cd..91b4b9f 100644
--- a/mock/docs/mock.1
+++ b/mock/docs/mock.1
@@ -57,8 +57,9 @@ contents specified by a configuration file, then build any input
SRPM(s) in
@@ -32,7 +29,7 @@ index f44a0dd..5e56ecb 100644
.LP
There is a site\-wide configuration file, /etc/mock/site\-defaults.cfg, which can
be used to specify site\-wide options. The shipped version of this file has no
-@@ -396,7 +397,9 @@ don't create bootstrap chroot from container image
+@@ -435,7 +436,9 @@ don't create bootstrap chroot from container image
.SH "FILES"
.LP
@@ -44,7 +41,7 @@ index f44a0dd..5e56ecb 100644
\fI/var/lib/mock\fP \- directory where chroots and results are created. You should not
put there your input files.
.SH "EXAMPLES"
diff --git a/mock/etc/bash_completion.d/mock b/mock/etc/bash_completion.d/mock
-index cc3ec92..fc47c39 100644
+index 87cdcd4..9f5c3d2 100644
--- a/mock/etc/bash_completion.d/mock
+++ b/mock/etc/bash_completion.d/mock
@@ -2,7 +2,7 @@
@@ -114,10 +111,10 @@ index 0000000..49e866b
+enabled=1
+"""
diff --git a/mock/py/mock.py b/mock/py/mock.py
-index 50d412d..3064d8c 100755
+index 251a080..5b17563 100755
--- a/mock/py/mock.py
+++ b/mock/py/mock.py
-@@ -70,6 +70,7 @@ SYSCONFDIR =
os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])), "..",
+@@ -72,6 +72,7 @@ SYSCONFDIR =
os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])), "..",
PYTHONDIR = os.path.dirname(os.path.realpath(sys.argv[0]))
PKGPYTHONDIR = os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])),
"mockbuild")
MOCKCONFDIR = os.path.join(SYSCONFDIR, "mock")
@@ -125,7 +122,7 @@ index 50d412d..3064d8c 100755
# end build system subs
# import all mockbuild.* modules after this.
-@@ -424,10 +425,10 @@ def setup_logging(config_path, config_opts, options):
+@@ -435,10 +436,10 @@ def setup_logging(config_path, config_opts, options):
try:
if not os.path.exists(log_ini):
@@ -138,7 +135,7 @@ index 50d412d..3064d8c 100755
if not os.path.exists(log_ini):
raise IOError("Could not find log config file %s" %
log_ini)
else:
-@@ -611,7 +612,9 @@ def main():
+@@ -645,7 +646,9 @@ def main():
options.verbose = 0
# config path -- can be overridden on cmdline
@@ -149,3 +146,6 @@ index 50d412d..3064d8c 100755
if options.configdir:
config_path = options.configdir
+--
+2.27.0
+
diff --git a/0003-Do-not-reuse-mock-group-as-it-might-be-defined-in-th.patch
b/0003-Do-not-reuse-mock-group-as-it-might-be-defined-in-th.patch
index c481aab..8d2e277 100644
--- a/0003-Do-not-reuse-mock-group-as-it-might-be-defined-in-th.patch
+++ b/0003-Do-not-reuse-mock-group-as-it-might-be-defined-in-th.patch
@@ -1,28 +1,27 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Dimitri John Ledkov <dimitri.j.ledkov(a)intel.com>
-Date: Tue, 17 Mar 2015 14:59:12 +0000
-Subject: [PATCH] Do not reuse mock group, as it might be defined in the nested
- chroot.
+From 2271d789f553bb0aeaacd190ef8817049ee52c8c Mon Sep 17 00:00:00 2001
+From: insilications <boboniboni(a)gmail.com>
+Date: Sun, 2 Aug 2020 02:57:10 -0300
+Subject: [PATCH 03/12] Do not reuse mock group, as it might be defined in the
+ nested chroot.
-Signed-off-by: Patrick McCarty <patrick.mccarty(a)intel.com>
---
mock/py/mockbuild/util.py | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)
diff --git a/mock/py/mockbuild/util.py b/mock/py/mockbuild/util.py
-index 66c1b08..8055780 100644
+index 1c462ff..a7d892e 100644
--- a/mock/py/mockbuild/util.py
+++ b/mock/py/mockbuild/util.py
-@@ -921,7 +921,7 @@ def find_non_nfs_dir():
-
+@@ -1001,7 +1001,7 @@ def nspawn_supported():
+ return os.path.basename(argv0) == b'systemd'
@traceLog()
-def setup_default_config_opts(unprivUid, version, pkgpythondir):
+def setup_default_config_opts(unprivUid, version, pkgpythondir, unprivGid=None):
"sets up default configuration."
- config_opts = TemplatedDictionary()
- config_opts['version'] = version
-@@ -935,11 +935,14 @@ def setup_default_config_opts(unprivUid, version, pkgpythondir):
+ config_opts = TemplatedDictionary(alias_spec={'dnf.conf':
['yum.conf']})
+ config_opts['config_paths'] = []
+@@ -1017,11 +1017,14 @@ def setup_default_config_opts(unprivUid, version, pkgpythondir):
config_opts['log_config_file'] = 'logging.ini'
config_opts['rpmbuild_timeout'] = 0
config_opts['chrootuid'] = unprivUid
@@ -42,19 +41,22 @@ index 66c1b08..8055780 100644
config_opts['chrootgroup'] = 'mock'
config_opts['chrootuser'] = 'mockbuild'
config_opts['build_log_fmt_name'] = "unadorned"
-@@ -1484,10 +1487,12 @@ def setup_host_resolv(config_opts):
- def load_config(config_path, name, uidManager, version, pkg_python_dir):
- log = logging.getLogger()
+@@ -1610,10 +1613,12 @@ def setup_host_resolv(config_opts):
+ @traceLog()
+ def load_defaults(uidManager, version, pkg_python_dir):
if uidManager:
- gid = uidManager.unprivUid
+ uid = uidManager.unprivUid
+ gid = uidManager.unprivGid
else:
- gid = os.getuid()
-- config_opts = setup_default_config_opts(gid, version, pkg_python_dir)
+- return setup_default_config_opts(gid, version, pkg_python_dir)
+ uid = os.getuid()
+ gid = os.getgid()
-+ config_opts = setup_default_config_opts(uid, version, pkg_python_dir,
unprivGid=gid)
++ return setup_default_config_opts(uid, version, pkg_python_dir, unprivGid=gid)
- # array to save config paths
- config_opts['config_paths'] = []
+ @traceLog()
+ def load_config(config_path, name, uidManager, version, pkg_python_dir):
+--
+2.27.0
+
diff --git a/0004-Add-entry-for-mock-in-sudoers.patch
b/0004-Add-entry-for-mock-in-sudoers.patch
index dd48e1c..4d5a00a 100644
--- a/0004-Add-entry-for-mock-in-sudoers.patch
+++ b/0004-Add-entry-for-mock-in-sudoers.patch
@@ -1,7 +1,7 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Caio Marcelo de Oliveira Filho <caio.oliveira(a)intel.com>
-Date: Tue, 17 Oct 2017 12:19:09 -0700
-Subject: [PATCH] Add entry for mock in sudoers
+From 45bec07b9f30786812a84637dc7223ce90f7a88f Mon Sep 17 00:00:00 2001
+From: insilications <boboniboni(a)gmail.com>
+Date: Sun, 2 Aug 2020 02:58:58 -0300
+Subject: [PATCH 04/12] Add entry for mock in sudoers
Mock needs to run with root permissions but not directly with the root
user. In Clear Linux the way to run it is using sudo. This patch adds
@@ -11,11 +11,11 @@ run mock.
For reference:
- In the past mock had a C compiled wrapper to call mock itself, and
- made the wrapper have the suidbit (with root as owner). The wrapper
- was removed from mock.
+made the wrapper have the suidbit (with root as owner). The wrapper was
+removed from mock.
- Currently in Fedora, consolehelper is used to provide the necessary
- privileges, it is a generalization from the mechanism above
+privileges, it is a generalization from the mechanism above.
---
mock.sudoers | 1 +
1 file changed, 1 insertion(+)
@@ -28,3 +28,6 @@ index 0000000..aafff95
+++ b/mock.sudoers
@@ -0,0 +1 @@
+%mock ALL = (root) NOPASSWD: /usr/bin/mock
+--
+2.27.0
+
diff --git a/0005-Allow-the-groupadd-g-command-to-fail.patch
b/0005-Allow-the-groupadd-g-command-to-fail.patch
index dba1094..8906255 100644
--- a/0005-Allow-the-groupadd-g-command-to-fail.patch
+++ b/0005-Allow-the-groupadd-g-command-to-fail.patch
@@ -1,27 +1,27 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Thiago Macieira <thiago.macieira(a)intel.com>
-Date: Tue, 3 Jul 2018 16:38:38 -0700
-Subject: [PATCH] Allow the groupadd -g command to fail
+From 0fcbe9197add0689fc0b889a8f2c611b661f8435 Mon Sep 17 00:00:00 2001
+From: insilications <boboniboni(a)gmail.com>
+Date: Sun, 2 Aug 2020 03:00:40 -0300
+Subject: [PATCH 05/12] Allow the groupadd -g command to fail
It fails for me consistently because I am using the same UID/GID inside
the container as outside and group ID 100 already exists in Clear.
-
-Signed-off-by: Thiago Macieira <thiago.macieira(a)intel.com>
-Signed-off-by: Patrick McCarty <patrick.mccarty(a)intel.com>
---
mock/py/mockbuild/buildroot.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mock/py/mockbuild/buildroot.py b/mock/py/mockbuild/buildroot.py
-index 797f6f6..a2e01e0 100644
+index 1ed6fdd..f6156aa 100644
--- a/mock/py/mockbuild/buildroot.py
+++ b/mock/py/mockbuild/buildroot.py
-@@ -325,7 +325,7 @@ class Buildroot(object):
+@@ -397,7 +397,7 @@ class Buildroot(object):
- if self.chrootgid != 0:
- self.doChroot(['/usr/sbin/groupadd', '-g',
dets['gid'], dets['group']],
+ if self.chrootgid:
+ self.doChroot(['/usr/sbin/groupadd', '-g',
self.chrootgid, self.chrootgroup],
- shell=False, nosync=True)
+ shell=False, raiseExc=False, nosync=True)
- self.doChroot(shlex.split(self.config['useradd'] % dets), shell=False,
nosync=True)
+ self.doChroot(shlex.split(self.config['useradd']), shell=False,
nosync=True)
if not self.config['clean']:
self.uid_manager.changeOwner(self.make_chroot_path(self.homedir))
+--
+2.27.0
+
diff --git a/0006-GNU-tar-in-Clear-Linux-OS-is-named-tar.patch
b/0006-GNU-tar-in-Clear-Linux-OS-is-named-tar.patch
index d8f5017..91865ab 100644
--- a/0006-GNU-tar-in-Clear-Linux-OS-is-named-tar.patch
+++ b/0006-GNU-tar-in-Clear-Linux-OS-is-named-tar.patch
@@ -1,18 +1,30 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Patrick McCarty <patrick.mccarty(a)intel.com>
-Date: Fri, 20 Sep 2019 13:35:23 -0700
-Subject: [PATCH] GNU tar in Clear Linux OS is named "tar"
+From a3a4bee00b9298a0755ed457e6d6a0b3dc8e772f Mon Sep 17 00:00:00 2001
+From: insilications <boboniboni(a)gmail.com>
+Date: Sun, 2 Aug 2020 03:02:19 -0300
+Subject: [PATCH 06/12] GNU tar in Clear Linux OS is named tar
Perhaps we should provide a /usr/bin/gtar symlink for cross-distro
-compatibility, but until that decision is made, call `tar` instead of
-`gtar`, since that is what the tar package ships with.
-
-Signed-off-by: Patrick McCarty <patrick.mccarty(a)intel.com>
+compatibility, but until that decision is made, call `tar` instead
+of `gtar`, since that is what the tar package ships with.
---
+ mock/py/mockbuild/buildroot.py | 2 +-
mock/py/mockbuild/plugins/root_cache.py | 4 ++--
mock/py/mockbuild/scm.py | 4 ++--
- 2 files changed, 4 insertions(+), 4 deletions(-)
+ 3 files changed, 5 insertions(+), 5 deletions(-)
+diff --git a/mock/py/mockbuild/buildroot.py b/mock/py/mockbuild/buildroot.py
+index f6156aa..74f4086 100644
+--- a/mock/py/mockbuild/buildroot.py
++++ b/mock/py/mockbuild/buildroot.py
+@@ -173,7 +173,7 @@ class Buildroot(object):
+ if self.config["tar"] == "bsdtar":
+ __tar_cmd = "bsdtar"
+ else:
+- __tar_cmd = "gtar"
++ __tar_cmd = "tar"
+ podman.install_pkgmgmt_packages()
+ podman.cp(self.make_chroot_path(), __tar_cmd)
+ podman.remove()
diff --git a/mock/py/mockbuild/plugins/root_cache.py
b/mock/py/mockbuild/plugins/root_cache.py
index 9560b37..36f4d6a 100644
--- a/mock/py/mockbuild/plugins/root_cache.py
@@ -36,10 +48,10 @@ index 9560b37..36f4d6a 100644
["-cf", self.rootCacheFile,
"-C", self.buildroot.make_chroot_path()] +
\
diff --git a/mock/py/mockbuild/scm.py b/mock/py/mockbuild/scm.py
-index dcdbf64..c9a3722 100644
+index 3837cfe..49a828a 100644
--- a/mock/py/mockbuild/scm.py
+++ b/mock/py/mockbuild/scm.py
-@@ -187,9 +187,9 @@ class scmWorker(object):
+@@ -180,9 +180,9 @@ class scmWorker(object):
if self.config["tar"] == "bsdtar":
__tar_cmd = "bsdtar"
else:
@@ -50,4 +62,7 @@ index dcdbf64..c9a3722 100644
+ if str(self.exclude_vcs).lower() == "true" and __tar_cmd ==
'tar':
proc = subprocess.Popen(['tar', '--help'],
shell=False, stdout=subprocess.PIPE)
proc_result = proc.communicate()[0]
- if six.PY3:
+ proc_result = proc_result.decode()
+--
+2.27.0
+
diff --git a/0007-Set-chroot-group-to-mockbuild.patch
b/0007-Set-chroot-group-to-mockbuild.patch
index 26b3841..50c8210 100644
--- a/0007-Set-chroot-group-to-mockbuild.patch
+++ b/0007-Set-chroot-group-to-mockbuild.patch
@@ -1,22 +1,20 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Patrick McCarty <patrick.mccarty(a)intel.com>
-Date: Fri, 20 Sep 2019 15:39:12 -0700
-Subject: [PATCH] Set chroot group to mockbuild
+From 1604a93711dfd3d0e8f0ff5dba436a19816ec42e Mon Sep 17 00:00:00 2001
+From: insilications <boboniboni(a)gmail.com>
+Date: Sun, 2 Aug 2020 03:03:10 -0300
+Subject: [PATCH 07/12] Set chroot group to mockbuild
In order for stateless integration to work properly, we want to specify
an undefined group name ("mockbuild") instead of a defined group name
("mock").
-
-Signed-off-by: Patrick McCarty <patrick.mccarty(a)intel.com>
---
mock/py/mockbuild/util.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mock/py/mockbuild/util.py b/mock/py/mockbuild/util.py
-index 8055780..c462dbd 100644
+index a7d892e..cabe53b 100644
--- a/mock/py/mockbuild/util.py
+++ b/mock/py/mockbuild/util.py
-@@ -943,7 +943,7 @@ def setup_default_config_opts(unprivUid, version, pkgpythondir,
unprivGid=None):
+@@ -1025,7 +1025,7 @@ def setup_default_config_opts(unprivUid, version, pkgpythondir,
unprivGid=None):
except KeyError:
# 'mock' group doesn't exist, must set in config file
pass
@@ -25,3 +23,6 @@ index 8055780..c462dbd 100644
config_opts['chrootuser'] = 'mockbuild'
config_opts['build_log_fmt_name'] = "unadorned"
config_opts['root_log_fmt_name'] = "detailed"
+--
+2.27.0
+
diff --git a/0008-Add-option-for-systemd-nspawn-to-prevent-stdin-being.patch
b/0008-Add-option-for-systemd-nspawn-to-prevent-stdin-being.patch
index fcc4121..6ffdfea 100644
--- a/0008-Add-option-for-systemd-nspawn-to-prevent-stdin-being.patch
+++ b/0008-Add-option-for-systemd-nspawn-to-prevent-stdin-being.patch
@@ -1,7 +1,8 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: William Douglas <william.douglas(a)intel.com>
-Date: Wed, 4 Dec 2019 11:03:58 -0800
-Subject: [PATCH] Add option for systemd-nspawn to prevent stdin being a ptty
+From 3facfc13e34270701492e1abcfa130e7ab7c238e Mon Sep 17 00:00:00 2001
+From: insilications <boboniboni(a)gmail.com>
+Date: Sun, 2 Aug 2020 03:04:06 -0300
+Subject: [PATCH 08/12] Add option for systemd-nspawn to prevent stdin being a
+ ptty
Due to stdin (and stdout/stderr) being ptty's by default without the
--console=pipe option to systemd-nspawn, builds will assume they are
@@ -11,15 +12,18 @@ interactive and sometimes hang.
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mock/py/mockbuild/util.py b/mock/py/mockbuild/util.py
-index c462dbd..ba6a810 100644
+index cabe53b..7eede3b 100644
--- a/mock/py/mockbuild/util.py
+++ b/mock/py/mockbuild/util.py
-@@ -951,7 +951,7 @@ def setup_default_config_opts(unprivUid, version, pkgpythondir,
unprivGid=None):
- config_opts['online'] = True
- config_opts['use_nspawn'] = True
+@@ -1034,7 +1034,7 @@ def setup_default_config_opts(unprivUid, version, pkgpythondir,
unprivGid=None):
+ config_opts['isolation'] = None
+ config_opts['use_nspawn'] = None
config_opts['rpmbuild_networking'] = False
- config_opts['nspawn_args'] = ['--capability=cap_ipc_lock']
+ config_opts['nspawn_args'] = ['--capability=cap_ipc_lock',
'--console=pipe']
config_opts['use_container_host_hostname'] = True
- config_opts['use_bootstrap_container'] = False
+ config_opts['use_bootstrap'] = True
+--
+2.27.0
+
diff --git a/0009-Disable-Jinja2-use.patch b/0009-Disable-Jinja2-use.patch
deleted file mode 100644
index d8b77b0..0000000
--- a/0009-Disable-Jinja2-use.patch
+++ /dev/null
@@ -1,89 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Patrick McCarty <patrick.mccarty(a)intel.com>
-Date: Thu, 9 Jan 2020 11:17:09 -0800
-Subject: [PATCH] Disable Jinja2 use
-
-Signed-off-by: Patrick McCarty <patrick.mccarty(a)intel.com>
----
- mock/etc/mock/site-defaults.cfg | 7 -------
- mock/py/mock.py | 6 +-----
- mock/py/mockbuild/util.py | 8 ++------
- 3 files changed, 3 insertions(+), 18 deletions(-)
-
-diff --git a/mock/etc/mock/site-defaults.cfg b/mock/etc/mock/site-defaults.cfg
-index 1c4ad34..d9ead3d 100644
---- a/mock/etc/mock/site-defaults.cfg
-+++ b/mock/etc/mock/site-defaults.cfg
-@@ -17,13 +17,6 @@
- #
- # Entries in this file follow the same format as other mock config files.
- # config_opts['foo'] = 'bar'
--#
--# You can use jinja templates, e.g.:
--# config_opts['foobar'] = '{{ foo }} bar'
--# which will result in 'bar bar' (using value defined few lines above)
--# more complicated example:
--# config_opts['foo'] = "{{ plugin_conf['package_state_enable']
}}"
--# which will result in "True"
-
- #############################################################################
- #
-diff --git a/mock/py/mock.py b/mock/py/mock.py
-index 3064d8c..60beac6 100755
---- a/mock/py/mock.py
-+++ b/mock/py/mock.py
-@@ -624,13 +624,9 @@ def main():
- # cmdline options override config options
- util.set_config_opts_per_cmdline(config_opts, options, args)
-
-- # setup 'redhat_subscription_key_id' option before enabling jinja
-+ # setup 'redhat_subscription_key_id' option
- util.subscription_redhat_init(config_opts)
-
-- # Now when all options are correctly loaded from config files and program
-- # options, turn the jinja templating ON.
-- config_opts['__jinja_expand'] = True
--
- # allow a different mock group to be specified
- if config_opts['chrootgid'] != mockgid:
- uidManager.restorePrivs()
-diff --git a/mock/py/mockbuild/util.py b/mock/py/mockbuild/util.py
-index ba6a810..29a7e33 100644
---- a/mock/py/mockbuild/util.py
-+++ b/mock/py/mockbuild/util.py
-@@ -38,7 +38,6 @@ import time
- import uuid
-
- import distro
--import jinja2
- import six
-
- from mockbuild.mounts import BindMountPoint
-@@ -127,8 +126,6 @@ class TemplatedDictionary(MutableMapping):
- def __setitem__(self, key, value):
- self.__dict__[key] = value
- def __getitem__(self, key):
-- if '__jinja_expand' in self.__dict__:
-- return self.__render_value(self.__dict__[key])
- return self.__dict__[key]
- def __delitem__(self, key):
- del self.__dict__[key]
-@@ -164,8 +161,7 @@ class TemplatedDictionary(MutableMapping):
- else:
- return value
- def __render_string(self, value):
-- template = jinja2.Template(value)
-- return _to_native(template.render(self.__dict__))
-+ return value
-
-
- def _to_bytes(obj, arg_encoding='utf-8', errors='strict',
nonstring='strict'):
-@@ -923,7 +919,7 @@ def find_non_nfs_dir():
- @traceLog()
- def setup_default_config_opts(unprivUid, version, pkgpythondir, unprivGid=None):
- "sets up default configuration."
-- config_opts = TemplatedDictionary()
-+ config_opts = {}
- config_opts['version'] = version
- config_opts['basedir'] = '/var/lib/mock' # root name is
automatically added to this
- config_opts['resultdir'] = '%(basedir)s/%(root)s/result'
diff --git a/0010-Do-not-disable-unavailable-plugin.patch
b/0009-Do-not-disable-unavailable-plugin.patch
similarity index 66%
rename from 0010-Do-not-disable-unavailable-plugin.patch
rename to 0009-Do-not-disable-unavailable-plugin.patch
index a49af71..bdf1464 100644
--- a/0010-Do-not-disable-unavailable-plugin.patch
+++ b/0009-Do-not-disable-unavailable-plugin.patch
@@ -1,22 +1,20 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Patrick McCarty <patrick.mccarty(a)intel.com>
-Date: Wed, 25 Mar 2020 09:44:39 -0700
-Subject: [PATCH] Do not disable unavailable plugin
+From 347aebb25e6a427681411fe1f835517a2341bb51 Mon Sep 17 00:00:00 2001
+From: insilications <boboniboni(a)gmail.com>
+Date: Sun, 2 Aug 2020 03:05:17 -0300
+Subject: [PATCH 09/12] Do not disable unavailable plugin
Latest DNF complains about the `spacewalk` plugin being unavailable when
called by mock. Since it never was available in Clear, silence the
warning.
-
-Signed-off-by: Patrick McCarty <patrick.mccarty(a)intel.com>
---
mock/py/mockbuild/util.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mock/py/mockbuild/util.py b/mock/py/mockbuild/util.py
-index 29a7e33..0d7a8fe 100644
+index 7eede3b..5102e1b 100644
--- a/mock/py/mockbuild/util.py
+++ b/mock/py/mockbuild/util.py
-@@ -1156,7 +1156,7 @@ def setup_default_config_opts(unprivUid, version, pkgpythondir,
unprivGid=None):
+@@ -1250,7 +1250,7 @@ def setup_default_config_opts(unprivUid, version, pkgpythondir,
unprivGid=None):
config_opts['microdnf_common_opts'] = []
config_opts['rpm_command'] = '/bin/rpm'
config_opts['rpmbuild_command'] = '/usr/bin/rpmbuild'
@@ -25,3 +23,6 @@ index 29a7e33..0d7a8fe 100644
config_opts['opstimeout'] = 0
+--
+2.27.0
+
diff --git a/0010-Add-site-defaults.cfg.patch b/0010-Add-site-defaults.cfg.patch
new file mode 100644
index 0000000..dd33cca
--- /dev/null
+++ b/0010-Add-site-defaults.cfg.patch
@@ -0,0 +1,497 @@
+From 191e01bd366977e2bf3ba645c91982f495152bc8 Mon Sep 17 00:00:00 2001
+From: insilications <boboniboni(a)gmail.com>
+Date: Sun, 2 Aug 2020 03:08:24 -0300
+Subject: [PATCH 10/12] Add site-defaults.cfg
+
+Copy docs/site-defaults.cfg to correct place (changed in 2.4.1)
+---
+ mock/etc/mock/site-defaults.cfg | 477 ++++++++++++++++++++++++++++++++
+ 1 file changed, 477 insertions(+)
+ create mode 100644 mock/etc/mock/site-defaults.cfg
+
+diff --git a/mock/etc/mock/site-defaults.cfg b/mock/etc/mock/site-defaults.cfg
+new file mode 100644
+index 0000000..7c60fec
+--- /dev/null
++++ b/mock/etc/mock/site-defaults.cfg
+@@ -0,0 +1,477 @@
++# mock defaults
++# vim:tw=0:ts=4:sw=4:et:
++#
++# If you want to alter just some setting for one user, you can put the
++# configuration in:
++# ~/.config/mock.cfg
++#
++# This config file is for site-specific default values that apply across all
++# configurations. Options specified in this config file can be overridden in
++# the individual mock config files.
++#
++# The site-defaults.cfg delivered by default has NO options set. Only set
++# options here if you want to override the defaults.
++#
++# It's possible to use include statement in order to make one config included to
another:
++# include('/path/to/included/config.cfg')
++#
++# Entries in this file follow the same format as other mock config files.
++# config_opts['foo'] = 'bar'
++#
++# You can use jinja templates, e.g.:
++# config_opts['foobar'] = '{{ foo }} bar'
++# which will result in 'bar bar' (using value defined few lines above)
++# more complicated example:
++# config_opts['foo'] = "{{ plugin_conf['package_state_enable']
}}"
++# which will result in "True"
++
++#############################################################################
++#
++# Things that we recommend you set in site-defaults.cfg:
++#
++# config_opts['basedir'] = '/var/lib/mock/'
++# config_opts['cache_topdir'] = '/var/cache/mock'
++# Note: the path pointed to by basedir and cache_topdir must be owned
++# by group 'mock' and must have mode: g+rws
++# config_opts['rpmbuild_timeout'] = 0
++# Using --enable-network sets use_host_resolv True, overriding the value set here.
++# config_opts['use_host_resolv'] = False
++
++# You can configure log format to pull from logging.ini formats of these names:
++# config_opts['build_log_fmt_name'] = "unadorned"
++# config_opts['root_log_fmt_name'] = "detailed"
++# config_opts['state_log_fmt_name'] = "state"
++#
++# By default, mock only prints the build log to stderr if it is a tty. You can
++# force it on here (for CI builds where there is no tty, for example) by
++# setting this to True, or force it off by setting it to False. Setting it to
++# None or leaving it undefined uses the default behavior.
++# config_opts['print_main_output'] = None
++#
++# This option sets the beginning of the line with stderr output in build.log file.
++# By default it's an empty string.
++# config_opts['stderr_line_prefix'] = ""
++#
++# mock will normally set up a minimal chroot /dev.
++# If you want to use a pre-configured /dev, disable this and use the bind-mount
++# plugin to mount your special /dev
++# config_opts['internal_dev_setup'] = True
++#
++# the cleanup_on_* options allow you to automatically clean and remove the
++# mock build directory, but only take effect if --resultdir is used.
++# config_opts provides fine-grained control. cmdline only has big hammer
++#
++# config_opts['cleanup_on_success'] = True
++# config_opts['cleanup_on_failure'] = True
++
++# The build user's homedir is partially cleaned up even when --no-clean is
++# specified in order to prevent garbage from previous builds from altering
++# successive builds. Mock can be configured to exclude certain files/directories
++# from this. Default is SOURCES directory to support nosrc rpms. Paths are
++# relative to build user's homedir
++# config_opts['exclude_from_homedir_cleanup'] = ['build/SOURCES']
++
++# Choose the isolation method for running commands in buildroot. Possible
++# values are 'nspawn' (mock uses systemd-nspawn(1)), 'simple'
(simple
++# os.chroot() is used) or 'auto' (use 'nspawn' when possible, and
fallback to
++# 'chroot').
++#config_opts['isolation'] = 'auto'
++
++# If you're using isolation='nspawn', then by default networking will be
turned
++# off for rpmbuild. This helps ensure more reproducible builds.
++#config_opts['rpmbuild_networking'] = False
++# Additional args for nspawn
++# config_opts['nspawn_args'] = ['--capability=cap_ipc_lock']
++## When RPM is build in container then build hostname is set to name of
++## container. This sets the build hostname to name of container's host.
++## Works only in F25+ chroots
++# config_opts['use_container_host_hostname'] = True
++
++# This works unconditionally by calling sethostname(), however
++# variable use_container_host_hostname or %_buildhost macro can override this
++# config_opts['hostname'] = 'my.own.hostname'
++
++# The default package manager is DNF
++# config_opts['package_manager'] = 'dnf'
++# If you want to use DNF, set it to 'dnf'. To use DNF you need to have dnf
and
++# dnf-plugins-core installed
++
++# Number of attempts to execute package manager's action, and delay between
++# attempts (seconds). This is useful e.g. if the build is done against
++# non-reliable mirrors (downloading of metadata failed, package download
++# failed, ...).
++#config_opts['package_manager_max_attempts'] = 1
++#config_opts['package_manager_attempt_delay'] = 10
++
++# Dynamic BuildRequires, available since RPM 4.15
++# config_opts['dynamic_buildrequires'] = True
++# config_opts['dynamic_buildrequires_max_loops'] = 10
++
++# Default maximum number of dev loops in chroot is 12
++# config_opts['dev_loop_count'] = 12
++
++# You can configure Yum, DNF, rpm and rpmbuild executable paths if you need to
++# use different versions that the system-wide ones
++# config_opts['yum_command'] = '/usr/bin/yum'
++# config_opts['yum_builddep_command'] = '/usr/bin/yum-builddep'
++# config_opts['dnf_command'] = '/usr/bin/dnf'
++# config_opts['rpm_command'] = '/bin/rpm'
++# config_opts['rpmbuild_command'] = '/usr/bin/rpmbuild'
++#
++# By default a Yum/DNF update is performed before each rebuild
++# config_opts['update_before_build'] = True
++
++# Sometimes the rpm/yum/dnf ecosystem on the host machine isn't really
++# compatible with the rpm/yum/dnf ecosystem in mock chroot (the system we
++# build for). Typically when host is yum-based and target system is dnf-based.
++# Such scenario may cause an error when preparing the target mock buildroot, or
++# even worse an unexpected install transaction that is hard to detect.
++# Therefore, with `use_bootstrap=True` default, we first install a minimal
++# "bootstrap" chroot that only contains rpm/yum/dnf stack, and from that
++# "bootstrap" chroot we initialize the target chroot.
++#config_opts['use_bootstrap'] = True
++
++# When 'use_bootstrap' is enabled, these commands are used to install the
++# desired package manager into the "bootstrap" chroot.
++#config_opts['yum_install_command'] = 'install yum yum-utils'
++#config_opts['dnf_install_command'] = 'install dnf
dnf-plugins-core'
++#config_opts['system_yum_command'] = '/usr/bin/yum'
++#config_opts['system_dnf_command'] = '/usr/bin/dnf'
++
++# The bootstrap chroot is normally installed using a package manager from host,
++# but in some cases even this isn't possible (e.g. installing rather new ZSTD
++# compressed dnf.rpm package by 'dnf_install_command' on epel-7 host). In
such
++# case, you may need to have "bootstrap" chroot pre-populated from a
container
++# image first (where the package manager stack is already pre-installed, so
++# mock doesn't have to).
++#config_opts['use_bootstrap_image'] = False
++#config_opts['bootstrap_image'] = 'fedora:latest'
++
++# anything you specify with 'bootstrap_*' will be copied to bootstrap config
++# e.g. config_opts['bootstrap_system_yum_command'] =
'/usr/bin/yum-deprecated' will become
++# config_opts['system_yum_command'] = '/usr/bin/yum-deprecated' for
bootstrap config
++# These three are overrided in bootstrap by default as we usually do not want additional
packages
++# and modules in bootstrap chroot.
++#config_opts['bootstrap_chroot_additional_packages'] = []
++#config_opts['bootstrap_module_setup_commands'] = []
++
++# if you want mock to automatically run createrepo on the rpms in your
++# resultdir.
++# config_opts['createrepo_on_rpms'] = False
++# config_opts['createrepo_command'] = '/usr/bin/createrepo_c -d -q -x
*.src.rpm'
++
++# You can configure which tar is used (for root cache and SCM plugin)
++# valid options are: "gnutar" or "bsdtar"
++# config_opts['tar'] = "gnutar"
++
++# if you want mock to backup the contents of a result dir before clean
++# config_opts['backup_on_clean'] = False
++# config_opts['backup_base_dir'] = "{{basedir}}/backup"
++
++# if you want to speed up the package installation and the build process, mock
++# can use nosync library to skip fsync and related calls from programs called
++# from within mock. It needs nosync library to be installed and for multilib
++# target, it requires both architectures of nosync to be present. If these
++# conditions aren't met, it won't be enabled
++# config_opts['nosync'] = False
++# if you cannot or don't want to install both architectures of nosync and still
++# want mock to use it, you can force it, but then expect a lot of (generally
++# harmless) error messages from ld.so when a 32bit program is executed
++# config_opts['nosync_force'] = False
++
++# By default Mock unshare namespace so it is different from your other application
++# in unpriviliged container, this is skipped. We will warn you that running mock
++# and some other applications in the same container is not good idea and
++# can be security risk. If you are fully aware of this risk or mock is your
++# only one application in that container you can disable the warning here.
++# config_opts['docker_unshare_warning'] = True
++
++# Change directory where resulting files (RPMs and build logs) are written.
++# Resultdir can contain python-string substitutions for any variable in the chroot
config.
++# config_opts["resultdir"] = "{{basedir}}/{{root}}/result"
++
++#############################################################################
++#
++# plugin related. Below are the defaults. Change to suit your site
++# policy. site-defaults.cfg is a good place to do this.
++#
++# NOTE: Some of the caching options can theoretically affect build
++# reproducability. Change with care.
++#
++# config_opts['plugin_conf']['package_state_enable'] = True
++# config_opts['plugin_conf']['package_state_opts'] = {}
++#
config_opts['plugin_conf']['package_state_opts']['available_pkgs']
= False
++#
config_opts['plugin_conf']['package_state_opts']['installed_pkgs']
= True
++# config_opts['plugin_conf']['ccache_enable'] = False
++# config_opts['plugin_conf']['ccache_opts'] = {}
++#
config_opts['plugin_conf']['ccache_opts']['max_cache_size']
= '4G'
++# config_opts['plugin_conf']['ccache_opts']['compress'] =
None
++# config_opts['plugin_conf']['ccache_opts']['dir'] =
"{{cache_topdir}}/{{root}}/ccache/u{{chrootuid}}/"
++# config_opts['plugin_conf']['yum_cache_enable'] = True
++# config_opts['plugin_conf']['yum_cache_opts'] = {}
++#
config_opts['plugin_conf']['yum_cache_opts']['max_age_days']
= 30
++#
config_opts['plugin_conf']['yum_cache_opts']['max_metadata_age_days']
= 30
++# config_opts['plugin_conf']['yum_cache_opts']['online'] =
True
++# config_opts['plugin_conf']['root_cache_enable'] = True
++# config_opts['plugin_conf']['root_cache_opts'] = {}
++#
config_opts['plugin_conf']['root_cache_opts']['age_check'] =
True
++#
config_opts['plugin_conf']['root_cache_opts']['max_age_days']
= 15
++# config_opts['plugin_conf']['root_cache_opts']['dir'] =
"{{cache_topdir}}/{{root}}/root_cache/"
++#
config_opts['plugin_conf']['root_cache_opts']['compress_program']
= "pigz"
++## decompress_program is needed only for bsdtar, otherwise `compress_program` with `-d`
is used
++## for bsdtar use "unpigz" or "gunzip"
++#
config_opts['plugin_conf']['root_cache_opts']['decompress_program']
= "pigz"
++#
config_opts['plugin_conf']['root_cache_opts']['extension'] =
".gz"
++#
config_opts['plugin_conf']['root_cache_opts']['exclude_dirs']
= ["./proc", "./sys", "./dev",
++#
"./var/tmp/ccache", "./var/cache/yum",
++#
"./var/cache/dnf", "./var/log" ]
++# config_opts['plugin_conf']['hw_info_enable'] = True
++# config_opts['plugin_conf']['hw_info_opts'] = {}
++#
++# config_opts['plugin_conf']['procenv_enable'] = False
++# config_opts['plugin_conf']['procenv_opts'] = {}
++#
++# bind mount plugin is enabled by default but has no configured directories to
++# mount
++# config_opts['plugin_conf']['bind_mount_enable'] = True
++#
config_opts['plugin_conf']['bind_mount_opts']['dirs'].append(('/host/path',
'/bind/mount/path/in/chroot/' ))
++#
++# config_opts['plugin_conf']['tmpfs_enable'] = False
++# config_opts['plugin_conf']['tmpfs_opts'] = {}
++#
config_opts['plugin_conf']['tmpfs_opts']['required_ram_mb']
= 1024
++# config_opts['plugin_conf']['tmpfs_opts']['max_fs_size']
= '768m'
++# config_opts['plugin_conf']['tmpfs_opts']['mode'] =
'0755'
++# config_opts['plugin_conf']['tmpfs_opts']['keep_mounted']
= False
++#
++# config_opts['plugin_conf']['chroot_scan_enable'] = False
++# config_opts['plugin_conf']['chroot_scan_opts'] = {
++## Regexp of files which should be copied from buildroot to resultdir.
++# 'regexes': [ "^[^k]?core(\.\d+)?", "\.log$",],
++## If set to True files are copied only if build failed.
++# 'only_failed': True,
++#}
++#
++# lvm_root plugin is not enabled by default and is distributed in separate
++# subpackage mock-lvm. If you want to use it, it's recommended to disable the
++# root_cache plugin, otherwise you'd be caching twice.
++# config_opts['plugin_conf']['lvm_root_enable'] = False
++# config_opts['plugin_conf']['lvm_root_opts'] = {}
++# You need to give it a volume group with sufficient space. It won't touch any
++# of the existing logical volumes, so you can use the same volume group you use
++# for other purposes. It requires a name of the VG (not device path).
++#
config_opts['plugin_conf']['lvm_root_opts']['volume_group']
= 'my_vg'
++# You need to specify the size that will mock's thinpool occupy. For regular
++# packages with small set of dependencies, 2G should suffice. For large packages
++# such as libreoffice, you should set it to at least 5 GB otherwise you may run
++# out of space and the build process will be blocked
++# config_opts['plugin_conf']['lvm_root_opts']['size'] =
'2G'
++# You can specify alternative pool metadata size, format is the same as size.
++# Default value is determined by lvcreate based on size
++#
config_opts['plugin_conf']['lvm_root_opts']['poolmetadatasize']
= None
++# When thin pool utilization is over 90% mock will refuse to continue.
++# Because once it reach 100% utilization weird things will happens.
++#
config_opts['plugin_conf']['lvm_root_opts']['check_size'] =
True
++# Specifying whether the buildroot volume should stay mounted after mock exits.
++#
config_opts['plugin_conf']['lvm_root_opts']['umount_root'] =
False
++# Filesystem name that will be used for the volume. It will use mkfs.$filesystem binary
to create it.
++#
config_opts['plugin_conf']['lvm_root_opts']['filesystem'] =
"ext4"
++# The whole command for creating the filesystem that will get the volume path as an
argument. When set, overrides above
++# option.
++#
config_opts['plugin_conf']['lvm_root_opts']['mkfs_command']
= None
++# Additional arguments passed to mkfs command.
++# config_opts['plugin_conf']['lvm_root_opts']['mkfs_args']
= []
++# Will be passed to -o option of mount when mounting the volume. String or None.
++#
config_opts['plugin_conf']['lvm_root_opts']['mount_opts'] =
None
++# How long to sleep when waiting for concurrent LVM initialization.
++#
config_opts['plugin_conf']['lvm_root_opts']['sleep_time'] =
1
++#
++# overlayfs plugin
++# It is recomended to disable root_cache plugin, when overlayfs plugin
++# is enabled since overlayfs plugin implicitly creates postinit snapshot
++# ( similary to lvm_root plugin), which makes root cache pointless.
++# ( Recomended with: config_opts['plugin_conf']['root_cache_enable']
= False )
++# config_opts['plugin_conf']['overlayfs_enable'] = False
++# config_opts['plugin_conf']['overlayfs_opts']['base_dir']
= /some/directory
++#
config_opts['plugin_conf']['overlayfs_opts']['touch_rpmdb']
= False
++
++### pm_request plugin can install packages requested from within the buildroot
++# It is disabled by default, as it affects build reproducibility. It can be enabled
++# by setting the following to True, but it's not advised to have it enabled
globally.
++# It's better to enable it per build by using --enable-plugin pm_request
++# config_opts['plugin_conf']['pm_request_enable'] = False
++# config_opts['plugin_conf']['pm_request_opts'] = {}
++
++### If you want to compress mock logs, enable this plugin
++# config_opts['plugin_conf']['compress_logs_enable'] = False
++### Command used to compress logs - e.g. "/usr/bin/xz -9 --force"
++#
config_opts['plugin_conf']['compress_logs_opts']['command']
= "gzip"
++
++# Configuration options for the sign plugin:
++# config_opts['plugin_conf']['sign_enable'] = False
++# config_opts['plugin_conf']['sign_opts'] = {}
++# config_opts['plugin_conf']['sign_opts']['cmd'] =
'rpmsign'
++# The options to pass to the signing command. %(rpms)s will be expanded to
++# the rpms in the results folder.
++# config_opts['plugin_conf']['sign_opts']['opts'] =
'--addsign %(rpms)s -D "%%_gpg_name your_name" -D "%%_gpg_path
/home/your_name/.gnupg"'
++
++#############################################################################
++#
++# environment for chroot
++#
++# config_opts['environment']['TERM'] = 'vt100'
++# config_opts['environment']['SHELL'] = '/bin/bash'
++# config_opts['environment']['HOME'] = '/builddir'
++# config_opts['environment']['HOSTNAME'] = 'mock'
++# config_opts['environment']['PATH'] =
'/usr/bin:/bin:/usr/sbin:/sbin'
++# config_opts['environment']['PROMPT_COMMAND'] = r'printf
"\033]0;<mock-chroot>\007"'
++# config_opts['environment']['PS1'] = r'<mock-chroot>
\s-\v\$ '
++# config_opts['environment']['LANG'] = 'C.UTF-8'
++#
++## other example for PS1
++# config_opts['environment']['PS1'] =
r'[\u@\h<mock-chroot>/\w]\[\033[01;31m\]${?/#0/}\[\033[00m\]\$'
++# feel free to craft your own at:
http://bashrcgenerator.com/
++
++#############################################################################
++#
++# Things that you can change, but we dont recommend it:
++# config_opts['chroothome'] = '/builddir'
++# config_opts['clean'] = True
++## you could not really use substitution here so it will not work if overridden:
++# config['rootdir'] = '/var/lib/mock/<CONFIG>/root/'
++## This works in F25+ chroots. This overrides 'use_container_host_hostname'
option
++# config_opts['macros']['%_buildhost'] =
'my.own.hostname'
++
++#############################################################################
++#
++# Things that must be adjusted if SCM integration is used:
++#
++# config_opts['scm'] = True
++# config_opts['scm_opts']['method'] = 'git'
++# config_opts['scm_opts']['cvs_get'] = 'cvs -d /srv/cvs co
SCM_BRN SCM_PKG'
++# if there is "--recurse-submodules" or "--recursive" then git
submodules are checkout too
++# config_opts['scm_opts']['git_get'] = 'git clone SCM_BRN
git://localhost/SCM_PKG.git SCM_PKG'
++# config_opts['scm_opts']['svn_get'] = 'svn co
file:///srv/svn/SCM_PKG/SCM_BRN SCM_PKG'
++# config_opts['scm_opts']['distgit_get'] = 'rpkg clone -a
--branch SCM_BRN SCM_PKG SCM_PKG'
++# config_opts['scm_opts']['distgit_src_get'] = 'rpkg
sources'
++# config_opts['scm_opts']['spec'] = 'SCM_PKG.spec'
++# config_opts['scm_opts']['ext_src_dir'] = '/dev/null'
++# config_opts['scm_opts']['write_tar'] = True
++# config_opts['scm_opts']['git_timestamps'] = True
++# config_opts['scm_opts']['exclude_vcs'] = True
++
++# These options are also recognized but usually defined in cmd line
++# with --scm-option package=<pkg> --scm-option branch=<branch>
++# config_opts['scm_opts']['package'] = 'mypkg'
++# config_opts['scm_opts']['branch'] = 'master'
++
++#############################################################################
++#
++# Things that are best suited for individual chroot config files:
++#
++# MUST SET (in individual chroot cfg file):
++# config_opts['root'] = 'name-of-yum-build-dir'
++# Mock will set architecture to 'target_arch' using personality(2) syscall.
++# config_opts['target_arch'] = 'i386'
++# When host system architecture is not in 'legal_host_arches' list, mock will
refuse to switch to
++# 'target_arch' and will raise error.
++# config_opts['legal_host_arches'] = ('i386', 'i586',
'i686', 'x86_64')
++# Contains content of $CHROOT/etc/yum/yum.conf or $CHROOT/etc/dnf/dnf.conf. If DNF is
used and
++# 'dnf.conf' is not set, then content of 'yum.conf' is used to
populate $CHROOT/etc/dnf/dnf.conf
++# and vice versa. But only one of those two can be specified.
++# config_opts['yum.conf'] = ''
++# or
++# config_opts['dnf.conf'] = ''
++# Important! You must use 'assumeyes=1' in yum/dnf.conf otherwise Mock will
fail.
++#
++# This is used by DNF and can be used in dnf.conf as $key and will be replaced by its
value
++# config_opts['dnf_vars'] = { 'key': 'value',
'key2': 'value2' }
++#
++# Flip this if you want to get rid of warning message on systems which do not
++# support the desired package manager (e.g. when only Yum is available on host,
++# but the chosen buildroot expects to be installed via Dnf).
++# Warning! Setting this to False will automatically use Yum on RHEL{6,7} platforms.
++# config_opts['dnf_warning'] = True
++#
++# CAN SET, defaults usually work ok:
++# config_opts['chroot_setup_cmd'] = 'install buildsys-build'
++# config_opts['chroot_additional_packages'] = ''
++# config_opts['log_config_file'] = 'logging.ini'
++# config_opts['more_buildreqs']['srpm_name-version-release'] =
'dependency'
++# config_opts['more_buildreqs']['srpm_name-version-release'] =
['dependency1', 'dependency2']
++# config_opts['macros']['%Add_your_macro_name_here'] = "add
macro value here"
++# config_opts['files']['path/name/no/leading/slash'] = "put
file contents here."
++# config_opts['chrootuid'] = os.getuid()
++# config_opts['releasever'] = '20'
++# config_opts['dnf_disable_plugins'] = ['local',
'spacewalk']
++# config_opts['yum_common_opts'] = []
++# config_opts['dnf_common_opts'] = ['--setopt=deltarpm=False',
'--allowerasing']
++# config_opts['yum_builddep_opts'] = []
++# config_opts['dnf_builddep_opts'] = []
++# config_opts['microdnf_command'] = '/usr/bin/microdnf'
++## "dnf-install" is special keyword which tells mock to use install but with
DNF
++# config_opts['microdnf_install_command'] = 'dnf-install microdnf dnf
dnf-plugins-core'
++# config_opts['microdnf_builddep_command'] = '/usr/bin/dnf'
++# config_opts['microdnf_builddep_opts'] = []
++# config_opts['microdnf_common_opts'] = []
++# config_opts['priorities.conf'] = 'put file contents here.'
++# config_opts['rhnplugin.conf'] = 'put file contents here.'
++## Important! You should register your host machine first!
++# config_opts['subscription-manager.conf'] = 'put file contents
here.'
++## This will only work with DNF and when repo is configured with modules=1 for repo in
dnf.conf.
++
++# List of module commands to be executed when initializing chroot, before
++# `chroot_setup_cmd`. Each command is a pair like `(action, module_specs)`
++# where `module_specs` is a comma-separated list of module specifications.
++# The commands are executed in order they are configured here, and each
++# `action` can be executed multiple times.
++#
++## Artificial example: (a) Disable any potentially enabled postgresql module
++## stream, (b) enable _specific_ postgresql and ruby module streams,
++## (c) install the development nodejs profile and (d) disable it immediately.
++#config_opts['module_setup_commands'] = [
++# ('disable', 'postgresql'),
++# ('enable', 'postgresql:12, ruby:2.6'),
++# ('install', 'nodejs:13/development'),
++# ('disable', 'nodejs'),
++#]
++
++## Use this to force foreing architecture (requires qemu-user-static)
++# config_opts['forcearch'] = None
++# If you change chrootgid, you must also change "mock" to the correct group
++# name in this line of the mock PAM config:
++# auth sufficient pam_succeed_if.so user ingroup mock use_uid quiet
++# config_opts['chrootgid'] = grp.getgrnam("mock")[2]
++# name of user that is used when executing commands inside the chroot
++# config_opts['chrootuser'] = 'mockbuild'
++# name of the group inside of chroot
++# config_opts['chrootgroup'] = 'mock'
++
++# config_opts['useradd'] = '/usr/sbin/useradd -m -u {{chrootuid}} -g
{{chrootgid}} -d {{chroothome}} -n {{chrootuser}}' # Fedora/RedHat
++#
++# Security related
++# config_opts['no_root_shells'] = False
++#
++# Proxy settings (https_proxy, ftp_proxy, and no_proxy can also be set)
++# You can set a specific proxy: 'http://localhost:3128'
++# But by default, the existing environment variables are re-used
++# config_opts['http_proxy'] = os.getenv("http_proxy")
++# config_opts['ftp_proxy'] = os.getenv("ftp_proxy")
++# config_opts['https_proxy'] = os.getenv("https_proxy")
++# config_opts['no_proxy'] = os.getenv("no_proxy")
++
++#
++# Extra dirs to be created when the chroot is initialized
++# This is just a list of strings representing chroot paths such as:
++# [ '/run/lock', ]
++# config_opts['extra_chroot_dirs'] = []
++#
++# Set timeout in seconds for common mock operations
++# if 0 is set, then no time limit is used
++# config_opts['opstimeout'] = 0
++
++# Copy host's SSL certificate bundle ('/etc/pki/tls/certs/ca-bundle.crt')
into
++# specified location inside chroot. This usually isn't needed because we copy
++# the whole /etc/pki/ca-trust/extracted directory recursively by default, and
++# Fedora or EL systems work with that. But some destination chroots can have
++# different configuration, and copying the bundle helps.
++#config_opts['ssl_ca_bundle_path'] = None
+--
+2.27.0
+
diff --git a/0011-Fix-clear.cfg.patch b/0011-Fix-clear.cfg.patch
new file mode 100644
index 0000000..05a9f09
--- /dev/null
+++ b/0011-Fix-clear.cfg.patch
@@ -0,0 +1,37 @@
+From 99027a8ce43864f3be3672d0ba45c3e6cf275b72 Mon Sep 17 00:00:00 2001
+From: insilications <boboniboni(a)gmail.com>
+Date: Sun, 2 Aug 2020 03:11:28 -0300
+Subject: [PATCH 11/12] Fix clear.cfg
+
+- Use jinja expansions for useradd macros.
+
+- Use config_opts['use_bootstrap'] instead of
+config_opts['use_bootstrap_container'] (deprecated in 2.4.1)
+---
+ mock/etc/mock/clear.cfg | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/mock/etc/mock/clear.cfg b/mock/etc/mock/clear.cfg
+index 49e866b..2908ef5 100644
+--- a/mock/etc/mock/clear.cfg
++++ b/mock/etc/mock/clear.cfg
+@@ -4,14 +4,14 @@ config_opts['legal_host_arches'] = ('x86_64',)
+ config_opts['chroot_setup_cmd'] = 'groupinstall build srpm-build'
+ config_opts['dist'] = 'clear' # only useful for --resultdir
variable subst
+ config_opts['extra_chroot_dirs'] = [ '/run/lock', ]
+-config_opts['useradd'] = '/usr/sbin/useradd -m -u %(uid)s -g %(gid)s -d
%(home)s %(user)s'
++config_opts['useradd'] = '/usr/sbin/useradd -m -u {{chrootuid}} -g
{{chrootgid}} -d {{chroothome}} {{chrootuser}}'
+ config_opts['plugin_conf']['ccache_enable'] = False
+
config_opts['plugin_conf']['root_cache_opts']['compress_program']
= 'zstd -5'
+ config_opts['plugin_conf']['root_cache_opts']['extension']
= '.zst'
+ config_opts['releasever'] = 'clear'
+ config_opts['package_manager'] = 'dnf'
+ config_opts['chrootgroup'] = 'mockbuild'
+-config_opts['use_bootstrap_container'] = False
++config_opts['use_bootstrap'] = False
+
+ config_opts['dnf.conf'] = """
+ [main]
+--
+2.27.0
+
diff --git a/0012-Add-Clear-Linux-cert_path.patch b/0012-Add-Clear-Linux-cert_path.patch
new file mode 100644
index 0000000..d63a6f9
--- /dev/null
+++ b/0012-Add-Clear-Linux-cert_path.patch
@@ -0,0 +1,26 @@
+From 01a39d173eacb4a032fee9cb0a908bb97706f8ec Mon Sep 17 00:00:00 2001
+From: insilications <boboniboni(a)gmail.com>
+Date: Sun, 2 Aug 2020 03:12:44 -0300
+Subject: [PATCH 12/12] Add Clear Linux cert_path
+
+Change '/etc/pki/ca-trust' to the correct CL path.
+---
+ mock/py/mockbuild/package_manager.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/mock/py/mockbuild/package_manager.py b/mock/py/mockbuild/package_manager.py
+index 1ba26da..cb6c391 100644
+--- a/mock/py/mockbuild/package_manager.py
++++ b/mock/py/mockbuild/package_manager.py
+@@ -301,7 +301,7 @@ Error: Neither dnf-utils nor yum-utils are installed. Dnf-utils
or yum-util
+
+ @traceLog()
+ def copy_certs(self):
+- cert_path = "/etc/pki/ca-trust"
++ cert_path = "/var/cache/ca-certs/anchors"
+ pki_dir = self.buildroot.make_chroot_path(cert_path)
+ try:
+ copy_tree(cert_path, pki_dir)
+--
+2.27.0
+
diff --git a/Makefile b/Makefile
index 442c0c5..5503cf8 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
PKG_NAME := mock
-URL =
https://github.com/rpm-software-management/mock/archive/mock-1.4.21-1/mock-…
+URL =
https://github.com/rpm-software-management/mock/archive/mock-2.4-1.tar.gz
ARCHIVES =
include ../common/Makefile.common
diff --git a/options.conf b/options.conf
index 47b7b22..94f79b7 100644
--- a/options.conf
+++ b/options.conf
@@ -1,6 +1,6 @@
[package]
name = mock
-url =
https://github.com/rpm-software-management/mock/archive/mock-1.4.21-1/mock-…
+url =
https://github.com/rpm-software-management/mock/archive/mock-2.4-1.tar.gz
archives =
giturl =
https://github.com/rpm-software-management/mock.git
domain = RPM
diff --git a/series b/series
index 45b684b..d4b611f 100644
--- a/series
+++ b/series
@@ -6,5 +6,7 @@
0006-GNU-tar-in-Clear-Linux-OS-is-named-tar.patch
0007-Set-chroot-group-to-mockbuild.patch
0008-Add-option-for-systemd-nspawn-to-prevent-stdin-being.patch
-0009-Disable-Jinja2-use.patch
-0010-Do-not-disable-unavailable-plugin.patch
+0009-Do-not-disable-unavailable-plugin.patch
+0010-Add-site-defaults.cfg.patch
+0011-Fix-clear.cfg.patch
+0012-Add-Clear-Linux-cert_path.patch
--
2.27.0