Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add EFI support #18

Merged
merged 9 commits into from
Dec 1, 2022
Merged

Add EFI support #18

merged 9 commits into from
Dec 1, 2022

Conversation

cfergeau
Copy link
Collaborator

@cfergeau cfergeau commented Nov 21, 2022

This PR adds support for EFI for linux virtual machines
https://developer.apple.com/documentation/virtualization/vzefibootloader?language=objc

This allows to boot directly from a disk image without the need for an external kernel/initrd.
This requires macOS 13.

This is done with a new --bootloader option which replaces the (now legacy)
--kernel/--initrd/--kernel-cmdline parameters.

The most notable change is that it now exposes types implementing
net.Conn/net.Listener instead of having to use ConnectForPort() and
SetListenerFor() and then wrap these into net.Conn/net.Listener
implementations.
The next commits will add EFI support which will be a different
implementation of this new Bootloader interface.
This will remove the need for providing a kernel/initrd/kernel
parameters when booting a linux VM.
The command line args were registered in cmd/vfkit/. Now that we have a
cmdline package, we can move this definition there.
pflag parses string slices uses encoding/csv. This has one annoying
limitation, it does not handle '--arg foo="a,b"', it returns an error
about quote issues.
Since I'd like to use a syntax like:
--bootloader linux,cmdline="quiet console=ttyS0,115200"
in vfkit, this commit is adding a string slice implementation which does
not have this limitation when parsing.
One thing which is not handled is \" to have quotes inside quotes.
This supersedes --kernel, --initrd, --kernel-cmdline as --bootloader
will allow to use either a linux bootloader (with separate kernel,
initrd and kernel command line) or an EFI bootloader.

The legacy parameters are still available for now.
pkg/client/cmdline.go Outdated Show resolved Hide resolved
This allows applications using vfkit go bindings to start a VM using
EFI.
@praveenkumar
Copy link
Member

/lgtm
/approve

@praveenkumar praveenkumar merged commit c097bca into crc-org:main Dec 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants