From dc500293d1bf58c573bcfd9b2aa3a22d34516b2f Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Fri, 18 Jun 2021 14:52:14 -0700 Subject: [PATCH] Build desktop images for aarch64 upgrade tests We want to run the desktop upgrade tests on aarch64; to do that, we need the required base images to be built. We also need to do the `console=tty0 quiet` boot args for the desktopencrypt image so the decrypt prompt is visible on boot; to handle this, we extend the existing hack for using a release-specific ks to be more generic and allow for a more specific kickstart by arch, release or both. Signed-off-by: Adam Williamson --- createhdds.py | 29 ++++++++++++++++++++++------- desktopencrypt-aarch64.ks | 18 ++++++++++++++++++ hdds.json | 10 +++++----- 3 files changed, 45 insertions(+), 12 deletions(-) create mode 100644 desktopencrypt-aarch64.ks diff --git a/createhdds.py b/createhdds.py index 199a996..42713e3 100755 --- a/createhdds.py +++ b/createhdds.py @@ -23,6 +23,7 @@ import argparse import logging import json import os +import os.path import subprocess import sys import tempfile @@ -227,6 +228,26 @@ class VirtInstallImage(object): self.variant = "Everything" self.bootopts = bootopts + @property + def kickstart_file(self): + """Find the most specific kickstart file to use for a given + name, release and arch. Order of preference: + * name-release-arch.ks + * name-release.ks + * name-arch.ks + * name.ks + """ + cands = [ + f"{self.name}-{self.release}-{self.arch}.ks", + f"{self.name}-{self.release}.ks", + f"{self.name}-{self.arch}.ks", + f"{self.name}.ks" + ] + for cand in cands: + if os.path.isfile("/".join((SCRIPTDIR, cand))): + logger.debug("Using kickstart %s", cand) + return cand + def create(self, textinst, retries=3): """Create the image.""" if self.arch not in supported_arches(): @@ -292,14 +313,8 @@ class VirtInstallImage(object): loctmp = "https://dl.fedoraproject.org/pub/{0}/development/{1}/{2}/{3}/os/" else: loctmp = "https://download.fedoraproject.org/pub/{0}/releases/{1}/{2}/{3}/os/" - ksfile = "{0}.ks".format(self.name) - if str(self.release) == "33" and self.name == "kde": - # FIXME: icky hack for https://bugzilla.redhat.com/show_bug.cgi?id=1960458 - # would be good to improve this, otherwise drop it when F33 is EOL - ksfile = "{0}-{1}.ks".format(self.name, str(self.release)) + ksfile = self.kickstart_file xargs = "inst.ks=file:/{0}".format(ksfile) - if str(self.release) == "33" and self.name == "kde": - xargs = "inst.ks=file:/{0}-{1}.ks".format(self.name, str(self.release)) args = ["virt-install", "--disk", "size={0},path={1}".format(self.size, tmpfile), "--os-variant", shortid, "-x", xargs, "--initrd-inject", "{0}/{1}".format(SCRIPTDIR, ksfile), "--location", diff --git a/desktopencrypt-aarch64.ks b/desktopencrypt-aarch64.ks new file mode 100644 index 0000000..c08c20b --- /dev/null +++ b/desktopencrypt-aarch64.ks @@ -0,0 +1,18 @@ +bootloader --location=mbr --append="console=tty0 quiet" +network --bootproto=dhcp +url --mirrorlist=https://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$releasever&arch=$basearch +repo --name=updates --mirrorlist=https://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f$releasever&arch=$basearch +lang en_US.UTF-8 +keyboard us +timezone --utc America/New_York +clearpart --all +autopart --encrypted --passphrase=weakpassword +rootpw --plaintext weakpassword +user --name=test --password=weakpassword --plaintext +firstboot --enable +poweroff + +%packages +@^workstation-product-environment +-selinux-policy-minimum +%end diff --git a/hdds.json b/hdds.json index a3ddd4c..04ac98f 100644 --- a/hdds.json +++ b/hdds.json @@ -149,9 +149,9 @@ { "name" : "desktop", "releases" : { - "-1" : ["aarch64", "ppc64le"], - "stable" : ["x86_64"], - "branched": ["x86_64"] + "-1" : ["ppc64le"], + "stable" : ["x86_64", "aarch64"], + "branched": ["x86_64", "aarch64"] }, "size" : "20", "imgver": "4", @@ -160,8 +160,8 @@ { "name" : "desktopencrypt", "releases" : { - "stable" : ["x86_64"], - "branched" : ["x86_64"] + "stable" : ["x86_64", "aarch64"], + "branched" : ["x86_64", "aarch64"] }, "size" : "20", "variant": "Workstation"