#8 Enable booting the VM as UEFI and provide record for a UEFI machine.
Merged 4 years ago by adamwill. Opened 4 years ago by lruzicka.

file modified
+10 -5
@@ -198,9 +198,10 @@ 

      included in the image file name if specified. 'maxage' is the

      maximum age of the image file (in days) - if the image is older

      than this, 'check' will report it as 'outdated' and 'all' will

-     rebuild it.

+     rebuild it. 'bootopts' are used to pass boot options to the

+     virtual image to provide better control of the VM.

      """

-     def __init__(self, name, release, arch, size, variant=None, imgver='', maxage=14):

+     def __init__(self, name, release, arch, size, variant=None, imgver='', maxage=14, bootopts=None):

          self.name = name

          self.size = size

          self.filename = "disk_f{0}_{1}".format(str(release), name)
@@ -218,6 +219,7 @@ 

                  self.variant = "Server"

              else:

                  self.variant = "Everything"

+         self.bootopts = bootopts

  

      def create(self, textinst, retries=3):

          """Create the image."""
@@ -272,7 +274,7 @@ 

          # build Workstation images out of Everything

          if variant == 'Workstation' and str(self.release).isdigit() and int(self.release) > 30:

              variant = 'Everything'

- 

+         

          try:

              # this is almost complex enough to need fedfind but not

              # quite, I think. also fedfind can't find the 'transient'
@@ -289,7 +291,9 @@ 

                      "--os-variant", shortid, "-x", xargs, "--initrd-inject",

                      "{0}/{1}.ks".format(SCRIPTDIR, self.name), "--location",

                      loctmp.format(fedoradir, str(self.release), variant, arch), "--name", "createhdds",

-                     "--memory", memsize , "--noreboot", "--wait", "-1"]

+                     "--memory", memsize, "--noreboot", "--wait", "-1"]

+             if self.bootopts:

+                 args.extend(("--boot", self.bootopts))

              if textinst:

                  args.extend(("--graphics", "none", "--extra-args", "console=ttyS0"))

              else:
@@ -459,6 +463,7 @@ 

          releases = imggrp['releases']

      size = imggrp.get('size', 0)

      imgver = imggrp.get('imgver')

+     bootopts = imggrp.get('bootopts')

      # add an image for each release/arch combination

      for (release, arches) in releases.items():

          if release.lower() == 'branched':
@@ -493,7 +498,7 @@ 

                      continue

                  imgs.append(

                      VirtInstallImage(name, rel, arch, variant=variant, size=size, imgver=imgver,

-                                      maxage=maxage))

+                                      maxage=maxage, bootopts=bootopts))

      return imgs

  

  def get_all_images(hdds, nextrel=None):

file modified
+12
@@ -136,6 +136,18 @@ 

              "imgver": "3"

          },

          {

+             "name" : "minimal-uefi",

+             "releases" : {

+                 "-1" : ["x86_64"],

+                 "-2" : ["x86_64"],

+                 "stable": ["x86_64"],

+                 "branched": ["x86_64"]

+             },

+             "size" : "20",

+             "imgver": "3",

+             "bootopts": "uefi"

+         },

+         {

              "name" : "desktop",

              "releases" : {

                  "stable" : ["x86_64", "i686"],

file added
+19
@@ -0,0 +1,19 @@ 

+ install

+ bootloader --location=mbr

+ 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

+ part /boot/efi --fstype=efi --grow --maxsize=200 --size=20

+ part /boot --fstype=ext4 --size=1024

+ part / --fstype=ext4 --size=17000

+ part swap --size=2000

+ rootpw weakpassword

+ poweroff

+ 

+ %packages

+ @core

+ %end

This commit adds support for boot options, that can be passed
from hdds.json to control the creation of the virtual
machines, such as enabling of EFI based machines, boot order
control, etc. It also adds an EFI based machine to hdds.json
and adds a kickstart file for such machine.

Metadata Update from @lruzicka:
- Request assigned

4 years ago

Urrrmrmmm. I'm a bit torn here. In a way I'd like to do this more 'programatically', like we do for imgver and arch, but having poked at it a little I can't really find a nice way to do that. So...maybe let's go with this for now as it's simple, and we can re-architect it later if it turns out to be icky.

I don't think we need this for ppc64le and aarch64. aarch64 is always UEFI, and ppc64le is never UEFI. we do not need variants of the upgrade test for either of those arches, which is what this image is meant for, right?

rebased onto a01d22f

4 years ago

I deleted those other options from the json file. We only want to do upgrade testing for x86_64 anyway, you are right.

we do test upgrades on those arches, but we don't need a 'uefi variant' disk image for either case. this looks fine, now, so I'll merge it.

Pull-Request has been merged by adamwill

4 years ago