[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
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/
participants (2)
-
Pino Toscano -
Richard W.M. Jones