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

Extract kernel and cmdline from guest disk #47

Open
qsuscs opened this issue Nov 5, 2019 · 1 comment
Open

Extract kernel and cmdline from guest disk #47

qsuscs opened this issue Nov 5, 2019 · 1 comment
Labels
enhancement New feature or request

Comments

@qsuscs
Copy link

qsuscs commented Nov 5, 2019

As firecracker itself requires the kernel to be provided from the host, firectl relays this requirement. This is okay for environments where either one controls both the hypervisor and the guest, or where it is not desired that the VM itself may provide a kernel[1].

I would however like to be able to pass only a root drive to firectl and have it extract the kernel and/or cmdline from a well-defined path (e. g. /boot/vmlinux and /boot/cmdline). For example, I stumbled upon this issue when I created a VM with the kernel configured as per the sample config, and it wouldn’t mount my XFS root.

I am going to implement this anyway, but I’m glad to submit a patch if you’re not opposed to this feature per se.

[1]: I’m not sure whether kexec would work from inside, though …

@nmeyerhans
Copy link
Contributor

In the model that you envision, firectl would mount the root filesystem, copy the kernel binary to some temporary location on disk, read the boot params into memory, then unmount the filesystem and configure the VM to use the values it extracted?

This doesn't seem like an unreasonable feature, though there are some edge cases that need to be considered. The ones I can think of off-hand include:

  • The host doesn't support the filesystem in use on the guest (especially in cases like squashfs), or doesn't support the specific filesystem version.
  • The case where the disk image is partitioned (firectl's --root-partition option)
  • It's likely that firecracker will get initrd support before too long (loader: add support for initrd firecracker#1246), so you'll want to track that and support it when it arrives
  • Probably other stuff that I haven't though of.

I'd certainly be willing to consider such a feature if you want to work on it.

@nmeyerhans nmeyerhans added the enhancement New feature or request label Nov 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants