mantle/platform/qemu: always copy the ISO image
In most cases now, coreos-installer iso kargs will be supported.  Assume
we'll always need to copy the ISO image for modification, and be willing
to perform karg modification even if no Ignition config was specified.
@@ -1167,10 +1167,6 @@ func coreosInstallerSupportsISOKargs() (bool, error) {
}
func (builder *QemuBuilder) setupIso() error {
- if builder.ConfigFile != "" {
- if builder.configInjected {
- panic("config already injected?")
- }
if err := builder.ensureTempdir(); err != nil {
return err
}
@@ -1183,6 +1179,10 @@ func (builder *QemuBuilder) setupIso() error {
if err := cpcmd.Run(); err != nil {
return errors.Wrapf(err, "copying iso")
}
+ if builder.ConfigFile != "" {
+ if builder.configInjected {
+ panic("config already injected?")
+ }
configf, err := os.Open(builder.ConfigFile)
if err != nil {
return err
@@ -1194,6 +1194,7 @@ func (builder *QemuBuilder) setupIso() error {
return errors.Wrapf(err, "running coreos-installer iso embed")
}
builder.configInjected = true
+ }
if kargsSupported, err := coreosInstallerSupportsISOKargs(); err != nil {
return err
@@ -1216,7 +1217,6 @@ func (builder *QemuBuilder) setupIso() error {
return fmt.Errorf("coreos-installer does not support appending kernel args")
}
builder.iso.path = isoEmbeddedPath
- }
// Arches s390x and ppc64le don't support UEFI and use the cdrom option to boot the ISO.
// For all other arches we use ide-cd device with bootindex=2 here: the idea is
