Skip to content

Commit 568cc93

Browse files
committed
mantle/aws: add configuration support for boot mode
Add configuration for boot mode when used with a supported architecture i.e. 'amd64/x86_64'. With a default of 'uefi-preferred'.
1 parent 535e0b9 commit 568cc93

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

mantle/platform/api/aws/images.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,11 +344,14 @@ func (a *API) CreateHVMImage(snapshotID string, diskSizeGiB uint, name string, d
344344
if !set {
345345
imdsSupport = ""
346346
}
347+
bootmode, set = os.LookupEnv("aws_boot_mode")
347348

348349
switch architecture {
349350
case "amd64", "x86_64":
350351
awsArch = ec2.ArchitectureTypeX8664
351-
bootmode = "uefi-preferred"
352+
if !set {
353+
bootmode = "uefi-preferred"
354+
}
352355
case "arm64", "aarch64":
353356
awsArch = ec2.ArchitectureTypeArm64
354357
bootmode = "uefi"

src/cosalib/aws.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ def aws_run_ore(build, args):
119119
)
120120
os.environ["aws_imds_support"] = image_yaml['aws-imds-support']
121121
os.environ["aws_volume_type"]= image_yaml['aws-volume-type']
122+
os.environ["aws_boot_mode"]= image_yaml['aws-boot-mode']
122123

123124
# First add the ore command to run before any options
124125
ore_args = ['ore', 'aws', 'upload']

src/image-default.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,4 @@ vmware-secure-boot: true
3131
# Defaults for AWS
3232
aws-imds-support: "v2.0"
3333
aws-volume-type: "gp3"
34+
aws-boot-mode: "uefi-preferred"

0 commit comments

Comments
 (0)