Skip to content

Commit

Permalink
fixup! Fix #73: OpenBSD VM fails during "Initializing VM" with QEMU o…
Browse files Browse the repository at this point in the history
…n macOS
  • Loading branch information
jacob-carlborg committed Jan 10, 2024
1 parent 6c96e98 commit 76f4def
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 5 deletions.
12 changes: 10 additions & 2 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions src/operating_systems/openbsd/qemu_vm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,11 @@ export class QemuVmX86_64 extends QemuVm {
// disable huge pages, otherwise OpenBSD will not boot: https://gitlab.com/qemu-project/qemu/-/issues/1091
return ['-pdpe1gb']
}

protected override get firmwareFlags(): string[] {
return [
'-drive',
`if=pflash,format=raw,unit=0,file=${this.configuration.firmware},readonly=on`
]
}
}
7 changes: 5 additions & 2 deletions src/qemu_vm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ export abstract class Vm extends vm.Vm {
// '-nographic',

'-boot', 'strict=off',
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
'-bios', this.configuration.firmware!.toString(),
...this.firmwareFlags,
...this.hardDriverFlags
]
}
Expand Down Expand Up @@ -81,6 +80,10 @@ export abstract class Vm extends vm.Vm {
return []
}

protected get firmwareFlags(): string[] {
return ['-bios', this.configuration.firmware!.toString()]
}

private get netdev(): string {
return [
'user',
Expand Down

0 comments on commit 76f4def

Please sign in to comment.