mirror of
https://pagure.io/fedora-qa/createhdds.git
synced 2024-11-22 07:13:09 +00:00
Enable booting the VM as UEFI and provide record for a UEFI machine.
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 EFI based machine to `hdds.json` and adds a kickstart file for such machine.
This commit is contained in:
parent
8f53b9f5f8
commit
a01d22f6ef
@ -198,9 +198,10 @@ class VirtInstallImage(object):
|
|||||||
included in the image file name if specified. 'maxage' is the
|
included in the image file name if specified. 'maxage' is the
|
||||||
maximum age of the image file (in days) - if the image is older
|
maximum age of the image file (in days) - if the image is older
|
||||||
than this, 'check' will report it as 'outdated' and 'all' will
|
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.name = name
|
||||||
self.size = size
|
self.size = size
|
||||||
self.filename = "disk_f{0}_{1}".format(str(release), name)
|
self.filename = "disk_f{0}_{1}".format(str(release), name)
|
||||||
@ -218,6 +219,7 @@ class VirtInstallImage(object):
|
|||||||
self.variant = "Server"
|
self.variant = "Server"
|
||||||
else:
|
else:
|
||||||
self.variant = "Everything"
|
self.variant = "Everything"
|
||||||
|
self.bootopts = bootopts
|
||||||
|
|
||||||
def create(self, textinst, retries=3):
|
def create(self, textinst, retries=3):
|
||||||
"""Create the image."""
|
"""Create the image."""
|
||||||
@ -272,7 +274,7 @@ class VirtInstallImage(object):
|
|||||||
# build Workstation images out of Everything
|
# build Workstation images out of Everything
|
||||||
if variant == 'Workstation' and str(self.release).isdigit() and int(self.release) > 30:
|
if variant == 'Workstation' and str(self.release).isdigit() and int(self.release) > 30:
|
||||||
variant = 'Everything'
|
variant = 'Everything'
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# this is almost complex enough to need fedfind but not
|
# this is almost complex enough to need fedfind but not
|
||||||
# quite, I think. also fedfind can't find the 'transient'
|
# quite, I think. also fedfind can't find the 'transient'
|
||||||
@ -289,7 +291,9 @@ class VirtInstallImage(object):
|
|||||||
"--os-variant", shortid, "-x", xargs, "--initrd-inject",
|
"--os-variant", shortid, "-x", xargs, "--initrd-inject",
|
||||||
"{0}/{1}.ks".format(SCRIPTDIR, self.name), "--location",
|
"{0}/{1}.ks".format(SCRIPTDIR, self.name), "--location",
|
||||||
loctmp.format(fedoradir, str(self.release), variant, arch), "--name", "createhdds",
|
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:
|
if textinst:
|
||||||
args.extend(("--graphics", "none", "--extra-args", "console=ttyS0"))
|
args.extend(("--graphics", "none", "--extra-args", "console=ttyS0"))
|
||||||
else:
|
else:
|
||||||
@ -459,6 +463,7 @@ def get_virtinstall_images(imggrp, nextrel=None, releases=None):
|
|||||||
releases = imggrp['releases']
|
releases = imggrp['releases']
|
||||||
size = imggrp.get('size', 0)
|
size = imggrp.get('size', 0)
|
||||||
imgver = imggrp.get('imgver')
|
imgver = imggrp.get('imgver')
|
||||||
|
bootopts = imggrp.get('bootopts')
|
||||||
# add an image for each release/arch combination
|
# add an image for each release/arch combination
|
||||||
for (release, arches) in releases.items():
|
for (release, arches) in releases.items():
|
||||||
if release.lower() == 'branched':
|
if release.lower() == 'branched':
|
||||||
@ -493,7 +498,7 @@ def get_virtinstall_images(imggrp, nextrel=None, releases=None):
|
|||||||
continue
|
continue
|
||||||
imgs.append(
|
imgs.append(
|
||||||
VirtInstallImage(name, rel, arch, variant=variant, size=size, imgver=imgver,
|
VirtInstallImage(name, rel, arch, variant=variant, size=size, imgver=imgver,
|
||||||
maxage=maxage))
|
maxage=maxage, bootopts=bootopts))
|
||||||
return imgs
|
return imgs
|
||||||
|
|
||||||
def get_all_images(hdds, nextrel=None):
|
def get_all_images(hdds, nextrel=None):
|
||||||
|
12
hdds.json
12
hdds.json
@ -135,6 +135,18 @@
|
|||||||
"size" : "20",
|
"size" : "20",
|
||||||
"imgver": "3"
|
"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",
|
"name" : "desktop",
|
||||||
"releases" : {
|
"releases" : {
|
||||||
|
19
minimal-uefi.ks
Normal file
19
minimal-uefi.ks
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user