Problems with built-in "Most Recent Device" app

Duncan 1i5t5.duncan at cox.net
Thu Mar 14 04:05:49 GMT 2024


Richard Troy posted on Wed, 13 Mar 2024 16:06:04 -0700 (PDT) as excerpted:

[So I do know what this is and have defanged it here, but what you say 
below is so dramatic yet on-point (suffice it to say I agree), I just 
gotta quote the entire thing before replying. =:^) ]

> I confess I don't have a clue what to properly call this bit of KDE. I
> never asked for it, it's nothing I configured, it's just a part of my
> "menu bar". It has the icon of the tip of a USB cable, and when hovered
> over it says "Most Recent Device". When I select it, It says: "Disks &
> Devices".
> 
> Maybe not knowing what to call it is the problem; I haven't a CLUE where
> to get good information on it.
> 
> This thing is FRIGHTENING.
> 
> How about the "remove all" option? It offers, for another example, to
> reformat, at the click of a mouse, my system's /var and /tmp - I guess
> the author of the code never imagined people would be separately
> mounting those - and seems to propose that virtually 100% of the mounted
> hard drives are temporary and cheerfully offers, do I want to unmount
> them? Or maybe I want to reformat my 60 TERABYTES of hard drives? Surely
> THAT'S a good thing to have so readily at hand...  and... and... and....
> 
> I could go on and on about all the TRULY frightening things it says.
> 
> But maybe I'm just not bold enough? Maybe I should pick "remove all?!"
> In my own head I'm thinking "what kind of idiot would remove ALL the
> drives from a booted system?!" but maybe the meaning is that it would
> remove all the devices from ITS TRYING TO MANAGE THEM?! Well? Maybe?
> I've just never been bold - or, in my own head, STUPID enough to try it.
> 
> I've just ignored it, mostly, of course, only deigning to waste my time
> now and then to see if MAYBE THIS TIME it will help me rather than hurt.
> 
> So far, best I can figure, it blocks me from doing ANYTHING with a USB
> device.
> 
> It DOES NOT help me with my cell phone - oh, it sees it's a unisoc
> device and all - but when I try mounting it doesn't appear to do a
> damned thing and continues to offer mounting as an option and when I try
> one of the two open in a file browser choices (one does nothing at all)
> it reports an error from "KIOExec": Malformed URL
> mtp:udi=/org/kde/solid/udev/sys/devices/
pci0000:00/0000:00:01.2/0000:01:00.0/0000:02:08.0/0000:06:00.3/usb3/3-3/.
> 
> Not that I have the slightest clue what I can do with that
> "information."
> 
> NEVER have I been able to get it to do anything useful.
> 
> Now what's prompting me to write this, is the frustration of trying for
> the uncountable-th time and it won't even help me get to a simple USB
> "memory stick." ...I just went through a half-hour session with the
> damned thing trying to get it to mount this memory stick so I can get
> some files off it.
> 
> So far as I can tell, it must be a well-intended, just horribly
> misguided bit of software. And, I don't need it. The only way I've not
> just ditched KDE entirely over the matter in deep and profound
> frustration is because I run a small data center and just go to one of
> the no-desktop systems and do what I need there. I can mount USB devices
> just fine by hand. So, like I said, I don't need this. And I'm pretty
> sure it's the reason I can't just do these mounts from the root account
> by hand - it somehow owns everything, though I don't have a fresh
> example to share at the moment.
> And, honestly, this is embarrassing if I have someone visit me at my
> desk with a memory stick for me to load up.
> 
> Can someone please either tell me where I can get full directions on how
> to USE the damned thing productively or remove it entirely from my
> system?
> I'd be OK with disabling it but somehow that gives me creepy feelings
> like The Creature From Jekyll Island that's going to come back and bite
> me someday. So far as I've seen it's never done a damned thing for me
> but has wasted a LOT of my time.

OK, so the subsystem in general is called solid, with the solid package 
actually one of the base kde frameworks that's a dependency of multiple 
plasma desktop components, several kde gear apps, and the base kio (kde 
input/output) framework as well, so good luck trying to remove it entirely 
(tho it CAN be defanged!) without killing the plasma desktop in the 
process.

FWIW, the description of the solid package here on gentoo (which I believe 
follows upstream kde) is:

Provider for platform independent hardware discovery, abstraction and 
management

