LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Slack Current and KDE 3.5 automount (https://www.linuxquestions.org/questions/slackware-14/slack-current-and-kde-3-5-automount-443909/)

rkelsen 05-17-2006 11:18 PM

Quote:

Originally Posted by quip
did you have to modify any files relating to pmount or hal to get pmount to automatically mount devices on insertion?

At a minimum, you should rebuild kde-base using the "--with-hal" option. Obviously, HAL must be installed first.

I'm planning to post a step-by-step guide once I get it working 100%.
Quote:

Originally Posted by quip
I'm using KDE, with udev 071, dbus 0.50, hal 0.5.4, and pmount 0.9.7. Udev is from slack-current, pmount is home-built, and dbus and hal are from Freerock.

Those versions of HAL & dbus are obsolete now. Try using more up to date versions from freedesktop.org.

quip 05-17-2006 11:40 PM

Zborgerd: Thanks for the links, but I must be missing something because I have looked at those before and still can't seem to get pmount to do it like fstab-sync can. I did just drop in the short script in /etc/hal/device.d like Mayrhofer suggested, and will be trying it in a few minutes. Setting it up as a link, as suggested in the KDE wiki you mentioned, did not seem to work for me.

Rkelsen: I just upgraded using the packages from Freerock. Now, hal is version 0.5.7. I did rebuild kioslave/media, like mentioned on the KDE wiki, although I did not pass the --enable-hal. Just to be clear: I can get it working using fstab-sync (the device is mounted, and an icon placed on the desktop upon insertion) but I am having trouble getting pmount to do the same. Since fstab-sync is going out the window eventually, I am trying to get pmount working.

quip 05-18-2006 02:46 PM

A little bit of an update:

I upgraded to the new hal and dbus from Freerock current. Unfortunately, they not only broke fstab-sync (I am guessing because the hal people have finally stripped it out entirely), but still did not get me anywhere on pmount. Pmount works from the command line, but I cannot seem to get it to work within KDE. I passed the "with-hal" option to the configure script in kdebase, then rebuilt the kioslave/media directory and installed, but still had the same situation. I downgraded hal to the package I had working with fstab-sync (0.5.4), and am back to using fstab-sync, which has worked well for me. I just thought it would be better to get pmount working for a couple of reasons, but I am stuck for now.

The script by Mayrhofer also did nothing for me.

Any ideas?

zborgerd 05-18-2006 03:04 PM

Quote:

Originally Posted by quip
A little bit of an update:

I upgraded to the new hal and dbus from Freerock current. Unfortunately, they not only broke fstab-sync (I am guessing because the hal people have finally stripped it out entirely), but still did not get me anywhere on pmount. Pmount works from the command line, but I cannot seem to get it to work within KDE. I passed the "with-hal" option to the configure script in kdebase, then rebuilt the kioslave/media directory and installed, but still had the same situation. I downgraded hal to the package I had working with fstab-sync (0.5.4), and am back to using fstab-sync, which has worked well for me. I just thought it would be better to get pmount working for a couple of reasons, but I am stuck for now.

The script by Mayrhofer also did nothing for me.

Any ideas?

Does pmount have any verbose output, like I demonstrated with gnome-volume-manager? It might be beneficial to see exactly what it is doing when you insert or remove media. HAL simply isn't getting any commands from any external programs.

Verify that passing a HAL udi actually works with pmount. If it does, then it's probably something in the kioslave stuff that's not passing the pmount command.

On GNOME, it does it like this:

/usr/bin/gnome-mount --hal-udi=/org/freedesktop/Hal/devices/volume_label_Slk102d1

I'm not sure how it works for pmount, but I assume that it needs to pass the udi to HAL in the same manner.

quip 05-18-2006 03:22 PM

Ok.

Some cairo error is keeping me from opening hal-device-manager, so I figured I can just give a 'hal-device | more' and scroll until I find a device I know, such as my flash drive.

I did this, but there's a lot of info, including a line that says:
udi = '/org/freedesktop/Hal/devices/usb_device_781_5150_20041100600cf0d39226'

What part of that string should I pass to pmount?

zborgerd 05-18-2006 03:35 PM

Quote:

Originally Posted by quip
Ok.

Some cairo error is keeping me from opening hal-device-manager, so I figured I can just give a 'hal-device | more' and scroll until I find a device I know, such as my flash drive.

I did this, but there's a lot of info, including a line that says:
udi = '/org/freedesktop/Hal/devices/usb_device_781_5150_20041100600cf0d39226'

What part of that string should I pass to pmount?

Take a look at the pmount options. You can probably do it with "pmount --help". I'm curious though. Is there an accompanying "pmount-hal" program that you should be using instead? Again, I've never used pmount before. The functionality should be similar to gnome-mount though.

quip 05-18-2006 03:42 PM

Yeah, there is an accompanying program called pmount-hal. If I give the command with the device name, i.e. 'pmount-hal /dev/uba1', then it mounts just fine. However, I can't seem to get the udi correct (which pmount-hal can also use); it usually bails out with "Error: given UDI is not a mountable volume".

Also of note: When I do mount it this way, or with plain-old pmount, the device is always mounted under /media instead of /mnt, which means the icon is not generated in KDE's media:/ ioslave. I wonder if there is any way to point KDE (or pmount) to a compatible location.

BTW, thanks for all the help.

zborgerd 05-18-2006 05:55 PM

Quote:

Originally Posted by quip
Yeah, there is an accompanying program called pmount-hal. If I give the command with the device name, i.e. 'pmount-hal /dev/uba1', then it mounts just fine. However, I can't seem to get the udi correct (which pmount-hal can also use); it usually bails out with "Error: given UDI is not a mountable volume".

Also of note: When I do mount it this way, or with plain-old pmount, the device is always mounted under /media instead of /mnt, which means the icon is not generated in KDE's media:/ ioslave. I wonder if there is any way to point KDE (or pmount) to a compatible location.

BTW, thanks for all the help.

One thing that might be an issue is that you are using the kernel's UB block driver, which is buggy and incompatible with the standard USB driver (which is why it's off by default). It used to cause Nautilus to crash and burn on old releases. I'm not sure what it does now to HAL-compatible apps.

