[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Reports of successful Squeeze upgrades



On Fri, Feb 25, 2011 at 09:31, Gordon Farquharson
<gordonfarquharson@gmail.com> wrote:
> On Fri, Feb 25, 2011 at 04:01, Martin Michlmayr <tbm@cyrius.com> wrote:
>> * Gordon Farquharson <gordonfarquharson@gmail.com> [2011-02-24 22:30]:
>>> I was thinking about whether to file a bug today. USB devices are
>>> generally not permanently attached to the computer, so is it
>>> reasonable to expect MODULES=dep to include the drivers specific to
>>> detachable hardware? I came to the conclusion that probably it is the
>>
>> Maybe I misunderstood but I thought your root device was on a USB
>> device.  If root is on USB, surely initramfs-tools should make sure
>> that the drivers are included.
>
> The root file system isn't on the RAID, but the USB device that
> requires ums-cypress was connected to the machine during the
> upgrade... so, you make a good point - would MODULES=dep have
> installed ums-cypress if the root file system had been on the RAID
> device? For lenny, usb-storage was all that was needed, but for
> squeeze, ums-cypress is needed so MODULES=dep _should_ have installed
> it automatically. However, it looks like this issue was reported and
> fixed (see 543568 [1]), so why didn't initramfs-tools do the right
> thing? Well, it looks like the initramfs_tools code has been
> significantly rewritten since the patch in 543568 was applied, so the
> bug may still exist because it looks like the code now only copies usb
> storage modules for MODULES=most. I should test it with my other slug
> and USB enclosure. I'll install lenny, and then upgrade to squeeze to
> see if ums-cypress is installed in the initramfs.

So it turns out that initramfs does indeed include the necessary
modules when upgrading from lenny to squeeze and the root file system
is on a USB storage device that requires one of the ums-* modules. The
magic is built into modprobe:

gordon@LKG7102D7:~$ sudo modprobe --set-version=2.6.32-5-ixp4xx
--ignore-install --quiet --show-depends
usb:v04B4p6830d0001dc00dsc00dp00ic08isc06ip50
insmod /lib/modules/2.6.32-5-ixp4xx/kernel/drivers/scsi/scsi_mod.ko
insmod /lib/modules/2.6.32-5-ixp4xx/kernel/fs/nls/nls_base.ko
insmod /lib/modules/2.6.32-5-ixp4xx/kernel/drivers/usb/core/usbcore.ko
insmod /lib/modules/2.6.32-5-ixp4xx/kernel/drivers/usb/storage/usb-storage.ko
insmod /lib/modules/2.6.32-5-ixp4xx/kernel/drivers/scsi/scsi_mod.ko
insmod /lib/modules/2.6.32-5-ixp4xx/kernel/fs/nls/nls_base.ko
insmod /lib/modules/2.6.32-5-ixp4xx/kernel/drivers/usb/core/usbcore.ko
insmod /lib/modules/2.6.32-5-ixp4xx/kernel/drivers/usb/storage/usb-storage.ko
insmod /lib/modules/2.6.32-5-ixp4xx/kernel/drivers/usb/storage/ums-cypress.ko

This output was generated after I have installed the squeeze kernel
and udev, but before rebooting, i.e., I was still running the lenny
kernel. This command is generated by manual_add_modules() in
/usr/share/initramfs-tools/hook-functions which is sourced in
mkinitramfs.

>> I'm not sure if there's a way to figure out which ums-* module you
>> need but maybe MODULES=dep should put all ums-* modules into the
>> ramdisk when root is on USB.
>
> This solution is what the patch in 543568 did.

We may not know how to figure out which ums-* modules are required,
but modprobe does know :-)

I'm guessing that mkinitramfs only looks for modules required for the
root file system, which is why ums-cypress was not included in my
initramfs for my RAID device. This guess is supported by the comment
in /usr/share/initramfs-tools/hook-functions above dep_add_modules():

# find and only copy root relevant modules

Unfortunately, I don't have the hard available, e.g., a non-Cypress
USB enclosure, with which to repeat a test of this idea. Martin, do
you think that initramfs should include the modules for all USB
storage devices attached to the system? Maybe it should be filed as a
feature request.

Gordon

-- 
Gordon Farquharson
GnuPG Key ID: 32D6D676


Reply to: