At 2016-07-21 19:52:11, "Pino Toscano" <ptoscano@redhat.com> wrote:>On Thursday, 21 July 2016 18:50:52 CEST Chen Hanxiao wrote: >> >> At 2016-07-21 18:43:04, "Richard W.M. Jones" <rjones@redhat.com> wrote: >> >On Thu, Jul 21, 2016 at 06:36:20PM +0800, Chen Hanxiao wrote: >> >> the virtio modules in kmods did existed in this machine. >> >> with -v -v -v, I got: >> > >> >Can you attach or pastebin the complete output from this command on >> >the failing machine please: >> > >> >supermin5 --build -f ext2 -v -v -v /usr/lib64/guestfs/supermin.d -o /tmp/appliance.d >> > >> >> Sure. >> >> Please check the attachments. > >Hm, is the /lib/modules/3.10.0-229.el7.x86_64/modules.dep file correct >(as in existing and not empty)? If so, what if you run as root >`depmod -a` and then try again? >Hi, Pino: Thanks for your hint. I think we got the key: on the machine fail: we lack of lines like: kernel/drivers/char/hw_random/amd-rng.ko: kernel/drivers/char/hw_random/via-rng.ko: kernel/drivers/char/hw_random/virtio-rng.ko: kernel/drivers/virtio/virtio_ring.ko kernel/drivers/virtio/virtio.ko kernel/drivers/char/hw_random/tpm-rng.ko: kernel/drivers/char/tpm/tpm_nsc.ko: kernel/drivers/char/tpm/tpm_atmel.ko: kernel/drivers/char/tpm/tpm_infineon.ko: kernel/drivers/char/virtio_console.ko: kernel/drivers/virtio/virtio_ring.ko kernel/drivers/virtio/virtio.ko ... which existed on the machine works fine. It works fine now. But why we make initrd only depends on modules.dep? Regards, - Chen
On Thursday, 21 July 2016 20:04:05 CEST Chen Hanxiao wrote:> > At 2016-07-21 19:52:11, "Pino Toscano" <ptoscano@redhat.com> wrote: > >On Thursday, 21 July 2016 18:50:52 CEST Chen Hanxiao wrote: > >> > >> At 2016-07-21 18:43:04, "Richard W.M. Jones" <rjones@redhat.com> wrote: > >> >On Thu, Jul 21, 2016 at 06:36:20PM +0800, Chen Hanxiao wrote: > >> >> the virtio modules in kmods did existed in this machine. > >> >> with -v -v -v, I got: > >> > > >> >Can you attach or pastebin the complete output from this command on > >> >the failing machine please: > >> > > >> >supermin5 --build -f ext2 -v -v -v /usr/lib64/guestfs/supermin.d -o /tmp/appliance.d > >> > > >> > >> Sure. > >> > >> Please check the attachments. > > > >Hm, is the /lib/modules/3.10.0-229.el7.x86_64/modules.dep file correct > >(as in existing and not empty)? If so, what if you run as root > >`depmod -a` and then try again? > > > > Hi, Pino: > > Thanks for your hint. > I think we got the key: > > on the machine fail: > we lack of lines like: > > kernel/drivers/char/hw_random/amd-rng.ko: > kernel/drivers/char/hw_random/via-rng.ko: > kernel/drivers/char/hw_random/virtio-rng.ko: kernel/drivers/virtio/virtio_ring.ko kernel/drivers/virtio/virtio.ko > kernel/drivers/char/hw_random/tpm-rng.ko: > kernel/drivers/char/tpm/tpm_nsc.ko: > kernel/drivers/char/tpm/tpm_atmel.ko: > kernel/drivers/char/tpm/tpm_infineon.ko: > kernel/drivers/char/virtio_console.ko: kernel/drivers/virtio/virtio_ring.ko kernel/drivers/virtio/virtio.ko > ... > > which existed on the machine works fine. > > It works fine now. > > But why we make initrd only depends on modules.dep?supermin copies some needed modules in the initrd, and of course also the dependencies of these modules need to be copied as well. Copying a module without the needed modules for it means it won't even load. -- Pino Toscano
On Thu, Jul 21, 2016 at 08:04:05PM +0800, Chen Hanxiao wrote:> Thanks for your hint. > I think we got the key: > > on the machine fail: > we lack of lines like: > > kernel/drivers/char/hw_random/amd-rng.ko: > kernel/drivers/char/hw_random/via-rng.ko: > kernel/drivers/char/hw_random/virtio-rng.ko: kernel/drivers/virtio/virtio_ring.ko kernel/drivers/virtio/virtio.ko > kernel/drivers/char/hw_random/tpm-rng.ko: > kernel/drivers/char/tpm/tpm_nsc.ko: > kernel/drivers/char/tpm/tpm_atmel.ko: > kernel/drivers/char/tpm/tpm_infineon.ko: > kernel/drivers/char/virtio_console.ko: kernel/drivers/virtio/virtio_ring.ko kernel/drivers/virtio/virtio.ko > ... > > which existed on the machine works fine. > > It works fine now. > > But why we make initrd only depends on modules.dep?modules.dep is used to work out the module dependencies, so we know which minimal set of modules should be copied into the initrd: https://github.com/libguestfs/supermin/blob/master/src/ext2_initrd.ml#L68-L152 If you copy too many modules into the initrd, then it will be huge and boot times will be very slow, so knowing the exact set of modules which are required is important. Of course if modules.dep is broken then that won't work. Do you understand who broke the file and/or why it was broken? Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v
At 2016-07-21 21:17:07, "Richard W.M. Jones" <rjones@redhat.com> wrote:>On Thu, Jul 21, 2016 at 08:04:05PM +0800, Chen Hanxiao wrote: >> Thanks for your hint. >> I think we got the key: >> >> on the machine fail: >> we lack of lines like: >> >> kernel/drivers/char/hw_random/amd-rng.ko: >> kernel/drivers/char/hw_random/via-rng.ko: >> kernel/drivers/char/hw_random/virtio-rng.ko: kernel/drivers/virtio/virtio_ring.ko kernel/drivers/virtio/virtio.ko >> kernel/drivers/char/hw_random/tpm-rng.ko: >> kernel/drivers/char/tpm/tpm_nsc.ko: >> kernel/drivers/char/tpm/tpm_atmel.ko: >> kernel/drivers/char/tpm/tpm_infineon.ko: >> kernel/drivers/char/virtio_console.ko: kernel/drivers/virtio/virtio_ring.ko kernel/drivers/virtio/virtio.ko >> ... >> >> which existed on the machine works fine. >> >> It works fine now. >> >> But why we make initrd only depends on modules.dep? > >modules.dep is used to work out the module dependencies, so we know >which minimal set of modules should be copied into the initrd: > > https://github.com/libguestfs/supermin/blob/master/src/ext2_initrd.ml#L68-L152 > >If you copy too many modules into the initrd, then it will be huge and >boot times will be very slow, so knowing the exact set of modules >which are required is important. > >Of course if modules.dep is broken then that won't work. > >Do you understand who broke the file and/or why it was broken? >Hi, Rich: Thanks for your kindly explanation. It looks like it's some guy's fat finger casuse this issue. I checked other machines installed the same centos version, it's all right. Regards, - Chen