As for disabling/defanging it, I'd be irresponsible not to warn ahead of 
time on the solution I chose, as while it works for me on Gentoo, it's not 
an entirely supported by the gentoo/kde team solution, and most binary 
distros are likely to take an even dimmer view of such manipulations 
(gentoo provides the means but says you're on your own if you shoot your 
own foot off... others may make it more difficult).  In any case you're 
likely to be on-your-own to /some/ degree...

Some less drastic alternatives are discussed below the solution I used, if 
you consider mine /too/ drastic.

That said, at the same time, you appear to know how to use the CLI and 
(like me) in fact be more comfortable at the CLI for stuff like mounting 
and the like than you are with this GUI thing trying to do it.  (In fact, 
I at least don't entirely trust the GUI for things like that... for all 
the reasons you so well described above as well as some others including 
the whole policykit thing, which I don't have installed at all BTW, but 
AFAIK it's not necessary to kill policykit to defang solid.)

So on to my defanging, should you be willing to try it after the above 
warning...

The key for me was realizing that solid's critical dependency for working 
with "disks" (so mounting and the like) at least, is the udisks package. 
udisks in turn is actually a shell-script that solid invokes at runtime -- 
so it is not and cannot be an actual binary-code library dependency that 
has to be there for the invoking executable (from the packages depending 
on solid) to load and run at all -- it's a runtime-only command-invoked 
dependency.  As such, I figured (correctly, it turned out) that there was 
a very good chance solid's udisks invoking was fault-tolerant to the 
udisks scripts not actually being available at all! 

Therefore, defanging solid for me involved providing a "fake" udisks 
package to fill the dependency from the package manager perspective, but 
that didn't actually install anything.

The details in that regard will necessarily differ per-distro, but on 
gentoo it's a pretty straightforward and simple process to provide a 
"fake" empty package in one's personal overlay to override the distro-
provided version, assuming its functionality isn't actually required, as 
was the case here.

In other distros where faking a package is more complex, achieving the 
same effect should be possible by simply deleting the udisks shell-script, 
or moving it off-path so you can still run it manually if desired but it 
can't be invoked from things that don't know where you put it.  Of course 
you will then need to figure out what to do if the udisks package gets 
reinstalled or updated, thus replacing the on-path script you moved/
deleted.  If that's unlikely you might just deal with it if/when it 
happens.  If (as on a rolling distro such as gentoo) it's at least 
somewhat likely, you might want to, say, automate things by running an on-
boot script that searches for and (re)moves the on-path script if found.

Of course before doing anything so drastic you should query your package-
manager for anything else depending on udisks and consider the effects on 
those packages too, if any.  In my case solid was the only such package, 
tho fwup has an optional udisks dependency that doesn't apply in my case 
(something EUFI related...).

As for safer and less drastic alternatives:

The simplest and least drastic would be to simply remove the Disk and 
Devices widget/plasmoid from your panel (aka "menu bar").  You should be 
able to right-click on the panel (you may need to right-click around a bit 
and/or find an empty place to right-click to get a menu with that option) 
and select "show panel configuration".  Hovering over the plasmoid/widget 
in question should then give you the remove option.  If you decide you 
need it again, select add widgets, find it in the add-widgets popup, and 
drag it to the desired location on the panel or desktop.

That would leave the solid functionality working in other places including 
dolphin, so it's not entirely defanged, but that's the least intrusive 
option.  Tho from your post I gather that might not be enough for you...

There's also the related configuration in plasma systemsettings, and 
depending on your needs you might find disabling mounts, etc there 
sufficient, at least in combination with the plasmoid removal above.  Note 
that I'm running kde/plasma6 here and the path to it in systemsettings is 
different than it was in kde/plasma5, but on plasma6 anyway, system 
settings > connected devices > disks and cameras.  Under that there's two 
options pages available (I don't have cameras attached so don't know if 
that would give me more pages), device actions and device automount.  You 
may wish to review the settings for both of these.  (The automount page is 
basically empty here, no actual devices listed, tho it still has on-login 
and on-attach checkboxes, unchecked of course, for "all known devices".  
The device actions page has a couple each dolphin and gwenview actions 
listed, but if I ever used them it must have been back in the early kde4/
plasma4 era.  Whether they'd actually work now or even show up in dolphin, 
etc, without polkit and udisks I don't know, but looking at the commands 
they invoke and conditions for them to appear, I doubt it.)

-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman



More information about the kde mailing list