[Libguestfs] virt-builder fails in fedora 34 container:

Richard W.M. Jones rjones at redhat.com
Wed Jun 16 08:58:08 UTC 2021


On Tue, Jun 15, 2021 at 03:22:23PM +0300, Nir Soffer wrote:
> On Sun, Jun 13, 2021 at 1:38 PM Richard W.M. Jones <rjones at redhat.com> wrote:
> >
> > On Sat, Jun 12, 2021 at 11:11:22PM +0300, Nir Soffer wrote:
> > > I'm running this inside a fedora 34 container in ovirt-imageio CI:
> > >
> > >     'virt-builder', '-v', '-x', 'cirros-0.3.5', '--write',
> > > '/etc/cirros-init/config:DATASOURCE_LIST="nocloud"',
> > > '--root-password', 'password:', '-o',
> > > '/var/tmp/imageio-images/cirros-0.3.5'
> > >
> > > The command fails in:
> > >
> > > supermin: ext2: copying kernel modules
> > > supermin: ext2: creating minimal initrd
> > > '/var/tmp/.guestfs-0/appliance.d.t7nny0l7/initrd'
> > > supermin: exception:
> > > Sys_error("/lib/modules/5.12.9-300.fc34.x86_64/modules.dep: No such
> > > file or directory")
> >
> > We use this file in order to construct the minimal initrd with some
> > virtio modules, which is sufficient to bring up the supermin root
> > filesystem.  The file itself is used to calculate the correct set of
> > module dependencies (so that, for example, if a virtio kmod needs
> > another kmod then the other kmod will be pulled in).  See:
> 
> Is it correct to use /lib/modules/kernel-X/modules.dep
> when the file was created on the system building the container
> while running the container on kernel-Y?

Yes, because libguestfs runs the kernel from /boot + /lib/modules on
top of qemu.  It doesn't use the host kernel.

> For example, we build the container in quay.io (no idea which kernel)
> and run the container in travis (Ubuntu xenial, kernel 5.4), or locally
> (Fedora 32, kernel 5.11).
> 
> Should virt builder/supermin use "demod --show" to generate a temporary
> modules.dep, instead of depending on system modules.dep when running
> in a container?

It's not clear to me where depmod --show gets its information from.
The host kernel?

Anyway, possibly ... but correctly built guests have modules.dep so
it's not been a problem until now.

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