Skip to content

Commit

Permalink
Move the "4k implies uefi" logic into kola
Browse files Browse the repository at this point in the history
As part of eventually making `cmd-run` go away, and also
aiding using `kola run` against 4k drives etc.
  • Loading branch information
cgwalters authored and openshift-merge-robot committed Mar 20, 2020
1 parent 2c6efb2 commit 752546f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 9 additions & 1 deletion mantle/cmd/kola/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func init() {
sv(&kola.PacketOptions.StorageURL, "packet-storage-url", "gs://users.developer.core-os.net/"+os.Getenv("USER")+"/mantle", "Google Storage base URL for temporary uploads")

// QEMU-specific options
sv(&kola.QEMUOptions.Firmware, "qemu-firmware", "bios", "Boot firmware: bios,uefi,uefi-secure")
sv(&kola.QEMUOptions.Firmware, "qemu-firmware", "", "Boot firmware: bios,uefi,uefi-secure (default bios)")
sv(&kola.QEMUOptions.DiskImage, "qemu-image", "", "path to CoreOS disk image")
sv(&kola.QEMUOptions.DiskSize, "qemu-size", "", "Resize target disk via qemu-img resize [+]SIZE")
bv(&kola.QEMUOptions.Native4k, "qemu-native-4k", false, "Force 4k sectors for main disk")
Expand Down Expand Up @@ -162,6 +162,14 @@ func syncOptionsImpl(useCosa bool) error {
kolaPlatform = "qemu-unpriv"
}

// native 4k requires a UEFI bootloader
if kola.QEMUOptions.Native4k && kola.QEMUOptions.Firmware == "bios" {
return fmt.Errorf("native 4k requires uefi firmware")
}
if kola.QEMUOptions.Firmware == "" {
kola.QEMUOptions.Firmware = "bios"
}

if err := validateOption("platform", kolaPlatform, kolaPlatforms); err != nil {
return err
}
Expand Down
4 changes: 0 additions & 4 deletions src/cmd-run
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,6 @@ esac

if [ "${IMAGE_TYPE}" == metal4k ]; then
kola_args+=("--qemu-native-4k")
# native 4k requires a UEFI bootloader
if [ "${FIRMWARE}" == bios ]; then
FIRMWARE=uefi
fi
fi

case "${FIRMWARE}" in
Expand Down

0 comments on commit 752546f

Please sign in to comment.