Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions mantle/platform/qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ func (builder *QemuBuilder) addDiskImpl(disk *Disk, primary bool) error {
if err := builder.renderIgnition(); err != nil {
return errors.Wrapf(err, "rendering ignition")
}
requiresInjection := builder.ConfigFile != "" && (builder.ForceConfigInjection || !builder.supportsFwCfg())
requiresInjection := builder.ConfigFile != "" && builder.ForceConfigInjection
if requiresInjection || builder.IgnitionNetworkKargs != "" || builder.AppendKernelArguments != "" {
if err := setupPreboot(builder.ConfigFile, builder.IgnitionNetworkKargs, builder.AppendKernelArguments,
disk.dstFileName, disk.SectorSize); err != nil {
Expand Down Expand Up @@ -1028,9 +1028,11 @@ func (builder *QemuBuilder) Exec() (*QemuInstance, error) {
if builder.ConfigFile != "" && !builder.configInjected {
if builder.supportsFwCfg() {
builder.Append("-fw_cfg", "name=opt/com.coreos/config,file="+builder.ConfigFile)
} else if builder.primaryDisk == nil {
// Otherwise, we should have handled it in builder.AddPrimaryDisk
panic("Ignition specified but no primary disk")
} else {
// Alternative to fw_cfg, should be generally usable on all arches,
// especially those without fw_cfg support.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note it's technically not usable yet on arches that do support fw_cfg (see coreos/ignition#928 (comment)). But meh... not worth a respin.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh... sorry bad wording on my side, should have been possibly...., will keep it on back of my mind and will fix it in some future PR.

// See https://github.com/coreos/ignition/pull/905
builder.Append("-drive", fmt.Sprintf("if=none,id=ignition,format=raw,file=%s,readonly=on", builder.ConfigFile), "-device", "virtio-blk,serial=ignition,drive=ignition")
}
}

Expand Down