Bug 132281 - Media mounting no longer works without HAL
Summary: Media mounting no longer works without HAL
Status: RESOLVED FIXED
Alias: None
Product: kio
Classification: Unclassified
Component: media (show other bugs)
Version: unspecified
Platform: Slackware Packages Linux
: NOR normal with 288 votes (vote)
Target Milestone: ---
Assignee: Kevin Ottens
URL:
Keywords:
: 132257 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-08-12 00:37 UTC by David Unric
Modified: 2007-03-26 15:06 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Backported coolo patch to KDE 3.5.4 vanilla (3.97 KB, patch)
2006-09-24 19:37 UTC, Georgi Chorbadzhiyski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Unric 2006-08-12 00:37:52 UTC
Version:            (using KDE KDE 3.5.4)
Installed from:    Slackware Packages
OS:                Linux

Until KDE 3.5.4 mounting of devices with media kio-slave did worked without dbus/hal installed and kio_media_mounthelper did used /etc/fstab entries.

Now when I point in Konqueror to my CD-ROM URL (media:/cdrom) error message pop-ups with "Feature available only with HAL" and device is not mounted.

Please fix bug in kio media so devices could be mounted again on systems without HAL.

Thanks in an advance.
Comment 1 Andreas Kling 2006-08-12 07:02:25 UTC
*** Bug 132257 has been marked as a duplicate of this bug. ***
Comment 2 Nechita Marian-Valentin 2006-08-24 07:57:51 UTC
*** This bug has been confirmed by popular vote. ***
Comment 3 Ismael 2006-09-13 05:34:31 UTC
Is this bug being worked on?

This is an annoying bug, mostly because you're still unable to use, i.e, system:/media/hdc to access the cdrom even after it's been mounted manually.

Also, KwikDisk fails with the same error when you try to use it to mount the CDROM.
Comment 4 Stephan Kulow 2006-09-19 13:15:50 UTC
is your cdrom in /etc/fstab ? If so, can you please attach it?
Comment 5 Erich 2006-09-19 17:13:42 UTC
Here's my fstab:

/dev/hda6     swap             swap        defaults           0   0
/dev/hda5     /                ext3        defaults           1   1
/dev/hda3     /boot            ext2        defaults,ro,nodev  1   2
/dev/hda1     /mnt/ntfs        ntfs        ro,dmask=222,fmask=333  0 0
/dev/hda7     /mnt/vfat        vfat        auto,rw,dmask=000,fmask=111 0 0
/dev/hda8     /mnt/slackroot   ext3        defaults           1   2
/dev/cdrom    /mnt/cdrom       iso9660     noauto,user,ro,unhide 0   0
/dev/floppy   /mnt/floppy      auto        noauto,user        0   0
devpts        /dev/pts         devpts      gid=5,mode=620     0   0
proc          /proc            proc        defaults           0   0
none          /sys             sysfs       defaults,noauto    0   0
shm           /dev/shm         tmpfs       defaults,noauto    0   0
/dev/disk/by-id/usb-SanDisk_Cruzer_Mini_SNDK8ABBA4272BE07003-part1  /mnt/usb  vfat  noauto,user  0  0

I have icons on my desktop which I can use to mount and open konqueror, but using media:/ in konqueror I cannot mount or open devices (except hard drives).  I tried mounting my usb stick before opening konqueror, but I could still not access it as media:/usb-SanDisk...  I cannot mount my cdrom using media:/, but after mounting it via the desktop icon sometimes I can then open it as media:/cdrom.  Right clicking the cdrom icon in media:/ will not allow me to unmount it; I must do that via the desktop icon (or of course Konsole).  Mounting the cdrom via Konsole (as user, not root) will not allow me to browse it as media:/cdrom.

Basically, I don't rely on media:/*, but use the desktop icons I created instead.
Comment 6 Georgi Chorbadzhiyski 2006-09-19 18:53:27 UTC
Here is my /etc/fstab. In 3.5.3 mounting DVD using media:/ IO slave was working fine, now after upgrading to 3.5.4 I get the messages "Feature available only with HAL". Slackware-current (11) package here. Kernel 2.6.17.11

