From 5989f4392f042ac573b405dfaf0980d66f0bc6e1 Mon Sep 17 00:00:00 2001 From: Louis Abel Date: Thu, 24 Nov 2022 11:36:57 -0700 Subject: [PATCH] provide a choice on stage or peridot for live --- iso/empanadas/empanadas/scripts/build_iso_live.py | 2 ++ iso/empanadas/empanadas/templates/buildLiveImage.tmpl.sh | 6 +----- iso/empanadas/empanadas/util/iso_utils.py | 6 ++++++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/iso/empanadas/empanadas/scripts/build_iso_live.py b/iso/empanadas/empanadas/scripts/build_iso_live.py index 6b2e5fa..97ecbed 100755 --- a/iso/empanadas/empanadas/scripts/build_iso_live.py +++ b/iso/empanadas/empanadas/scripts/build_iso_live.py @@ -11,6 +11,7 @@ parser = argparse.ArgumentParser(description="Live ISO Compose") parser.add_argument('--release', type=str, help="Major Release Version or major-type (eg 9-beta)", required=True) parser.add_argument('--isolation', type=str, help="Mock Isolation") parser.add_argument('--local-compose', action='store_true', help="Compose Directory is Here") +parser.add_argument('--peridot', action='store_true', help="Use peridot repos") parser.add_argument('--image', type=str, help="Granular choice in which live image is built") parser.add_argument('--logger', type=str) parser.add_argument('--live-iso-mode', type=str, default='local') @@ -29,6 +30,7 @@ a = LiveBuild( live_iso_mode=results.live_iso_mode, image=results.image, compose_dir_is_here=results.local_compose, + peridot=results.peridot, hashed=results.hashed, justcopyit=results.just_copy_it, force_build=results.force_build, diff --git a/iso/empanadas/empanadas/templates/buildLiveImage.tmpl.sh b/iso/empanadas/empanadas/templates/buildLiveImage.tmpl.sh index 95ad384..268ede8 100644 --- a/iso/empanadas/empanadas/templates/buildLiveImage.tmpl.sh +++ b/iso/empanadas/empanadas/templates/buildLiveImage.tmpl.sh @@ -17,11 +17,7 @@ cd /builddir {% endif %} {{ git_clone }} -if [ -d "/builddir/ks/live/{{ major }}/{{ arch }}/peridot" ]; then - pushd /builddir/ks/live/{{ major }}/{{ arch }}/peridot || { echo "Could not change directory"; exit 1; } -else - pushd /builddir/ks/live/{{ major }}/{{ arch }}/stage || { echo "Could not change directory"; exit 1; } -fi +pushd /builddir/ks/live/{{ major }}/{{ arch }}/{{ kloc }} || { echo "Could not change directory"; exit 1; } ksflatten -c {{ ks_file }} -o /builddir/ks.cfg if [ $? -ne 0 ]; then echo "Error flattening kickstart" diff --git a/iso/empanadas/empanadas/util/iso_utils.py b/iso/empanadas/empanadas/util/iso_utils.py index b22a323..6773a4a 100644 --- a/iso/empanadas/empanadas/util/iso_utils.py +++ b/iso/empanadas/empanadas/util/iso_utils.py @@ -1583,6 +1583,7 @@ class LiveBuild: force_build: bool = False, updated_image: bool = False, image_increment: str = '0', + peridot: bool = False, logger=None ): @@ -1610,6 +1611,7 @@ class LiveBuild: self.checksum = rlvars['checksum'] self.profile = rlvars['profile'] self.hashed = hashed + self.peridot = peridot # Relevant major version items self.arch = config['arch'] @@ -1763,6 +1765,9 @@ class LiveBuild: mock_iso_template = self.tmplenv.get_template('isomock.tmpl.cfg') mock_sh_template = self.tmplenv.get_template('liveisobuild.tmpl.sh') iso_template = self.tmplenv.get_template('buildLiveImage.tmpl.sh') + kloc = 'stage' + if self.peridot: + kloc = 'peridot' mock_iso_path = '/var/tmp/live-{}.cfg'.format(self.major_version) mock_sh_path = '{}/liveisobuild-{}-{}.sh'.format( @@ -1866,6 +1871,7 @@ class LiveBuild: major=self.major_version, git_clone=git_clone_cmd, ks_file=ks_start, + kloc=kloc, ) with open(mock_iso_path, "w+") as mip: