Support for rpm wrapped live images.
This commit is contained in:
parent
ea751bb119
commit
ba39435bf6
@ -88,11 +88,15 @@ class LiveImagesPhase(PhaseBase):
|
|||||||
iso_name = os.path.basename(iso_path)
|
iso_name = os.path.basename(iso_path)
|
||||||
|
|
||||||
cmd = {
|
cmd = {
|
||||||
|
"name": None,
|
||||||
|
"version": None,
|
||||||
"arch": arch,
|
"arch": arch,
|
||||||
"variant": variant,
|
"variant": variant,
|
||||||
"iso_path": iso_path,
|
"iso_path": iso_path,
|
||||||
"build_arch": arch,
|
"build_arch": arch,
|
||||||
"ks_file": ks_file,
|
"ks_file": ks_file,
|
||||||
|
"specfile": None,
|
||||||
|
"scratch": False,
|
||||||
"cmd": [],
|
"cmd": [],
|
||||||
"label": "", # currently not used
|
"label": "", # currently not used
|
||||||
}
|
}
|
||||||
@ -105,6 +109,18 @@ class LiveImagesPhase(PhaseBase):
|
|||||||
data = get_arch_variant_data(self.compose.conf, "live_images", arch, variant)
|
data = get_arch_variant_data(self.compose.conf, "live_images", arch, variant)
|
||||||
cmd["repos"].extend(data[0].get("additional_repos", []))
|
cmd["repos"].extend(data[0].get("additional_repos", []))
|
||||||
|
|
||||||
|
# Explicit name and version
|
||||||
|
cmd["name"] = data[0].get("name", None)
|
||||||
|
cmd["version"] = data[0].get("version", None)
|
||||||
|
|
||||||
|
# Specfile (for images wrapped in rpm)
|
||||||
|
cmd["specfile"] = data[0].get("specfile", None)
|
||||||
|
|
||||||
|
# Scratch (only taken in consideration if specfile specified)
|
||||||
|
# For images wrapped in rpm is scratch disabled by default
|
||||||
|
# For other images is scratch always on
|
||||||
|
cmd["scratch"] = data[0].get("scratch", False)
|
||||||
|
|
||||||
chdir_cmd = "cd %s" % pipes.quote(iso_dir)
|
chdir_cmd = "cd %s" % pipes.quote(iso_dir)
|
||||||
cmd["cmd"].append(chdir_cmd)
|
cmd["cmd"].append(chdir_cmd)
|
||||||
|
|
||||||
@ -153,8 +169,14 @@ class CreateLiveImageThread(WorkerThread):
|
|||||||
|
|
||||||
koji_wrapper = KojiWrapper(compose.conf["koji_profile"])
|
koji_wrapper = KojiWrapper(compose.conf["koji_profile"])
|
||||||
name, version = compose.compose_id.rsplit("-", 1)
|
name, version = compose.compose_id.rsplit("-", 1)
|
||||||
|
name = cmd["name"] or name
|
||||||
|
version = cmd["version"] or version
|
||||||
|
archive = False
|
||||||
|
if cmd["specfile"] and not cmd["scratch"]:
|
||||||
|
# Non scratch build are allowed only for rpm wrapped images
|
||||||
|
archive = True
|
||||||
target = compose.conf["live_target"]
|
target = compose.conf["live_target"]
|
||||||
koji_cmd = koji_wrapper.get_create_image_cmd(name, version, target, cmd["build_arch"], cmd["ks_file"], cmd["repos"], image_type="live", wait=True, archive=False)
|
koji_cmd = koji_wrapper.get_create_image_cmd(name, version, target, cmd["build_arch"], cmd["ks_file"], cmd["repos"], image_type="live", wait=True, archive=archive, specfile=cmd["specfile"])
|
||||||
|
|
||||||
# avoid race conditions?
|
# avoid race conditions?
|
||||||
# Kerberos authentication failed: Permission denied in replay cache code (-1765328215)
|
# Kerberos authentication failed: Permission denied in replay cache code (-1765328215)
|
||||||
@ -187,8 +209,8 @@ def get_ks_in(compose, arch, variant):
|
|||||||
scm_dict = data[0]["kickstart"]
|
scm_dict = data[0]["kickstart"]
|
||||||
|
|
||||||
if isinstance(scm_dict, dict):
|
if isinstance(scm_dict, dict):
|
||||||
if scm_dict["scm"] == "file":
|
|
||||||
file_name = os.path.basename(os.path.basename(scm_dict["file"]))
|
file_name = os.path.basename(os.path.basename(scm_dict["file"]))
|
||||||
|
if scm_dict["scm"] == "file":
|
||||||
scm_dict["file"] = os.path.join(compose.config_dir, os.path.basename(scm_dict["file"]))
|
scm_dict["file"] = os.path.join(compose.config_dir, os.path.basename(scm_dict["file"]))
|
||||||
else:
|
else:
|
||||||
file_name = os.path.basename(os.path.basename(scm_dict))
|
file_name = os.path.basename(os.path.basename(scm_dict))
|
||||||
|
@ -97,7 +97,7 @@ class KojiWrapper(object):
|
|||||||
}
|
}
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def get_create_image_cmd(self, name, version, target, arch, ks_file, repos, image_type="live", image_format=None, release=None, wait=True, archive=False):
|
def get_create_image_cmd(self, name, version, target, arch, ks_file, repos, image_type="live", image_format=None, release=None, wait=True, archive=False, specfile=None):
|
||||||
# Usage: koji spin-livecd [options] <name> <version> <target> <arch> <kickstart-file>
|
# Usage: koji spin-livecd [options] <name> <version> <target> <arch> <kickstart-file>
|
||||||
# Usage: koji spin-appliance [options] <name> <version> <target> <arch> <kickstart-file>
|
# Usage: koji spin-appliance [options] <name> <version> <target> <arch> <kickstart-file>
|
||||||
# Examples:
|
# Examples:
|
||||||
@ -126,6 +126,9 @@ class KojiWrapper(object):
|
|||||||
else:
|
else:
|
||||||
cmd.append("--nowait")
|
cmd.append("--nowait")
|
||||||
|
|
||||||
|
if specfile:
|
||||||
|
cmd.append("--specfile=%s" % specfile)
|
||||||
|
|
||||||
if isinstance(repos, list):
|
if isinstance(repos, list):
|
||||||
for repo in repos:
|
for repo in repos:
|
||||||
cmd.append("--repo=%s" % repo)
|
cmd.append("--repo=%s" % repo)
|
||||||
|
Loading…
Reference in New Issue
Block a user