/dev/hda1        /                ext3        defaults         1   1
/dev/hda2        swap             swap        defaults         0   0
/dev/hda3        /home            ext3        defaults         1   2
/dev/hdc         /mnt/dvd         auto        noauto,user,ro   0   0
devpts           /dev/pts         devpts      gid=5,mode=620   0   0
proc             /proc            proc        defaults         0   0
Comment 8 Rex Dieter 2006-09-19 19:48:52 UTC
This is a double-whammy for RHEL4 users, since kde-3.5.4 dropped support for hal-0.4.2. ):
Comment 9 Stephan Kulow 2006-09-20 10:37:27 UTC
the commit in the mediamanager is harmless. You only notice it because the dcop functions are called that shouldn't be called :)
Comment 10 Stephan Kulow 2006-09-23 15:35:41 UTC
SVN commit 587626 by coolo:

adding a mount function to the fstab backend that can 
be used without hal
BUG: 132281


 M  +23 -0     fstabbackend.cpp  
 M  +4 -0      fstabbackend.h  
 M  +11 -4     mediamanager.cpp  
 M  +2 -0      mediamanager.h  


--- branches/KDE/3.5/kdebase/kioslave/media/mediamanager/fstabbackend.cpp #587625:587626
@@ -37,6 +37,9 @@
 #endif
 
 #include <klocale.h>
+#include <kio/job.h>
+#include <kio/netaccess.h>
+#include <kdebug.h>
 #include <kdirwatch.h>
 #include <kurl.h>
 #include <kmountpoint.h>
@@ -94,6 +97,26 @@
         KDirWatch::self()->removeFile(MTAB);
 }
 
+QString FstabBackend::mount( const QString &_udi )
+{
+    const Medium* medium = m_mediaList.findById(_udi);
+    if (!medium)
+        return i18n("No such medium: %1").arg(_udi);
+    KIO::Job* job = KIO::mount( false, 0, medium->deviceNode(), medium->mountPoint());
+    KIO::NetAccess::synchronousRun( job, 0 );
+    return QString::null;
+}
+
+QString FstabBackend::unmount( const QString &_udi )
+{
+    const Medium* medium = m_mediaList.findById(_udi);
+    if (!medium)
+        return i18n("No such medium: %1").arg(_udi);
+    KIO::Job* job = KIO::unmount( medium->mountPoint(),  false);
+    KIO::NetAccess::synchronousRun( job, 0 );
+    return QString::null;
+}
+
 void FstabBackend::slotDirty(const QString &path)
 {
 	if (path==MTAB)
--- branches/KDE/3.5/kdebase/kioslave/media/mediamanager/fstabbackend.h #587625:587626
@@ -41,6 +41,10 @@
                           const QString &fsType, bool mounted,
                           QString &mimeType, QString &iconName,
 	                  QString &label);
+
+	QString mount(const QString &id);
+	QString unmount(const QString &id);
+
 private slots:
 	void slotDirty(const QString &path);
 	void handleFstabChange(bool allowNotification = true);
--- branches/KDE/3.5/kdebase/kioslave/media/mediamanager/mediamanager.cpp #587625:587626
@@ -77,6 +77,7 @@
 
     mp_removableBackend = 0L;
     m_halbackend = 0L;
+    m_fstabbackend = 0L;
 
 #ifdef COMPILE_HALBACKEND
     if ( MediaManagerSettings::self()->halBackendEnabled() )
@@ -85,7 +86,8 @@
         if (m_halbackend->InitHal())
         {
             m_backends.append( m_halbackend );
-            m_backends.append( new FstabBackend(m_mediaList, true) );
+            m_fstabbackend = new FstabBackend(m_mediaList, true);
+            m_backends.append( m_fstabbackend );
             // No need to load something else...
             m_mediaList.blockSignals(false);
             return;
@@ -108,7 +110,8 @@
     }
 #endif //COMPILE_LINUXCDPOLLING
 
-    m_backends.append( new FstabBackend(m_mediaList) );
+    m_fstabbackend = new FstabBackend(m_mediaList);
+    m_backends.append( m_fstabbackend );
     m_mediaList.blockSignals(false);
 }
 
@@ -206,7 +209,9 @@
         return i18n("Feature only available with HAL");
     return m_halbackend->mount(name);
 #else
-    return i18n("Feature only available with HAL");
+    if ( !m_fstabbackend ) // lying :)
+        return i18n("Feature only available with HAL");
+    return m_fstabbackend->mount( name );
 #endif
 }
 
@@ -217,7 +222,9 @@
         return i18n("Feature only available with HAL");
     return m_halbackend->unmount(name);
 #else