You should probably disable CONFIG_BLK_DEV_UB in your kernel, so that your USB devices start getting /dev/sdX device nodes instead of /dev/ubX.

Code:

CONFIG_BLK_DEV_UB:

This driver supports certain USB attached storage devices              such as flash keys.

If you enable this driver, it is recommended to avoid conflicts
with usb-storage by enabling USB_LIBUSUAL.

If unsure, say N.

I can't guarantee that it will fix things, but this is a module that can only complicate things. It's located in the kernel menuconfig under "/Device Drivers/Block Devices".

quip 05-18-2006 09:35 PM

I'll try to give it a shot, although I can't say for sure when, since my wife's due date with our second child is only two weeks away. :D

However, I guess the question that keeps racking my brain is why fstab-sync works with KDE fine, and why I can use pmount and pmount-hal by hand, but pmount won't work with KDE automatically.

Maybe I'm missing the purpose of pmount, but I thought it would create an icon on the desktop when a cd/usb drive/whatever was inserted, and give the prompt that rkelsen described earlier in this thread. The only difference I can see from his post is that he upgraded udev to 0.92, but I didn't think that would matter too much. :scratch:

quip 05-18-2006 10:16 PM

Alright, I told hald to be verbose, and log to syslog, and I found the udi for my flash drive. Pmount-hal can mount it just fine with the udi passed to it. I think what it comes down to is that hal and pmount are using /media, but KDE doesn't seem to recognize anything there; only things in fstab and/or /mnt.

I am about to try a suggestion found here: http://www.linuxpackages.net/forum/v...e0185049768a7c, which is supposed to force pmount to use /mnt instead of /media.

zborgerd 05-18-2006 11:14 PM

Yes indeed. The /media directory is a very important thing to have with the new HAL. You can modify it to use something else, but it actually follows the Linux Filesystem Hierarchy standard there. It literally must exist. At least, that was my experience. Gnome-mount would bomb out if /media wasn't on the FS. HAL wouldn't automatically create it (only creates the mountpoint in that directory).

You should be able to make KDE use /media instead of /mnt. It is the standard on all distributions except for Slackware.

quip 05-18-2006 11:53 PM

Quote:

Originally Posted by zborgerd
You should be able to make KDE use /media instead of /mnt. It is the standard on all distributions except for Slackware.

Any ideas on how to do that? (Make system:/media point to /media)

quip 05-19-2006 09:56 PM

Alright, everything's going well; pmount is working nicely with hal, dbus, and udev and mounting to /media.

The only problem is that KDE won't recognize my usb drive, even when it's mounted. I have selected the option in the control center to show icons for mounted and unmounted removable media, and can mount the pen drive by hand via pmount, but the icon still won't show up. The crazy thing is that my cd writer DOES show up fine. I might open a new thread with this query, with a better subject, and let this one die, since my problem now is off-topic.

zborgerd 05-19-2006 11:47 PM

Quote:

Originally Posted by quip
Alright, everything's going well; pmount is working nicely with hal, dbus, and udev and mounting to /media.

The only problem is that KDE won't recognize my usb drive, even when it's mounted. I have selected the option in the control center to show icons for mounted and unmounted removable media, and can mount the pen drive by hand via pmount, but the icon still won't show up. The crazy thing is that my cd writer DOES show up fine. I might open a new thread with this query, with a better subject, and let this one die, since my problem now is off-topic.

Did you ever try recompiling your kernel without UB support?

quip 05-20-2006 12:52 AM

Quote:

Originally Posted by zborgerd
Did you ever try recompiling your kernel without UB support?

Yes. Now my usb device is recognized and assigned as sda.

However, the same problem persists--KDE will not recognize it unless it is in my fstab, which pmount never touches. There must be some sort of KDE/Hal/usb problem, because my cd writer is picked up and does just fine. I just have had to statically link to it; i.e. I made a link on my Desktop to /dev/sda1, and after I plug in the pendrive, I click it and it mounts via pmount.

I just can't figure out why KDE doesn't handle it the same way it does the optical drive.

:scratch:


All times are GMT -5. The time now is 07:21 AM.