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

Auto-detect whether the kernel is bzImage or vmlinuz. #144

Merged
merged 1 commit into from
Oct 31, 2016

Conversation

dlorenc
Copy link
Collaborator

@dlorenc dlorenc commented Oct 29, 2016

This changes the extract function to just copy everything it can find, and it moves the detection into the getXhyveArgs function.

What do you think of this approach?

Ref #140

@zchee
Copy link
Member

zchee commented Oct 31, 2016

@dlorenc Sorry for delay.
I'll check it later. Thanks!

@dlorenc
Copy link
Collaborator Author

dlorenc commented Oct 31, 2016

I'll check it later. Thanks!

Thanks, let me know what you think of the approach. Minikube itself won't really know what's in the iso either, so passing this in via a struct parameter would be hard.

"os/exec"
"strings"

"github.com/docker/machine/libmachine/mcnutils"
Copy link
Member

Choose a reason for hiding this comment

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

Why add "github.com/docker/machine/libmachine/mcnutils"?
https://github.com/docker/machine/blob/master/libmachine/mcnutils/utils.go is not have IsExist()

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

My mistake, I had to make this public to share it and I accidentally put it in the wrong place...

Copy link
Member

Choose a reason for hiding this comment

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

okay, got it.

@zchee
Copy link
Member

zchee commented Oct 31, 2016

As in #140 (comment)

However, this problem might be solved with adding initialize method.
Sorry, I still don't understand minikube internal.
Where do I should add the initialize method for having a backward compatibility of minikube?

I wanted to say "backward compatibility method" is this approach. And would be able to provide backward compatibility without changing the minikube.

Hardcoded "kernel image" filename is a little bit not good. But It is inevitable.
So almost LGTM.

log.Debugf("Unmounting %s", isoFilename)
if err := hdiutil("detach", volumeRootDir); err != nil {
return err
for _, f := range []string{"vmlinuz64", "bzImage", "initrd", "initrd.img"} {
Copy link
Member

@zchee zchee Oct 31, 2016

Choose a reason for hiding this comment

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

for feature use, I think to add vmlinuz(generally compressed kernel image name) and vmlinux(not compressed) is better.
https://en.wikipedia.org/wiki/Vmlinux

Traditionally, UNIX platforms called the kernel image /unix. With the development of virtual memory, kernels that supported this feature were given the vm- prefix to differentiate them. The name vmlinux is a mutation of vmunix, while in vmlinuz the letter z at the end denotes that it is compressed (gzipped).[1]

What do you think?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure I understand. Should I add vmlinux here as well? Or are you suggesting to use that instead of vmlinuz?

Copy link
Member

Choose a reason for hiding this comment

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

Ah, sorry confused.
minikube and boot2docker are used bzImage and vmlinuz64.
But generally,

  • kenrnel filename: vmlinuz or vmlinux or bzImage
  • initrd filename: initrd or initrd.gz

e.g.
http://ftp.debian.org/debian/dists/jessie/main/installer-amd64/current/images/hd-media/

So, I think

[]string{"vmlinux", "vmlinuz64", "vmlinuz", "bzImage", "initrd", "initrd.gz", "initrd.img"}

is better for feature use.

Do you get what I want to say...?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah, makes sense. Thanks!

Copy link
Member

Choose a reason for hiding this comment

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

thanks :)

@zchee zchee mentioned this pull request Oct 31, 2016
@zchee
Copy link
Member

zchee commented Oct 31, 2016

@dlorenc Sorry, conflicting xhyve/xhyve.go. and WDYT vmlinuz and vmlinux?
Please rebase.

@zchee
Copy link
Member

zchee commented Oct 31, 2016

LTGM. waiting for CI.

@zchee zchee merged commit 8cc908a into machine-drivers:minikube-iso_kexec Oct 31, 2016
@zchee zchee removed the in progress label Oct 31, 2016
@dlorenc dlorenc deleted the detect branch October 31, 2016 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants