amluto / virtme

An easy way to virtualize the running system
GNU General Public License v2.0
330 stars 66 forks source link

Make virtme-mkinitramfs great again #39

Closed marcosps closed 5 years ago

marcosps commented 5 years ago

While trying to create an initrd file using virtme-mkinitramfs, I found this script is not currently working, and is neither being installed like virtme-run and virtme-configkernel.

Let me know if I misunderstood the purpose of the tool or if the code needs some polishment.

amluto commented 5 years ago

Hmm. Now I'm wondering why this script exists at all. I suppose I ought to know, since I wrote it.

Let me mull over this. I'll probably merge at least part of it shortly.

marcosps commented 5 years ago

I was trying to test kexec from within virtme (qemu), and then I found virtme-mkinitramfs, which would help me to create a minimal initrd image for virtme. So, that's why I came up with these patches.

I'm not sure if virtme-mkinitramfs was meant to be an external tool, but it happened to be very useful for creating a minimal initrd for testing tools like kexec. I'm not sure if this is a "valid" use case to let virtme-mkinitramfs around and not removing it entirely.

marcosps commented 5 years ago

@amluto any feedback regarding the patches?

amluto commented 5 years ago

On consideration, I'm okay with making virtme-mkinitramfs great again :) But I think it should be a bit tidier. Let's move it into virtme/commands like run.py and use relative imports. And I think the config.busybox part should maybe go into the mkinitramfs script instead.

Why do you need --outfile instead of just piping? Is it to avoid goo on the screen if you use it wrong?

marcosps commented 5 years ago

@amluto yes, because it took me some time to understand what was happening :)

I will try to rework the patches to move the code to commands as you suggested. Hope to get this done soon.

amluto commented 5 years ago

BTW, I'm glad you found the tool useful. It certainly wasn't intended to be used for anything other than as an internal helper for virtme-run. As virtme-run has evolved, I've been trying to minimize reliance on the initramfs and to reduce the cases in which it's used. I'd be happy to take additional patches to make virtme-mkinitramfs even more useful for standalone use, as long as they come with some documentation and don't add an undue maintenance burden to the rest of virtme.

marcosps commented 5 years ago

@amluto I think that's it what you meant. I hope to address all your comments. Let me know if you want me to change this any further. Thanks!