diff --git a/mantle/cmd/kola/options.go b/mantle/cmd/kola/options.go index b200894c12..bb1e7be9dd 100644 --- a/mantle/cmd/kola/options.go +++ b/mantle/cmd/kola/options.go @@ -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") @@ -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 } diff --git a/src/cmd-run b/src/cmd-run index 6f4b261d5d..26ad53866f 100755 --- a/src/cmd-run +++ b/src/cmd-run @@ -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