Skip to content

Commit

Permalink
mantle/aws: add configuration support for boot mode
Browse files Browse the repository at this point in the history
Add configuration for boot mode when used with a supported architecture
i.e. 'amd64/x86_64'. With a default of 'uefi-preferred'.
  • Loading branch information
prestist committed Sep 13, 2023
1 parent 69d9c3e commit ebc5105
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion mantle/platform/api/aws/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,11 +344,14 @@ func (a *API) CreateHVMImage(snapshotID string, diskSizeGiB uint, name string, d
if !set {
imdsSupport = "v2.0"
}
bootmode, set = os.LookupEnv("MANTLE_AWS_BOOT_MODE_x86_64")

switch architecture {
case "amd64", "x86_64":
awsArch = ec2.ArchitectureTypeX8664
bootmode = "uefi-preferred"
if !set {
bootmode = "uefi-preferred"
}
case "arm64", "aarch64":
awsArch = ec2.ArchitectureTypeArm64
bootmode = "uefi"
Expand Down
2 changes: 1 addition & 1 deletion src/cosalib/aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def aws_run_ore(build, args):
)
os.environ["MANTLE_AWS_IMDS_SUPPORT"] = image_yaml['aws-imds-support']
os.environ["MANTLE_AWS_VOLUME_TYPE"] = image_yaml['aws-volume-type']
os.environ["aws_boot_mode"] = image_yaml['aws-boot-mode']
os.environ["MANTLE_AWS_BOOT_MODE_x86_64"] = image_yaml['aws-boot-mode-x86-64']

# First add the ore command to run before any options
ore_args = ['ore', 'aws', 'upload']
Expand Down
1 change: 1 addition & 0 deletions src/image-default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ vmware-secure-boot: true
# Defaults for AWS
aws-imds-support: "v2.0"
aws-volume-type: "gp3"
aws-boot-mode-x86-64: "uefi-preferred"

0 comments on commit ebc5105

Please sign in to comment.