Bug 124520 - updfstab and USB
Summary: updfstab and USB
Alias: None
Product: Fedora
Classification: Fedora
Component: kudzu
Version: rawhide
Hardware: athlon
OS: Linux
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2004-05-27 07:52 UTC by Ivan Gyurdiev
Modified: 2014-03-17 02:45 UTC (History)
3 users (show)

Clone Of:
Last Closed: 2004-11-28 20:08:05 UTC

Attachments (Terms of Use)

Description Ivan Gyurdiev 2004-05-27 07:52:26 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6)
Gecko/20040518 Firefox/0.8

Description of problem:
My FujiFilm FinePix 3800 Digital Camera is not added to fstab as it
should be upon insert (yet strangely it's removed just fine...)

The entry in updfstab.conf.default is:

device camera {
    partition 1
    match   hd DSC
    match   hd CAMERA
    match   hd USB-DRIVEUNIT
    match   hd PENTAX
    match   hd PSC

The following fixes it for me:

--- kudzu-1.1.67/updfstab.c     2004-03-11 18:26:15.000000000 -0600
+++ kudzu-modded/updfstab.c     2004-05-27 01:41:43.679101496 -0600
@@ -358,7 +358,7 @@
        kudzuDevices = readDevices("/etc/sysconfig/hwconf");
     } else {
        kudzuDevices = probeDevices(CLASS_CDROM | CLASS_HD | CLASS_FLOPPY,
-                                   BUS_IDE | BUS_SCSI |
+                                   BUS_IDE | BUS_SCSI | BUS_USB |
                                    BUS_MISC | BUS_FIREWIRE, 0);
     if (!kudzuDevices) return 0;

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.Connect a FujiFilm 3800 FinePix Digital Camera to a USB port

Additional info:

Comment 1 Bill Nottingham 2004-05-27 21:40:51 UTC
That's not the right fix. What sort of SCSI device does it show up as?

Comment 2 Ivan Gyurdiev 2004-05-27 23:59:51 UTC
usb 1-2: new full speed USB device using address 3
Initializing USB Mass Storage driver...
scsi0 : SCSI emulation for USB Mass Storage devices
  Vendor: FUJIFILM  Model: USB-DRIVEUNIT     Rev: 1.00
  Type:   Direct-Access                      ANSI SCSI revision: 02
Attached scsi generic sg0 at scsi0, channel 0, id 0, lun 0,  type 0
USB Mass Storage device found at 3
usbcore: registered new driver usb-storage
USB Mass Storage support registered.
SCSI device sda: 256000 512-byte hdwr sectors (131 MB)
sda: assuming Write Enabled
sda: assuming drive cache: write through
 sda: sda1
Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0

[root@cobra root]# lsusb
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 003: ID 04cb:011a Fuji Photo Film Co., Ltd FinePix
Bus 001 Device 002: ID 03f0:1904 Hewlett-Packard DeskJet 3820
Bus 001 Device 001: ID 0000:0000
[root@cobra root]#

Comment 3 Bill Nottingham 2004-05-28 16:24:17 UTC
Hm, so the correct match would be something like 'FUJIFILM USB-DRIVEUNIT'.

If you add *that* to updfstab.conf.default, does it work without the
kudzu patch?

Comment 4 Ivan Gyurdiev 2004-05-28 23:43:38 UTC
It does not. Tried with or without the quotes.

device camera {
    partition 1
    match   hd DSC
    match   hd CAMERA
    match   hd USB-DRIVEUNIT
    match   hd PENTAX
    match   hd PSC

When I was trying to find the bug probe_devices was returning my
printer and my hard drives, not my camera. That's why I made it look
at the USB bus. I see you want it looking at SCSI but that doesn't
enumerate it. If I remember the source correctly probe_devices is
unaffected by the config file, but you'd know best.

One more thing - starting kudzu (as in /etc/init.d/kudzu start while
the camera is on) detects the camera - I guess I should have mentioned
this, but I forgot.

Comment 5 Ivan Gyurdiev 2004-05-29 00:00:34 UTC
Furthermore this is not the redhat kernel. This is vanilla 2.6.7-rc1,
but this should be irrelevant as I have all the necessary modules to
make this device works (and it does work - it's just not added to
fstab properly)

Comment 6 Bill Nottingham 2004-06-01 04:51:49 UTC
What does 'kudzu -p -b scsi' with the camera inserted say?

Comment 7 Ivan Gyurdiev 2004-06-01 06:04:41 UTC
It says:

[root@cobra root]# kudzu -p -b scsi
class: HD
bus: SCSI
detached: 0
device: sda
driver: ignore
desc: "Fujifilm USB-DRIVEUNIT"
host: *(see below)
id: 0
channel: 0
lun: 0
generic: sg0
[root@cobra root]#

* starts at 0 and increases every time the camera's turned on.
Resets at 0 when scsi_mod is removed and re-insmoded.

Furthermore, if I remove sd_mod, sg, and usb_storage,
the first time I turn on the camera afterwards makes it appear in
nautilus and adds it to fstab. Afterwards it stops working until I
remove the modules again. If I just remove sd_mod and sg it doesn't
work - seems I have to remove usb_storage.

Just discovered this...btw I am using the official Fedora kernel to
test now - this one is .403. Settled for good 2D performance with
vanilla kernel at the expence of 3D :)

Comment 8 Bill Nottingham 2004-06-01 16:18:49 UTC
Is the camera device partitioned? 


should work, assuming the partitions match.

Comment 9 Ivan Gyurdiev 2004-06-01 16:32:39 UTC
This is what fdisk says about it:

Disk /dev/sda: 131 MB, 131072000 bytes
16 heads, 32 sectors/track, 500 cylinders
Units = cylinders of 512 * 512 = 262144 bytes
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         500      127976+   6  FAT16

It does work...the first time...and then it doesn't work after that
until I modprobe usb-storage out or start kudzu via the rc script.

Comment 10 Ivan Gyurdiev 2004-06-01 17:42:34 UTC
It's a timing issue.
/proc/scsi/scsi is read too fast in scsiProbe and the camera's missed.
A sleep(1) before it's read fixes it. What does that mean - what has
to be fixed?

Comment 11 Ivan Gyurdiev 2004-06-01 17:53:16 UTC
Is the kernel supposed to update proc before triggering the hotplug
event? Should I email Greg KH and ask?

Comment 12 Bill Nottingham 2004-06-01 18:34:06 UTC
You can check. What I'm guessing happens is we get hotplug events for
the usb attach, but not for the disk, etc.

Comment 13 Ivan Gyurdiev 2004-06-02 22:41:29 UTC
Greg KH wrote:
> On Wed, Jun 02, 2004 at 01:36:09PM -0400, Bill Nottingham wrote:
>>Greg KH (greg@kroah.com) said: 
>>>On Tue, Jun 01, 2004 at 01:32:22PM -0600, Ivan Gyurdiev wrote:
>>>>Fedora's updfstab tool (part of kudzu) is trigged by hotplug to 
>>>>add/remove things from fstab, such as my Fujifilm Digital Camera 
>>>>(usb-storage, scsi emulation). However... it reads
/proc/scsi/scsi, and 
>>>>doesn't work as it should because it's triggered before
>>>>is updated most of the time. Where is the bug, and how should this
>>>>be corrected?
>>>The race should be fixed by having the hotplug script wait around for
>>>the proc file to show up.
>>Hm, as I was thinking, the hotplug event is triggered by the USB
>>insertion; what's really needed for updfstab is that it gets
>>run triggered on the *scsi* device creation. Or is this the proc
>>file you're referring too?
> Yes, good point, you should update the fstab after the device node is
> created.  You can learn of that by putting your script in the
> /etc/dev.d/ directory tree.
> thanks,

Well I'm rather confused as to how this would work exactly, but I take
it you have enough information (from me) to correct the bug? Email if
you need me to test anything...

Comment 14 Bill Nottingham 2004-06-02 22:45:41 UTC
Well, Greg's reply implies the use of udev, which isn't in use by
default in FC2.

Comment 15 Ivan Gyurdiev 2004-06-04 11:55:25 UTC
Well, I don't know what should be done. You're the developer - I can
just say that it doesn't work properly the way it is now. 

Good luck. 


P.S. It would be nice for FC2 to start using udev. I hope it's
integrated into core soon.

Comment 16 Ivan Gyurdiev 2004-11-25 00:53:23 UTC
What's the status of this bug after udev integration.
I don't have the camera right now to retest anything,
but if the bug no longer applies it should be closed.

Comment 17 Bill Nottingham 2004-11-28 20:08:05 UTC
Yeah, with udev, this is all handled by HAL and gnome-volume-manager.
Please open a bug against HAL if this fails there.

Note You need to log in before you can comment on or make changes to this bug.