After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 385434 - a warning dialog will be displayed when device is set to usb:
a warning dialog will be displayed when device is set to usb:
Status: RESOLVED FIXED
Product: gnome-pilot
Classification: Other
Component: capplet
2.0.15
Other All
: Normal critical
: ---
Assigned To: gnome-pilot Maintainers
gnome-pilot Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-12-13 13:05 UTC by Jerry Yu
Modified: 2007-01-11 09:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch for this bug (485 bytes, patch)
2006-12-13 13:06 UTC, Jerry Yu
none Details | Review

Description Jerry Yu 2006-12-13 13:05:01 UTC
Please describe the problem:
When using the latest gnome-pilot pkgs for Solaris USB port on X86 and SPARC
platform,a warning dialog will be displayed when device is set to usb:.

Steps to reproduce:
1.Connect one Palm device such as Palm treo 600 with X86 or SPARC machine by
USB port. Installed Solaris NV53, pilot-link-0.12.1 and Gnome-Pilot-2.0.15 pkgs
for USB port.
2.Start Gnome-Pilot GUI with command gpilotd-control-applet.
3.In Device Settings page of the druid window, set the Type as USB, Device as usb: and left the others as original
4 press Forward button

Actual results:
a warning dialog will be displayed, "Failed To find directory /sys/bus/usb/devices or read file /proc/bus/usb/devices.  Check that usbfs or sysfs is mounted."


Expected results:
these settings should be passed

Does this happen every time?
Yes.

Other information:
On Solaris box
Comment 1 Jerry Yu 2006-12-13 13:06:10 UTC
Created attachment 78284 [details] [review]
patch for this bug
Comment 2 Matt Davey 2006-12-13 13:58:01 UTC
Jerry,
I'm not familiar with solaris, but how does gpilotd detect a USB device?  My understanding of the gpilotd code is that either we have HAL (in which case the above warning isn't compiled in) or we poll usbfs to see if a known device has appeared.  In this latter case, we display a warning if usbfs isn't found.

I'd like to understand how device detection happens on Solaris before applying your patch.
Comment 3 Jerry Yu 2006-12-27 09:10:53 UTC
Sorry for slow responding.
I tested on my Suse Linux box, the file "/proc/bus/usb/devices" and the directory "/sys/bus/usb/devices" has already existed before I plugged in the Palm device, and there's no change for them after I plugged in the Palm and did a synchronization. The file "/proc/bus/usb/devices_please-use-sysfs-instead" didn't appear if I plugged in the Palm or not. So I think perhaps these codes didn't do what they should do.
#ifndef WITH_HAL
        } else if (device->type == PILOT_DEVICE_USB_VISOR) {
                /* check sysfs or usbfs is mounted */
                if(stat(sysfs_dir, &buf) != 0 &&
                    ((stat (usbdevicesfile_str, &buf) != 0 &&
                      stat ("/proc/bus/usb/devices_please-use-sysfs-instead", &buf) != 0) ||
                    !(S_ISREG(buf.st_mode)) ||
                    !(buf.st_mode & S_IRUSR))) {
                        str = g_strdup_printf (
                            _("Failed to find directory %s or read file %s.  "
                                "Check that usbfs or sysfs is mounted."),
                            sysfs_dir,
                            usbdevicesfile_str);
                        error_dialog (NULL, str);
                        g_free (str);
                        return FALSE;
                }
#endif

Comment 4 Matt Davey 2006-12-27 10:25:22 UTC
The file "/proc/bus/usb/devices_please-use-sysfs-instead" is, I believe,
specific to certain SuSE patched kernels.  It's probably obsolete now.

The /proc/bus/usb/devices file, if it exists, should contain an entry for a palm device while a sync is in progress.

This /proc/bus/usb/devices file was how gnome-pilot detected USB devices in all versions up to and including 2.0.13.  I'd be very surprised if the file isn't being updated when a new USB device appears.  It is, just about, possible that SuSE have broken the devices file interface, I suppose.  It is deprecated, which is why we've migrated to HAL and sysfs.

/sys/bus/usb/devices contains symlinks to (on my Ubuntu system) /sys/devices/ directories, so things like 'find /sys/bus/usb/devices' won't show details.  Again, if a new device appears, a new directory should appear there.
E.g. on my system, when I plug in a USB printer I get (in dmesg):
" usb 1-1.4: new full speed USB device "
and a directory: /sys/bus/usb/devices/1-1.4

So, check again whether a new directory appears in /sys/bus/usb/devices when you start a sync on SuSE.
Comment 5 Jerry Yu 2006-12-29 07:41:06 UTC
you are right, a new directory appears in /sys/bus/usb/devices when a sync is in progress on my SuSE box.
However, there's no usb devices file and directory on Solaris which are similar with "/proc/bus/usb/devices" and "/sys/bus/usb/devices" on Linux. So it's not necessary to check them on Solaris.
Comment 6 Matt Davey 2006-12-29 13:27:28 UTC
Okay.

So how, on solaris, does gpilotd decide to sync?  Or does it attempt a sync every 2 seconds (i.e. every 'visor_devices_timeout') ?
Comment 7 Jerry Yu 2007-01-09 08:06:47 UTC
Currently gpilotd attempt a sync every 2 seconds on Solaris. However in the future when HAL works well on solaris, gpilotd will use HAL to detect the devices automatically by enabling --with-hal .
Comment 8 Matt Davey 2007-01-11 09:00:22 UTC
Fixed in head (i.e. subversion trunk).
Comment 9 Jerry Yu 2007-01-11 09:04:20 UTC
Thanks Matt.