From fce45f3a727fb9a1e93a5e6cd3774b14f2dfb6e3 Mon Sep 17 00:00:00 2001 From: nazunalika Date: Sun, 26 Jun 2022 22:45:31 -0700 Subject: [PATCH] put in a hack for xorrisofs --- iso/empanadas/empanadas/configs/el9-beta.yaml | 1 - iso/empanadas/empanadas/configs/el9.yaml | 1 - iso/empanadas/empanadas/configs/el9lh.yaml | 1 - .../empanadas/templates/extraisobuild.tmpl.sh | 3 +- iso/empanadas/empanadas/util/iso_utils.py | 28 +++++++++++++++++-- 5 files changed, 27 insertions(+), 7 deletions(-) diff --git a/iso/empanadas/empanadas/configs/el9-beta.yaml b/iso/empanadas/empanadas/configs/el9-beta.yaml index 0ca78a8..6de4bbe 100644 --- a/iso/empanadas/empanadas/configs/el9-beta.yaml +++ b/iso/empanadas/empanadas/configs/el9-beta.yaml @@ -70,7 +70,6 @@ - 'isomd5sum' - 'lorax-templates-rhel' - 'lorax-templates-generic' - - 'xorriso' repoclosure_map: arches: x86_64: '--forcearch=x86_64 --arch=x86_64 --arch=athlon --arch=i686 --arch=i586 --arch=i486 --arch=i386 --arch=noarch' diff --git a/iso/empanadas/empanadas/configs/el9.yaml b/iso/empanadas/empanadas/configs/el9.yaml index 1918b68..b71a1ef 100644 --- a/iso/empanadas/empanadas/configs/el9.yaml +++ b/iso/empanadas/empanadas/configs/el9.yaml @@ -70,7 +70,6 @@ - 'isomd5sum' - 'lorax-templates-rhel' - 'lorax-templates-generic' - - 'xorriso' repoclosure_map: arches: x86_64: '--forcearch=x86_64 --arch=x86_64 --arch=athlon --arch=i686 --arch=i586 --arch=i486 --arch=i386 --arch=noarch' diff --git a/iso/empanadas/empanadas/configs/el9lh.yaml b/iso/empanadas/empanadas/configs/el9lh.yaml index 78de775..621e758 100644 --- a/iso/empanadas/empanadas/configs/el9lh.yaml +++ b/iso/empanadas/empanadas/configs/el9lh.yaml @@ -70,7 +70,6 @@ - 'isomd5sum' - 'lorax-templates-rhel' - 'lorax-templates-generic' - - 'xorriso' repoclosure_map: arches: x86_64: '--forcearch=x86_64 --arch=x86_64 --arch=athlon --arch=i686 --arch=i586 --arch=i486 --arch=i386 --arch=noarch' diff --git a/iso/empanadas/empanadas/templates/extraisobuild.tmpl.sh b/iso/empanadas/empanadas/templates/extraisobuild.tmpl.sh index 15a73e4..4d42901 100644 --- a/iso/empanadas/empanadas/templates/extraisobuild.tmpl.sh +++ b/iso/empanadas/empanadas/templates/extraisobuild.tmpl.sh @@ -40,7 +40,8 @@ mock_ret_val=$? if [ $mock_ret_val -eq 0 ]; then # Copy resulting data to /var/lib/mock/{{ shortname|lower }}-{{ major }}-{{ arch }}/result mkdir -p "${MOCK_RESL}" - cp "${MOCK_CHRO}${BUILDDIR}/${IMAGE_ISO}*" "${MOCK_RESL}" + cp "${MOCK_CHRO}${BUILDDIR}/${IMAGE_ISO}" "${MOCK_RESL}" + cp "${MOCK_CHRO}${BUILDDIR}/${IMAGE_ISO}.manifest" "${MOCK_RESL}" else echo "!! EXTRA ISO RUN FAILED !!" exit 1 diff --git a/iso/empanadas/empanadas/util/iso_utils.py b/iso/empanadas/empanadas/util/iso_utils.py index 656a155..814c0f1 100644 --- a/iso/empanadas/empanadas/util/iso_utils.py +++ b/iso/empanadas/empanadas/util/iso_utils.py @@ -254,12 +254,23 @@ class IsoBuild: if self.release_candidate: rclevel = '-' + self.rclvl + # This is kind of a hack. Installing xorrisofs sets the alternatives to + # it, so backwards compatibility is sort of guaranteed. But we want to + # emulate as close as possible to what pungi does, so unless we + # explicitly ask for xorr (in el8 and 9), we should NOT be using it. + # For RLN and el10, we'll use xorr all the way through. When 8 is no + # longer getting ISO's, we'll remove this section. + required_pkgs = self.required_pkgs.copy() + if self.iso_map['xorrisofs']: + if 'genisoimage' in required_pkgs and 'xorriso' not in required_pkgs: + required_pkgs.append('xorriso') + mock_iso_template_output = mock_iso_template.render( arch=self.current_arch, major=self.major_version, fullname=self.fullname, shortname=self.shortname, - required_pkgs=self.required_pkgs, + required_pkgs=required_pkgs, dist=self.disttag, repos=self.repolist, user_agent='{{ user_agent }}', @@ -954,6 +965,17 @@ class IsoBuild: iso_template_path = '{}/buildExtraImage-{}-{}.sh'.format(entries_dir, arch, image) xorriso_template_path = '{}/xorriso-{}-{}.txt'.format(entries_dir, arch, image) + # This is kind of a hack. Installing xorrisofs sets the alternatives to + # it, so backwards compatibility is sort of guaranteed. But we want to + # emulate as close as possible to what pungi does, so unless we + # explicitly ask for xorr (in el8 and 9), we should NOT be using it. + # For RLN and el10, we'll use xorr all the way through. When 8 is no + # longer getting ISO's, we'll remove this section. + required_pkgs = self.required_pkgs.copy() + if self.iso_map['xorrisofs']: + if 'genisoimage' in required_pkgs and 'xorriso' not in required_pkgs: + required_pkgs.append('xorriso') + rclevel = '' if self.release_candidate: rclevel = '-' + self.rclvl @@ -977,7 +999,7 @@ class IsoBuild: ) lorax_pkg_cmd = '/usr/bin/dnf install {} -y'.format( - ' '.join(self.iso_map['lorax']['required_pkgs']) + ' '.join(required_pkgs) ) mock_iso_template_output = mock_iso_template.render( @@ -985,7 +1007,7 @@ class IsoBuild: major=self.major_version, fullname=self.fullname, shortname=self.shortname, - required_pkgs=self.required_pkgs, + required_pkgs=required_pkgs, dist=self.disttag, repos=self.repolist, user_agent='{{ user_agent }}',