Skip to content

Commit 0b5df45

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 81ca115 commit 0b5df45

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
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 = "v2.0"
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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def aws_run_ore(build, args):
119119
)
120120
os.environ["MANTLE_AWS_IMDS_SUPPORT"] = image_yaml['aws-imds-support']
121121
os.environ["MANTLE_AWS_VOLUME_TYPE"] = image_yaml['aws-volume-type']
122-
os.environ["aws_boot_mode"] = image_yaml['aws-boot-mode']
122+
os.environ["MANTLE_AWS_BOOT_MODE_x86_64"] = image_yaml['aws-boot-mode-x86-64']
123123

124124
# First add the ore command to run before any options
125125
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-x86-64: "uefi-preferred"

0 commit comments

Comments
 (0)