[Libguestfs] [PATCH 1/2] Try to load the loop module before running mkinitrd

Richard W.M. Jones rjones at redhat.com
Thu Apr 22 16:02:59 UTC 2010


On Thu, Apr 22, 2010 at 02:38:11PM +0100, Matthew Booth wrote:
> mkinitrd needs to mount files using loop. loop might be a module, so try to load
> it first.
> ---
>  lib/Sys/VirtV2V/GuestOS/RedHat.pm |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/lib/Sys/VirtV2V/GuestOS/RedHat.pm b/lib/Sys/VirtV2V/GuestOS/RedHat.pm
> index 0e469f5..08027b6 100644
> --- a/lib/Sys/VirtV2V/GuestOS/RedHat.pm
> +++ b/lib/Sys/VirtV2V/GuestOS/RedHat.pm
> @@ -1114,6 +1114,13 @@ sub prepare_bootable
>              $g->modprobe("ext2");
>          };
>  
> +        # loop is a module in RHEL 5. Try to load it. Doesn't matter for other
> +        # OSs if it doesn't exist, but RHEL 5 will complain:
> +        #   All of your loopback devices are in use.
> +        eval {
> +            $g->modprobe("loop");
> +        };
> +
>          $g->command(["/sbin/mkinitrd", @preload_args, $initrd, $version]);
>      }
>  
> -- 
> 1.6.6.1

ACK, modprobing that should always be safe.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
libguestfs lets you edit virtual machines.  Supports shell scripting,
bindings from many languages.  http://et.redhat.com/~rjones/libguestfs/
See what it can do: http://et.redhat.com/~rjones/libguestfs/recipes.html




More information about the Libguestfs mailing list