Pino Toscano
2020-Mar-12 12:53 UTC
[Libguestfs] [PATCH] get-kernel: fallback to uncompressed vmlinux kernels
In case the Linux guest has no compressed linux kernel (vmlinuz), fallback to uncompressed ones (vmlinux). Reported by: Laurent Vivier. --- get-kernel/get_kernel.ml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/get-kernel/get_kernel.ml b/get-kernel/get_kernel.ml index 3015c0fca..e485cf495 100644 --- a/get-kernel/get_kernel.ml +++ b/get-kernel/get_kernel.ml @@ -144,6 +144,9 @@ and pick_kernel_files_linux (g : Guestfs.guestfs) root let kernels = glob "/boot/vmlinuz-*" in let initrds = glob "/boot/initramfs-*" in + (* Uncompressed kernels: *) + let kernels = if kernels <> [] then kernels else glob "/boot/vmlinux-*" in + (* Old RHEL: *) let initrds = if initrds <> [] then initrds else glob "/boot/initrd-*" in -- 2.24.1
Richard W.M. Jones
2020-Mar-12 14:47 UTC
Re: [Libguestfs] [PATCH] get-kernel: fallback to uncompressed vmlinux kernels
On Thu, Mar 12, 2020 at 01:53:54PM +0100, Pino Toscano wrote:> In case the Linux guest has no compressed linux kernel (vmlinuz), > fallback to uncompressed ones (vmlinux). > > Reported by: Laurent Vivier. > --- > get-kernel/get_kernel.ml | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/get-kernel/get_kernel.ml b/get-kernel/get_kernel.ml > index 3015c0fca..e485cf495 100644 > --- a/get-kernel/get_kernel.ml > +++ b/get-kernel/get_kernel.ml > @@ -144,6 +144,9 @@ and pick_kernel_files_linux (g : Guestfs.guestfs) root > let kernels = glob "/boot/vmlinuz-*" in > let initrds = glob "/boot/initramfs-*" in > > + (* Uncompressed kernels: *) > + let kernels = if kernels <> [] then kernels else glob "/boot/vmlinux-*" in > + > (* Old RHEL: *) > let initrds = if initrds <> [] then initrds else glob "/boot/initrd-*" inUnusual? But fine so ... ACK Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://people.redhat.com/~rjones/virt-df/
Apparently Analagous Threads
- [PATCH 1/3] get-kernel: split command line handling in own function
- [PATCH] (Almost) new tool: virt-get-kernel
- [PATCH 1/3] sysprep, get-kernel: explicit the Guestfs parameter
- Re: [PATCH 1/3] sysprep, get-kernel: explicit the Guestfs parameter
- [PATCH 2/3] get-kernel: add --unversioned-names