diff --git a/mock-core-configs/etc/mock/eol/templates/centos-6.tpl b/mock-core-configs/etc/mock/eol/templates/centos-6.tpl index e9d4baa77..28e5e4b13 100644 --- a/mock-core-configs/etc/mock/eol/templates/centos-6.tpl +++ b/mock-core-configs/etc/mock/eol/templates/centos-6.tpl @@ -1,6 +1,6 @@ # This list is taken from 'epel-6-x86_64' @buildsys-build group, minus the # 'epel-*' specific stuff. -config_opts['chroot_setup_cmd'] = 'install bash bzip2 coreutils cpio diffutils findutils gawk gcc gcc-c++ grep gzip info make patch redhat-rpm-config rpm-build sed shadow-utils tar unzip util-linux-ng which xz' +config_opts['chroot_setup_cmd'] = 'install bash bzip2 coreutils cpio diffutils findutils gawk gcc gcc-c++ grep gzip info make patch redhat-rpm-config rpm-build sed tar unzip util-linux-ng which xz' config_opts['dist'] = 'el6' # only useful for --resultdir variable subst # beware RHEL uses 6Server or 6Client diff --git a/mock-core-configs/etc/mock/eol/templates/centos-8.tpl b/mock-core-configs/etc/mock/eol/templates/centos-8.tpl index 20af686c6..5902d4db6 100644 --- a/mock-core-configs/etc/mock/eol/templates/centos-8.tpl +++ b/mock-core-configs/etc/mock/eol/templates/centos-8.tpl @@ -1,4 +1,4 @@ -config_opts['chroot_setup_cmd'] = 'install tar gcc-c++ redhat-rpm-config redhat-release which xz sed make bzip2 gzip gcc coreutils unzip shadow-utils diffutils cpio bash gawk rpm-build info patch util-linux findutils grep' +config_opts['chroot_setup_cmd'] = 'install tar gcc-c++ redhat-rpm-config redhat-release which xz sed make bzip2 gzip gcc coreutils unzip diffutils cpio bash gawk rpm-build info patch util-linux findutils grep' config_opts['dist'] = 'el8' # only useful for --resultdir variable subst config_opts['releasever'] = '8' config_opts['package_manager'] = 'dnf' diff --git a/mock-core-configs/etc/mock/eol/templates/rhel-6.tpl b/mock-core-configs/etc/mock/eol/templates/rhel-6.tpl index cb3309b6b..7d973e013 100644 --- a/mock-core-configs/etc/mock/eol/templates/rhel-6.tpl +++ b/mock-core-configs/etc/mock/eol/templates/rhel-6.tpl @@ -1,6 +1,6 @@ # This list is taken from 'epel-6-x86_64' @buildsys-build group, minus the # 'epel-*' specific stuff. -config_opts['chroot_setup_cmd'] = 'install bash bzip2 coreutils cpio diffutils findutils gawk gcc gcc-c++ grep gzip info make patch redhat-rpm-config rpm-build sed shadow-utils tar unzip util-linux-ng which xz' +config_opts['chroot_setup_cmd'] = 'install bash bzip2 coreutils cpio diffutils findutils gawk gcc gcc-c++ grep gzip info make patch redhat-rpm-config rpm-build sed tar unzip util-linux-ng which xz' config_opts['dist'] = 'el6' # only useful for --resultdir variable subst # beware RHEL uses 6Server or 6Client diff --git a/mock-core-configs/etc/mock/templates/almalinux-8.tpl b/mock-core-configs/etc/mock/templates/almalinux-8.tpl index c21017d15..cdaeb38ab 100644 --- a/mock-core-configs/etc/mock/templates/almalinux-8.tpl +++ b/mock-core-configs/etc/mock/templates/almalinux-8.tpl @@ -1,4 +1,4 @@ -config_opts['chroot_setup_cmd'] = 'install tar gcc-c++ redhat-rpm-config redhat-release which xz sed make bzip2 gzip gcc coreutils unzip shadow-utils diffutils cpio bash gawk rpm-build info patch util-linux findutils grep' +config_opts['chroot_setup_cmd'] = 'install tar gcc-c++ redhat-rpm-config redhat-release which xz sed make bzip2 gzip gcc coreutils unzip diffutils cpio bash gawk rpm-build info patch util-linux findutils grep' config_opts['dist'] = 'el8.alma' # only useful for --resultdir variable subst config_opts['releasever'] = '8' config_opts['package_manager'] = 'dnf' diff --git a/mock-core-configs/etc/mock/templates/almalinux-9.tpl b/mock-core-configs/etc/mock/templates/almalinux-9.tpl index faa678696..1786515c5 100644 --- a/mock-core-configs/etc/mock/templates/almalinux-9.tpl +++ b/mock-core-configs/etc/mock/templates/almalinux-9.tpl @@ -1,4 +1,4 @@ -config_opts['chroot_setup_cmd'] = 'install bash bzip2 coreutils cpio diffutils redhat-release findutils gawk glibc-minimal-langpack grep gzip info patch redhat-rpm-config rpm-build sed shadow-utils tar unzip util-linux which xz' +config_opts['chroot_setup_cmd'] = 'install bash bzip2 coreutils cpio diffutils redhat-release findutils gawk glibc-minimal-langpack grep gzip info patch redhat-rpm-config rpm-build sed tar unzip util-linux which xz' config_opts['dist'] = 'el9.alma' # only useful for --resultdir variable subst config_opts['releasever'] = '9' config_opts['package_manager'] = 'dnf' diff --git a/mock-core-configs/etc/mock/templates/amazonlinux-2023.tpl b/mock-core-configs/etc/mock/templates/amazonlinux-2023.tpl index 0100a11c8..73ae2e5a0 100644 --- a/mock-core-configs/etc/mock/templates/amazonlinux-2023.tpl +++ b/mock-core-configs/etc/mock/templates/amazonlinux-2023.tpl @@ -1,5 +1,5 @@ config_opts['root'] = 'amazonlinux-2023-{{ target_arch }}' -config_opts['chroot_setup_cmd'] = 'install system-release bash bzip2 coreutils cpio diffutils findutils gawk glibc-minimal-langpack grep gzip info patch rpm-build sed shadow-utils system-rpm-config tar unzip util-linux which xz' +config_opts['chroot_setup_cmd'] = 'install system-release bash bzip2 coreutils cpio diffutils findutils gawk glibc-minimal-langpack grep gzip info patch rpm-build sed system-rpm-config tar unzip util-linux which xz' config_opts['dist'] = 'amzn2023' # only useful for --resultdir variable subst config_opts['plugin_conf']['ccache_enable'] = False config_opts['package_manager'] = 'dnf' diff --git a/mock-core-configs/etc/mock/templates/anolis-7.tpl b/mock-core-configs/etc/mock/templates/anolis-7.tpl index 1b9e7e6bf..5db15efdf 100644 --- a/mock-core-configs/etc/mock/templates/anolis-7.tpl +++ b/mock-core-configs/etc/mock/templates/anolis-7.tpl @@ -1,4 +1,4 @@ -config_opts['chroot_setup_cmd'] = 'install bash bzip2 coreutils cpio diffutils findutils gawk gcc gcc-c++ grep gzip info make patch redhat-rpm-config anolis-release rpm-build sed shadow-utils tar unzip util-linux which xz' +config_opts['chroot_setup_cmd'] = 'install bash bzip2 coreutils cpio diffutils findutils gawk gcc gcc-c++ grep gzip info make patch redhat-rpm-config anolis-release rpm-build sed tar unzip util-linux which xz' config_opts['dist'] = 'an7' # only useful for --resultdir variable subst config_opts['releasever'] = '7' diff --git a/mock-core-configs/etc/mock/templates/anolis-8.tpl b/mock-core-configs/etc/mock/templates/anolis-8.tpl index f1a6e0469..7a0ecbd4f 100644 --- a/mock-core-configs/etc/mock/templates/anolis-8.tpl +++ b/mock-core-configs/etc/mock/templates/anolis-8.tpl @@ -1,4 +1,4 @@ -config_opts['chroot_setup_cmd'] = 'install tar gcc-c++ redhat-rpm-config anolis-release which xz sed make bzip2 gzip gcc coreutils unzip shadow-utils diffutils cpio bash gawk rpm-build info patch util-linux findutils grep' +config_opts['chroot_setup_cmd'] = 'install tar gcc-c++ redhat-rpm-config anolis-release which xz sed make bzip2 gzip gcc coreutils unzip diffutils cpio bash gawk rpm-build info patch util-linux findutils grep' config_opts['dist'] = 'an8' # only useful for --resultdir variable subst config_opts['releasever'] = '8' config_opts['package_manager'] = 'dnf' diff --git a/mock-core-configs/etc/mock/templates/centos-7.tpl b/mock-core-configs/etc/mock/templates/centos-7.tpl index 66880d1a8..34462eb91 100644 --- a/mock-core-configs/etc/mock/templates/centos-7.tpl +++ b/mock-core-configs/etc/mock/templates/centos-7.tpl @@ -1,6 +1,6 @@ # This list is taken from 'epel-7-x86_64' @buildsys-build group, minus the # 'epel-*' specific stuff. -config_opts['chroot_setup_cmd'] = 'install bash bzip2 coreutils cpio diffutils findutils gawk gcc gcc-c++ grep gzip info make patch redhat-rpm-config rpm-build sed shadow-utils tar unzip util-linux which xz' +config_opts['chroot_setup_cmd'] = 'install bash bzip2 coreutils cpio diffutils findutils gawk gcc gcc-c++ grep gzip info make patch redhat-rpm-config rpm-build sed tar unzip util-linux which xz' config_opts['dist'] = 'el7' # only useful for --resultdir variable subst config_opts['releasever'] = '7' diff --git a/mock-core-configs/etc/mock/templates/centos-stream-8.tpl b/mock-core-configs/etc/mock/templates/centos-stream-8.tpl index 2869ba061..1d06c7163 100644 --- a/mock-core-configs/etc/mock/templates/centos-stream-8.tpl +++ b/mock-core-configs/etc/mock/templates/centos-stream-8.tpl @@ -1,4 +1,4 @@ -config_opts['chroot_setup_cmd'] = 'install tar gcc-c++ redhat-rpm-config redhat-release which xz sed make bzip2 gzip gcc coreutils unzip shadow-utils diffutils cpio bash gawk rpm-build info patch util-linux findutils grep' +config_opts['chroot_setup_cmd'] = 'install tar gcc-c++ redhat-rpm-config redhat-release which xz sed make bzip2 gzip gcc coreutils unzip diffutils cpio bash gawk rpm-build info patch util-linux findutils grep' config_opts['dist'] = 'el8' # only useful for --resultdir variable subst config_opts['releasever'] = '8' config_opts['package_manager'] = 'dnf' diff --git a/mock-core-configs/etc/mock/templates/centos-stream-9.tpl b/mock-core-configs/etc/mock/templates/centos-stream-9.tpl index 0aee484df..c82321fea 100644 --- a/mock-core-configs/etc/mock/templates/centos-stream-9.tpl +++ b/mock-core-configs/etc/mock/templates/centos-stream-9.tpl @@ -1,4 +1,4 @@ -config_opts['chroot_setup_cmd'] = 'install tar redhat-rpm-config redhat-release which xz sed make bzip2 gzip coreutils unzip shadow-utils diffutils cpio bash gawk rpm-build info patch util-linux findutils grep glibc-minimal-langpack' +config_opts['chroot_setup_cmd'] = 'install tar redhat-rpm-config redhat-release which xz sed make bzip2 gzip coreutils unzip diffutils cpio bash gawk rpm-build info patch util-linux findutils grep glibc-minimal-langpack' config_opts['dist'] = 'el9' # only useful for --resultdir variable subst config_opts['releasever'] = '9' config_opts['package_manager'] = 'dnf' diff --git a/mock-core-configs/etc/mock/templates/circlelinux-8.tpl b/mock-core-configs/etc/mock/templates/circlelinux-8.tpl index a375b82eb..27eed56c7 100644 --- a/mock-core-configs/etc/mock/templates/circlelinux-8.tpl +++ b/mock-core-configs/etc/mock/templates/circlelinux-8.tpl @@ -1,4 +1,4 @@ -config_opts['chroot_setup_cmd'] = 'install tar gcc-c++ redhat-rpm-config redhat-release which xz sed make bzip2 gzip gcc coreutils unzip shadow-utils diffutils cpio bash gawk rpm-build info patch util-linux findutils grep' +config_opts['chroot_setup_cmd'] = 'install tar gcc-c++ redhat-rpm-config redhat-release which xz sed make bzip2 gzip gcc coreutils unzip diffutils cpio bash gawk rpm-build info patch util-linux findutils grep' config_opts['dist'] = 'el8' # only useful for --resultdir variable subst config_opts['releasever'] = '8' config_opts['package_manager'] = 'dnf' diff --git a/mock-core-configs/etc/mock/templates/eurolinux-8.tpl b/mock-core-configs/etc/mock/templates/eurolinux-8.tpl index bd9147d53..9d0ec43bf 100644 --- a/mock-core-configs/etc/mock/templates/eurolinux-8.tpl +++ b/mock-core-configs/etc/mock/templates/eurolinux-8.tpl @@ -1,7 +1,7 @@ # EuroLinux open buildroots # Note: perl modules are broken by design -config_opts['chroot_setup_cmd'] = 'install tar gcc-c++ redhat-rpm-config redhat-release which xz sed make bzip2 gzip gcc coreutils unzip shadow-utils diffutils cpio bash gawk rpm-build info patch util-linux findutils grep' +config_opts['chroot_setup_cmd'] = 'install tar gcc-c++ redhat-rpm-config redhat-release which xz sed make bzip2 gzip gcc coreutils unzip diffutils cpio bash gawk rpm-build info patch util-linux findutils grep' config_opts['dist'] = 'el8' # only useful for --resultdir variable subst config_opts['releasever'] = '8' config_opts['package_manager'] = 'dnf' diff --git a/mock-core-configs/etc/mock/templates/eurolinux-9.tpl b/mock-core-configs/etc/mock/templates/eurolinux-9.tpl index 23791fd40..cdd73f7e6 100644 --- a/mock-core-configs/etc/mock/templates/eurolinux-9.tpl +++ b/mock-core-configs/etc/mock/templates/eurolinux-9.tpl @@ -1,6 +1,6 @@ # EuroLinux open buildroots -config_opts['chroot_setup_cmd'] = 'install tar gcc-c++ redhat-rpm-config redhat-release which xz sed make bzip2 gzip gcc coreutils unzip shadow-utils diffutils cpio bash gawk rpm-build info patch util-linux findutils grep' +config_opts['chroot_setup_cmd'] = 'install tar gcc-c++ redhat-rpm-config redhat-release which xz sed make bzip2 gzip gcc coreutils unzip diffutils cpio bash gawk rpm-build info patch util-linux findutils grep' config_opts['dist'] = 'el9' # only useful for --resultdir variable subst config_opts['releasever'] = '9' config_opts['package_manager'] = 'dnf' diff --git a/mock-core-configs/etc/mock/templates/fedora-eln.tpl b/mock-core-configs/etc/mock/templates/fedora-eln.tpl index 5fd511847..3d2330636 100644 --- a/mock-core-configs/etc/mock/templates/fedora-eln.tpl +++ b/mock-core-configs/etc/mock/templates/fedora-eln.tpl @@ -8,7 +8,7 @@ config_opts['root'] = 'fedora-eln-{{ target_arch }}' # Note that similar idiom used in fedora-branched.tpl and fedora-rawhide.tpl. config_opts['mirrored'] = config_opts['target_arch'] != 'i686' -config_opts['chroot_setup_cmd'] = 'install bash bzip2 coreutils cpio diffutils fedora-release-eln findutils gawk glibc-minimal-langpack grep gzip info patch redhat-rpm-config rpm-build sed shadow-utils tar unzip util-linux which xz' +config_opts['chroot_setup_cmd'] = 'install bash bzip2 coreutils cpio diffutils fedora-release-eln findutils gawk glibc-minimal-langpack grep gzip info patch redhat-rpm-config rpm-build sed tar unzip util-linux which xz' config_opts['dist'] = 'eln' # only useful for --resultdir variable subst config_opts['extra_chroot_dirs'] = [ '/run/lock', ] diff --git a/mock-core-configs/etc/mock/templates/navy-8.tpl b/mock-core-configs/etc/mock/templates/navy-8.tpl index f7dc087be..6a47afd79 100644 --- a/mock-core-configs/etc/mock/templates/navy-8.tpl +++ b/mock-core-configs/etc/mock/templates/navy-8.tpl @@ -1,4 +1,4 @@ -config_opts['chroot_setup_cmd'] = 'install tar gcc-c++ redhat-rpm-config system-release which xz sed make bzip2 gzip gcc coreutils unzip shadow-utils diffutils cpio bash gawk rpm-build info patch util-linux findutils grep' +config_opts['chroot_setup_cmd'] = 'install tar gcc-c++ redhat-rpm-config system-release which xz sed make bzip2 gzip gcc coreutils unzip diffutils cpio bash gawk rpm-build info patch util-linux findutils grep' config_opts['dist'] = 'el8' # only useful for --resultdir variable subst config_opts['releasever'] = '8' config_opts['package_manager'] = 'dnf' diff --git a/mock-core-configs/etc/mock/templates/openeuler-20.03.tpl b/mock-core-configs/etc/mock/templates/openeuler-20.03.tpl index d8cfcfb7f..df0d532e2 100644 --- a/mock-core-configs/etc/mock/templates/openeuler-20.03.tpl +++ b/mock-core-configs/etc/mock/templates/openeuler-20.03.tpl @@ -1,4 +1,4 @@ -config_opts['chroot_setup_cmd'] = 'install tar gcc-c++ openEuler-rpm-config openEuler-release which xz sed make bzip2 gzip gcc coreutils unzip shadow-utils diffutils cpio bash gawk rpm-build info patch util-linux findutils grep' +config_opts['chroot_setup_cmd'] = 'install tar gcc-c++ openEuler-rpm-config openEuler-release which xz sed make bzip2 gzip gcc coreutils unzip diffutils cpio bash gawk rpm-build info patch util-linux findutils grep' config_opts['dist'] = 'oe2003' # only useful for --resultdir variable subst config_opts['releasever'] = '20.03LTS_SP3' config_opts['package_manager'] = 'dnf' diff --git a/mock-core-configs/etc/mock/templates/openeuler-22.03.tpl b/mock-core-configs/etc/mock/templates/openeuler-22.03.tpl index ccd619135..607834a1a 100644 --- a/mock-core-configs/etc/mock/templates/openeuler-22.03.tpl +++ b/mock-core-configs/etc/mock/templates/openeuler-22.03.tpl @@ -1,4 +1,4 @@ -config_opts['chroot_setup_cmd'] = 'install tar gcc-c++ openEuler-rpm-config openEuler-release which xz sed make bzip2 gzip gcc coreutils unzip shadow-utils diffutils cpio bash gawk rpm-build info patch util-linux findutils grep' +config_opts['chroot_setup_cmd'] = 'install tar gcc-c++ openEuler-rpm-config openEuler-release which xz sed make bzip2 gzip gcc coreutils unzip diffutils cpio bash gawk rpm-build info patch util-linux findutils grep' config_opts['dist'] = 'oe2203' # only useful for --resultdir variable subst config_opts['releasever'] = '22.03LTS_SP1' config_opts['package_manager'] = 'dnf' diff --git a/mock-core-configs/etc/mock/templates/oraclelinux-7.tpl b/mock-core-configs/etc/mock/templates/oraclelinux-7.tpl index 0db49a66f..501693786 100644 --- a/mock-core-configs/etc/mock/templates/oraclelinux-7.tpl +++ b/mock-core-configs/etc/mock/templates/oraclelinux-7.tpl @@ -1,6 +1,6 @@ # This list is taken from 'epel-7-x86_64' @buildsys-build group, minus the # 'epel-*' specific stuff. -config_opts['chroot_setup_cmd'] = 'install bash bzip2 coreutils cpio diffutils findutils gawk gcc gcc-c++ grep gzip info make oraclelinux-release patch redhat-rpm-config rpm-build sed shadow-utils tar unzip util-linux which xz' +config_opts['chroot_setup_cmd'] = 'install bash bzip2 coreutils cpio diffutils findutils gawk gcc gcc-c++ grep gzip info make oraclelinux-release patch redhat-rpm-config rpm-build sed tar unzip util-linux which xz' config_opts['dist'] = 'el7' # only useful for --resultdir variable subst config_opts['releasever'] = '7' diff --git a/mock-core-configs/etc/mock/templates/oraclelinux-8.tpl b/mock-core-configs/etc/mock/templates/oraclelinux-8.tpl index 807ed3a70..d0a626d8a 100644 --- a/mock-core-configs/etc/mock/templates/oraclelinux-8.tpl +++ b/mock-core-configs/etc/mock/templates/oraclelinux-8.tpl @@ -1,4 +1,4 @@ -config_opts['chroot_setup_cmd'] = 'install tar gcc-c++ redhat-rpm-config redhat-release oraclelinux-release which xz sed make bzip2 gzip gcc coreutils unzip shadow-utils diffutils cpio bash gawk rpm-build info patch util-linux findutils grep' +config_opts['chroot_setup_cmd'] = 'install tar gcc-c++ redhat-rpm-config redhat-release oraclelinux-release which xz sed make bzip2 gzip gcc coreutils unzip diffutils cpio bash gawk rpm-build info patch util-linux findutils grep' config_opts['dist'] = 'el8' # only useful for --resultdir variable subst config_opts['releasever'] = '8' config_opts['package_manager'] = 'dnf' diff --git a/mock-core-configs/etc/mock/templates/oraclelinux-9.tpl b/mock-core-configs/etc/mock/templates/oraclelinux-9.tpl index 46f858bb4..accc234a9 100644 --- a/mock-core-configs/etc/mock/templates/oraclelinux-9.tpl +++ b/mock-core-configs/etc/mock/templates/oraclelinux-9.tpl @@ -1,4 +1,4 @@ -config_opts['chroot_setup_cmd'] = 'install tar redhat-rpm-config redhat-release oraclelinux-release which xz sed make bzip2 gzip coreutils unzip shadow-utils diffutils cpio bash gawk rpm-build info patch util-linux findutils grep glibc-minimal-langpack' +config_opts['chroot_setup_cmd'] = 'install tar redhat-rpm-config redhat-release oraclelinux-release which xz sed make bzip2 gzip coreutils unzip diffutils cpio bash gawk rpm-build info patch util-linux findutils grep glibc-minimal-langpack' config_opts['dist'] = 'el9' # only useful for --resultdir variable subst config_opts['releasever'] = '9' config_opts['package_manager'] = 'dnf' diff --git a/mock-core-configs/etc/mock/templates/rhel-7.tpl b/mock-core-configs/etc/mock/templates/rhel-7.tpl index 8dce7cbb5..701de5e25 100644 --- a/mock-core-configs/etc/mock/templates/rhel-7.tpl +++ b/mock-core-configs/etc/mock/templates/rhel-7.tpl @@ -1,4 +1,4 @@ -config_opts['chroot_setup_cmd'] = 'install bash bzip2 coreutils cpio diffutils findutils gawk gcc gcc-c++ grep gzip info make patch redhat-rpm-config rpm-build sed shadow-utils tar unzip util-linux which xz' +config_opts['chroot_setup_cmd'] = 'install bash bzip2 coreutils cpio diffutils findutils gawk gcc gcc-c++ grep gzip info make patch redhat-rpm-config rpm-build sed tar unzip util-linux which xz' config_opts['dist'] = 'el7' # only useful for --resultdir variable subst config_opts['releasever'] = '7Server' config_opts['package_manager'] = 'yum' diff --git a/mock-core-configs/etc/mock/templates/rhel-8.tpl b/mock-core-configs/etc/mock/templates/rhel-8.tpl index c8716c52d..2f894d981 100644 --- a/mock-core-configs/etc/mock/templates/rhel-8.tpl +++ b/mock-core-configs/etc/mock/templates/rhel-8.tpl @@ -1,4 +1,4 @@ -config_opts['chroot_setup_cmd'] = 'install tar gcc-c++ redhat-rpm-config redhat-release which xz sed make bzip2 gzip gcc coreutils unzip shadow-utils diffutils cpio bash gawk rpm-build info patch util-linux findutils grep' +config_opts['chroot_setup_cmd'] = 'install tar gcc-c++ redhat-rpm-config redhat-release which xz sed make bzip2 gzip gcc coreutils unzip diffutils cpio bash gawk rpm-build info patch util-linux findutils grep' config_opts['dist'] = 'el8' # only useful for --resultdir variable subst config_opts['extra_chroot_dirs'] = [ '/run/lock', ] config_opts['releasever'] = '8' diff --git a/mock-core-configs/etc/mock/templates/rhel-9.tpl b/mock-core-configs/etc/mock/templates/rhel-9.tpl index 04e391b69..7b833b18e 100644 --- a/mock-core-configs/etc/mock/templates/rhel-9.tpl +++ b/mock-core-configs/etc/mock/templates/rhel-9.tpl @@ -1,4 +1,4 @@ -config_opts['chroot_setup_cmd'] = 'install bash bzip2 coreutils cpio diffutils redhat-release findutils gawk glibc-minimal-langpack grep gzip info patch redhat-rpm-config rpm-build sed shadow-utils tar unzip util-linux which xz' +config_opts['chroot_setup_cmd'] = 'install bash bzip2 coreutils cpio diffutils redhat-release findutils gawk glibc-minimal-langpack grep gzip info patch redhat-rpm-config rpm-build sed tar unzip util-linux which xz' config_opts['releasever'] = '9' config_opts['dist'] = 'el{{ releasever }}' # only useful for --resultdir variable subst config_opts['extra_chroot_dirs'] = [ '/run/lock', ] diff --git a/mock-core-configs/etc/mock/templates/rocky-8.tpl b/mock-core-configs/etc/mock/templates/rocky-8.tpl index bc75f5f05..807928a70 100644 --- a/mock-core-configs/etc/mock/templates/rocky-8.tpl +++ b/mock-core-configs/etc/mock/templates/rocky-8.tpl @@ -1,4 +1,4 @@ -config_opts['chroot_setup_cmd'] = 'install tar gcc-c++ redhat-rpm-config redhat-release which xz sed make bzip2 gzip gcc coreutils unzip shadow-utils diffutils cpio bash gawk rpm-build info patch util-linux findutils grep' +config_opts['chroot_setup_cmd'] = 'install tar gcc-c++ redhat-rpm-config redhat-release which xz sed make bzip2 gzip gcc coreutils unzip diffutils cpio bash gawk rpm-build info patch util-linux findutils grep' config_opts['dist'] = 'el8' # only useful for --resultdir variable subst config_opts['releasever'] = '8' config_opts['package_manager'] = 'dnf' diff --git a/mock-core-configs/etc/mock/templates/rocky-9.tpl b/mock-core-configs/etc/mock/templates/rocky-9.tpl index c3f6735c8..3b07f15d8 100644 --- a/mock-core-configs/etc/mock/templates/rocky-9.tpl +++ b/mock-core-configs/etc/mock/templates/rocky-9.tpl @@ -1,4 +1,4 @@ -config_opts['chroot_setup_cmd'] = 'install bash bzip2 coreutils cpio diffutils redhat-release findutils gawk glibc-minimal-langpack grep gzip info patch redhat-rpm-config rpm-build sed shadow-utils tar unzip util-linux which xz' +config_opts['chroot_setup_cmd'] = 'install bash bzip2 coreutils cpio diffutils redhat-release findutils gawk glibc-minimal-langpack grep gzip info patch redhat-rpm-config rpm-build sed tar unzip util-linux which xz' config_opts['dist'] = 'el9' # only useful for --resultdir variable subst config_opts['releasever'] = '9' config_opts['package_manager'] = 'dnf' diff --git a/mock-core-configs/mock-core-configs.spec b/mock-core-configs/mock-core-configs.spec index 2a211d7e1..19a354da3 100644 --- a/mock-core-configs/mock-core-configs.spec +++ b/mock-core-configs/mock-core-configs.spec @@ -24,7 +24,7 @@ Provides: mock-configs # distribution-gpg-keys contains GPG keys used by mock configs Requires: distribution-gpg-keys >= 1.85 # specify minimal compatible version of mock -Requires: mock >= 4.1.post1 +Requires: mock >= 4.1.post2 Requires: mock-filesystem Requires(post): coreutils diff --git a/mock/docs/site-defaults.cfg b/mock/docs/site-defaults.cfg index a981e1321..22ba5fc10 100644 --- a/mock/docs/site-defaults.cfg +++ b/mock/docs/site-defaults.cfg @@ -423,7 +423,6 @@ # config_opts['chroot_setup_cmd'] = 'install @buildsys-build' # @buildsys-build is comps group defined by Fedora # for chroot_setup_cmd we actually need those packages: -# * shadow-utils - mock needs /usr/sbin/useradd from this package # * rpm-build - mock needs /usr/bin/rpmbuild # * glibc-minimal-langpack - this is optional, but helps to avoid # installation of huge glibc-all-langpacks. @@ -568,8 +567,6 @@ # name of the group inside of chroot # config_opts['chrootgroup'] = 'mock' -# config_opts['useradd'] = '/usr/sbin/useradd -o -m -u {{chrootuid}} -g {{chrootgid}} -d {{chroothome}} -N {{chrootuser}}' -# # Security related # config_opts['no_root_shells'] = False # @@ -626,3 +623,11 @@ # cleanup via the recursive rmtree() calls). Use this config option to # override the default Mock's stack call limit (5000). #config_opts["recursion_limit"] = 5000 + +# List of usernames (strings) that will be pre-created in buildroot. The UID +# and GID in-chroot is going to be the same as on-host. This option is for +# example useful for the 'pesign' use-cases that both (a) bind-mount +# pesign-owned socket-files into the chroot and (b) install the +# 'BuildRequires: pesign' package which would overwrite the ownership of the +# socket file. See https://github.com/rpm-software-management/mock/issues/1091 +#config_opts["copy_host_users"] = [] diff --git a/mock/mock.spec b/mock/mock.spec index 14649836d..871f0966b 100644 --- a/mock/mock.spec +++ b/mock/mock.spec @@ -9,7 +9,7 @@ Summary: Builds packages inside chroots Name: mock -Version: 4.1.post1 +Version: 4.1.post2 Release: 1%{?dist} License: GPL-2.0-or-later # Source is created by @@ -100,6 +100,7 @@ BuildRequires: perl Requires: util-linux Requires: coreutils Requires: procps-ng +Requires: shadow-utils %description diff --git a/mock/py/mockbuild/buildroot.py b/mock/py/mockbuild/buildroot.py index 83047c271..af467ee1d 100644 --- a/mock/py/mockbuild/buildroot.py +++ b/mock/py/mockbuild/buildroot.py @@ -8,7 +8,6 @@ import logging import os import pwd -import shlex import shutil import stat import tempfile @@ -20,10 +19,11 @@ from . import uid from . import util from .exception import (BuildRootLocked, Error, ResultDirNotAccessible, - RootError, BadCmdline) + BadCmdline) from .package_manager import package_manager from .trace_decorator import getLog, traceLog from .podman import Podman +from .shadow_utils import ShadowUtils # pylint: disable=too-many-lines @@ -44,6 +44,7 @@ class Buildroot(object): def __init__(self, config, uid_manager, state, plugins, bootstrap_buildroot=None, is_bootstrap=False): self.config = config self.uid_manager = uid_manager + self.shadow_utils = ShadowUtils(self) self.state = state self.plugins = plugins self.bootstrap_buildroot = bootstrap_buildroot @@ -249,6 +250,7 @@ def _init(self, prebuild): self.pkg_manager.initialize() self._setup_resolver_config() self._setup_katello_ca() + if not self.chroot_was_initialized: self._setup_dbus_uuid() self._init_aux_files() @@ -256,16 +258,11 @@ def _init(self, prebuild): self._setup_timezone() self._init_pkg_management() self._setup_files_postinstall() - self._make_build_user() self._setup_build_dirs() elif prebuild: if 'age_check' in self.config['plugin_conf']['root_cache_opts'] and \ not self.config['plugin_conf']['root_cache_opts']['age_check']: self._init_pkg_management() - # Recreates build user to ensure the uid/gid are up to date with config - # and there's no garbage left by previous build - self._make_build_user() - self._setup_build_dirs() if (self.config['online'] and self.config['update_before_build'] and self.config['clean']): update_state = "{0} update".format(self.pkg_manager.name) @@ -280,13 +277,18 @@ def _init(self, prebuild): new_packages) self.plugins.call_hooks('postupdate') self.state.finish(update_state) - else: - self._fixup_build_user() - # Change owner of homdir tree if the root of it not owned - # by the current user. - home = self.make_chroot_path(self.homedir) - if os.path.exists(home) and os.stat(home).st_uid != self.chrootuid: - self.chown_home_dir() + + # cleanup a potential mess after the previous build + self._cleanup_homedir() + self._setup_build_dirs() + + # (re)create users to ensure the uid/gid are up to date with config + # after doing 'dnf update', 'dnf builddep', etc. + self._make_users() + + # Change owner of homdir tree if the root of it not owned + # by the current user + self.chown_home_dir() # mark the buildroot as initialized file_util.touch(self.make_chroot_path('.initialized')) @@ -458,44 +460,33 @@ def _init_pkg_management(self): self.state.finish(update_state) - @traceLog() @noop_in_bootstrap - def _fixup_build_user(self): - """ensure chrootuser has correct UID""" - self.doChroot(['/usr/sbin/usermod', '-u', str(self.chrootuid), - self.chrootuser], - shell=False, nosync=True) - - @traceLog() - @noop_in_bootstrap - def _make_build_user(self): - if not os.path.exists(self.make_chroot_path('usr/sbin/useradd')): - raise RootError("Could not find useradd in chroot, maybe the install failed?") - + def _cleanup_homedir(self): + # Resolving the 'mockbuilder' user excluded = [self.make_chroot_path(self.homedir, path) for path in self.config['exclude_from_homedir_cleanup']] + \ self.mounts.get_mountpoints() file_util.rmtree(self.make_chroot_path(self.homedir), selinux=self.selinux, exclude=excluded) - # ok for these two to fail - if self.config['clean']: - self.doChroot(['/usr/sbin/userdel', '-r', '-f', self.chrootuser], - shell=False, raiseExc=False, nosync=True) - else: - self.doChroot(['/usr/sbin/userdel', '-f', self.chrootuser], - shell=False, raiseExc=False, nosync=True) - self.doChroot(['/usr/sbin/groupdel', self.chrootgroup], - shell=False, raiseExc=False, nosync=True) - - if self.chrootgid: - self.doChroot(['/usr/sbin/groupadd', '-g', self.chrootgid, self.chrootgroup], - 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)) + @traceLog() + @noop_in_bootstrap + def _make_users(self): + # The mockbuild user + self.shadow_utils.delete_user(self.chrootuser, can_fail=True) + self.shadow_utils.delete_group(self.chrootgroup, can_fail=True) + self.shadow_utils.create_group(self.chrootgroup, gid=self.chrootgid) + self.shadow_utils.create_user( + self.chrootuser, uid=self.chrootuid, gid=self.chrootgid, + home=self.homedir, + ) self._enable_chrootuser_account() + # Other users + for user in self.config.get("copy_host_users", []): + self.shadow_utils.copy_from_host(user) + + @traceLog() def _enable_chrootuser_account(self): passwd = self.make_chroot_path('/etc/passwd') @@ -671,6 +662,7 @@ def _prepare_rpm_macros(self): rpmmacros.write("%s %s\n" % (key, value)) @traceLog() + @noop_in_bootstrap def _setup_build_dirs(self): build_dirs = ['RPMS', 'SPECS', 'SRPMS', 'SOURCES', 'BUILD', 'BUILDROOT', 'originals'] @@ -681,8 +673,6 @@ def _setup_build_dirs(self): path = self.make_chroot_path(self.builddir, item) file_util.mkdirIfAbsent(path) self.uid_manager.changeOwner(path) - if self.config['clean']: - self.chown_home_dir() self._prepare_rpm_macros() @traceLog() diff --git a/mock/py/mockbuild/config.py b/mock/py/mockbuild/config.py index 3fa0db72a..20ff621b8 100644 --- a/mock/py/mockbuild/config.py +++ b/mock/py/mockbuild/config.py @@ -240,8 +240,6 @@ def setup_default_config_opts(): } # dependent on guest OS - config_opts['useradd'] = \ - '/usr/sbin/useradd -o -m -u {{chrootuid}} -g {{chrootgid}} -d {{chroothome}} -N {{chrootuser}}' config_opts['use_host_resolv'] = False config_opts['chroot_setup_cmd'] = ('groupinstall', 'buildsys-build') config_opts['target_arch'] = 'i386' @@ -342,6 +340,8 @@ def setup_default_config_opts(): config_opts["seccomp"] = False + config_opts["copy_host_users"] = [] + # mapping from target_arch (or forcearch) to arch in /usr/bin/qemu-*-static config_opts["qemu_user_static_mapping"] = { 'aarch64': 'aarch64', diff --git a/mock/py/mockbuild/shadow_utils.py b/mock/py/mockbuild/shadow_utils.py new file mode 100644 index 000000000..06cbe200a --- /dev/null +++ b/mock/py/mockbuild/shadow_utils.py @@ -0,0 +1,90 @@ +""" +Create users/groups in chroot. Wrapping the useradd/groupadd utilities. +""" + +import grp +import pwd +from mockbuild.util import do_with_status + + +class ShadowUtils: + """ + Create a group + """ + def __init__(self, root): + self.root = root + + @property + def _chroot_opts(self): + return ["--prefix", self.root.make_chroot_path()] + + def _execute_command(self, command, can_fail=False): + with self.root.uid_manager.elevated_privileges(): + # Execute the command _on host_, not in bootstrap (where we're not + # sure how old shadow-utils are). + do_with_status(command + self._chroot_opts, raiseExc=not can_fail) + + def delete_user(self, username, can_fail=False): + """ + Delete user in self.root (/etc/passwd modified) + """ + command = ["userdel", "-f", username] + self._execute_command(command, can_fail=can_fail) + + def delete_group(self, groupname, can_fail=False): + """ + Delete group in self.root (/etc/group modified) + """ + command = ["groupdel", groupname] + self._execute_command(command, can_fail=can_fail) + + def create_group(self, groupname, gid=None): + """ + Create group in self.root (/etc/group modified) + """ + command = ["groupadd", groupname] + if gid is not None: + command += ["-g", str(gid)] + self._execute_command(command) + + def create_user(self, username, uid=None, gid=None, home=None): + """ + Create user in self.root (/etc/passwd modified) + """ + command = ["useradd", username] + if uid is not None: + command += ["-o", "-u", str(uid)] + if gid is not None: + command += ["-g", str(gid), "-N"] + if home is not None: + command += ["-d", str(home)] + self._execute_command(command) + + def copy_from_host(self, username): + """ + Copy user (with uid/gid/group_name) from Host into the self.root. + """ + try: + info = pwd.getpwnam(username) + uid = info.pw_uid + gid = info.pw_gid + except KeyError as err: + raise RuntimeError( + f"Can not find the requested user {username} " + "on host") from err + + try: + group_name = grp.getgrgid(gid).gr_name + except KeyError as err: + raise RuntimeError( + f"Can not find the requested GID {gid} " + "on host") from err + + self.delete_user(username, can_fail=True) + # This might fail because the group doesn't exist in the chroot (OK to + # ignore), or because there still are other users in the group (a + # serious error case, but OK to ignore because the subsequent + # 'crate_group' attempt will fail anyway). + self.delete_group(group_name, can_fail=True) + self.create_group(group_name, gid=gid) + self.create_user(group_name, uid=uid, gid=gid)