-    return i18n("Feature only available with HAL");
+    if ( !m_fstabbackend ) // lying :)
+        return i18n("Feature only available with HAL");
+    return m_fstabbackend->unmount( name );
 #endif
 }
 
--- branches/KDE/3.5/kdebase/kioslave/media/mediamanager/mediamanager.h #587625:587626
@@ -29,6 +29,7 @@
 #include "mediadirnotify.h"
 
 class HALBackend;
+class FstabBackend;
 
 class MediaManager : public KDEDModule
 {
@@ -83,6 +84,7 @@
 	RemovableBackend *mp_removableBackend;
 	HALBackend *m_halbackend;
 	MediaDirNotify m_dirNotify;
+	FstabBackend *m_fstabbackend;
 };
 
 #endif
Comment 11 Georgi Chorbadzhiyski 2006-09-24 19:37:41 UTC
Created attachment 17898 [details]
Backported coolo patch to KDE 3.5.4 vanilla

With coolo's media mounting problems are solved. Just apply the patch do KDE
kdebase 3.54 and rebuild the slackware package.

Thank you guys.
Comment 12 Erich 2006-09-25 00:42:10 UTC
I added the patch and built kdebase using Pat's slackbuild.

Sometimes it fully works and somtimes it only partially works, as described below.  I haven't determined under what conditions it works and when it doesn't.

Using media:/ I can right click on icons and mount/unmount media (cdrom, usb drives).  I verified each time by 'cat /etc/mtab'.  However, after clicking on the icon it won't show the contents.  Also, typing media:/cdrom in konqueror will mount the cdrom, but won't show the contents of the cd.

Comment 13 Thanos Kyritsis 2006-09-28 10:53:27 UTC
I confirm Comment #12, please reopen the bug. It still doesn't behave like it used to before KDE 3.5.4 w/o HAL.
Comment 14 Ismael 2006-09-30 21:23:57 UTC
Indeed, if I mount a CD and then umount it (via right-click -> unmount), and then mount it again, the CD filesystem will get mounted (as reported by "mount"), but you will be unable to see the contents via system:/media/hdc 

The KDE icon at the top right will keep moving as if it were working on something.

The first time you mount it using either Konqueror or KwikDisk it works properly, the problem just appears after you unmount the drive and then mount it again.

That second (or third, or fourth, ...) time KwikDisk does show the proper free space ("[0 B]") of the CD and a mounted CD icon, but it fails to create the Mounted CD Icon on the desktop (which did appear the first time).

Konqueror doesn't seem to realize that the drive has been mounted, at all.
Comment 15 Zeljan Rikalo 2006-10-12 17:02:28 UTC
hm ... strange things happens with 3.5.4 and 3.5.5 ... it looks like same problem like I've described in #135215 . Possible that 135215 (but using supermount) is duplicate. I've also fixed (it works for me ;) ) removable media problem with supermount & kde 3.5.4 in #135139 .

Comment 16 Chris Spencer 2006-10-16 21:52:54 UTC
I'm comfirming Comment #14. That's the exact same problem I'm having. I'm using Slackware Linux 11, with official KDE 3.5.4 packages. The bug is listed as resolved, but it's a little unclear.

Do I need to use a patch? I noticed that all the comments are dated before Slackware 11 was released. Has the status changed in the Slackware 11 official release? Has this issue been resolved in KDE 3.5.5?
Comment 17 Jakob Nylin 2006-12-01 21:27:23 UTC
I have exact the same problem as that described in comment #12, #14 and #16.
Comment 18 PJ Beers 2006-12-04 14:33:06 UTC
Just as Jakob, I have exact the same problem as that described in comment #12, #14 and #16. Could you please reopen this bug? Or else could you please explain why to leave it closed? Regards!
Comment 19 shattered 2007-02-07 20:04:30 UTC
+QString FstabBackend::mount( const QString &_udi )
+{
+    const Medium* medium = m_mediaList.findById(_udi);
+    if (!medium)
+        return i18n("No such medium: %1").arg(_udi);
+    KIO::Job* job = KIO::mount( false, 0, medium->deviceNode(), medium->mountPoint());
+    KIO::NetAccess::synchronousRun( job, 0 );
+    return QString::null;
+}

What if mount fails?  Does this code check for errors at all?
Comment 20 Jean-Marc Chapuzot 2007-03-26 15:06:35 UTC
Like in Comment #12 it works the first time I mounted a CD-ROM. After that when I had unmounted the CD-ROM and try to mount it again the CD will be mounted but not show as mounted !!