[Libguestfs] [PATCH] get-kernel: fallback to uncompressed vmlinux kernels

Richard W.M. Jones rjones at redhat.com
Thu Mar 12 14:47:29 UTC 2020


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-*" in

Unusual?  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/




More information about the Libguestfs mailing list