Source i (link to git-repo or to original if based on someone elses unmodified work):

Add the source-code for this project on opencode.net

0
Become a Fan
5.0

Available as/for:
Description:
This patch creates a pen drive device for kde. It will work best for distros that automount and create fstab entries on the fly, like mandrake.

It applies against kdebase-3.3.2, should work with 3.3.0 and 3.3.1.

Extract the patch, then place the file in kdebase-3.3.*/kioslave.
Run:
patch -p0 < patch
in the same directory. then go back to kdebase directory and run
./configure --prefix='kde-config --prefix'
You must do this even if its already been configured.
After its configured, go to kioslave/devices and run make
After its done, run su, and make install.

Restart KDE, right click on the desktop and go to configure desktop. go to behaviour, device icons, and tick off Mounted Pen Drive.

Now, if there is a /dev/sd** in the fstab, a Pen Drive Icon appears on the desktop.
In Mandrake at least, that means you can plug in a pen drive and the icon appears on the desktop, and it dissappears when the drive is removed.

If anyone out there has scsi discs or ipods or mp3 players can you please give me the output of cat /sys/block/sda/device/info (provided the device is sda)
So I can know how to tell appart a disc from the pen drive.
Thanks
Last changelog:

1.1.1 - Fixed Pen Drive not appearing. Whoops!

1.1 - Fixed a bug in the Makefile which caused hard drives to lose their mimetype.

1.1.1 - Fixed Pen Drive not appearing. Whoops!


Ratings & Comments

14 Comments

fzied

Hello, Hi hav a S-ATA disk, a multi-head media reader and a USB flash disk cat /sys/block/*/device/type gave the following : ST3160023AS (sda) USB SD Reader (sdb) USB CF Reader (sdb) USB SM Reader (sdd) USB MS Reader (sde) USB Flash Disk (sdf --> my flash disk) Hope it helps.

Savage650

Note thate in recent 2.6 kernels, USB storage devices are mapped to the "ub" driver (instead of usb-storage), meaning they show up as /dev/ub?? instead of /dev/sd??. Apart from that, you cant just add any "newly-discovered" storage device to the desktop of (every) random user. One could try to find the session belonging to "the" console user, but what about multiheaded boxes? Ideally, each user would have a set of private mountpoints (~/.mydev/xxx where ~/mydev is chmod 700) and the system should actively prohibit mounting "private" storage devices anywhere else. Most of this would be doable with mount-by-label/-by-uuid if the devices were formatted with a "linux-native" FS. Unfortunately, most users will need to use their pen drives on foreign (read: Microsoft) computers too, leaving us with (V)FAT for the FS. As a userland workaround, one could store ownership and preferred mountpoint(s) in (hidden,signed,encrypted) files in the drive's root directory, but such entries would still be nothing more than "suggestions" for cooperating systems.

yoalieh

Hey, don't be dissappointed, but with the new media:/ kioslave in kde 3.4, this is done using HAL... thought incomplete, it's easier to add a new device type by writing a .desktop file. Anyway, thought being a bit.. primitive (I've done this to add my kdebluetooth devices), it's useful for those not having multiple scsi devices.

Superstoned

get this in KDE get this in KDE get this in KDE get this in KDE get this in KDE get this in KDE get this in KDE get this in KDE get this in KDE get this in KDE get this in KDE get this in KDE get this in KDE get this in KDE get this in KDE get this in KDE get this in KDE get this in KDE get this in KDE get this in KDE get this in KDE get this in KDE get this in KDE get this in KDE get this in KDE please please?

cmf

No, really, it's a nice workaround, but what KDE really needs is real HAL intergration, otherwise we just get pendrive devices for iPod's SCSI drives and any usb mass storage devices, which doesn't really work usability-wise IMHO.

philr

...I already have a sda and sdb because I have 2 scsi discs. Won't this pick up my hard drives as pen drives? Is there a way around this? Phil.

cfraz89

Yeah, sorry, at the moment anything scsi will get picked up like that. I'll get that fixed up, in /proc somewhere is a file that should seperate scsi discs from pen drives, I think.

BOSSoNe

to distinct different devices creating sd* nodes i use udev rules so now for my usb pen i don't have no more /dev/sd*1 but /dev/usbkey1 here is the rule: BUS="usb", SYSFS{idVendor}="05dc", SYSFS{idProduct}="0080", NAME="usbkey%n" this trick allow you to have your device always mount in the same mount path (for me /mnt/usbkey and not /mnt/removable*) here's a nice tutorial on how to write udev rules: http://www.reactivated.net/udevrules.php Bye ;)

cfraz89

philr, can you please give me the output of cat /sys/block/sda/device/info and cat /sys/block/sdb/device/info So I can know how to tell appart a disc from the pen drive. Thanks

philr

I would except the info (file) isn't there. My sda and sdb are scsi discs. Anything else I can try? Phil.

cfraz89

So scsi disks do not appear in /sys/block? If you plug in a pen drive, does it appear in /sys/block? If only pen drives appear in /sys/block, I could test for the folder to determine a memory key. Thanks.

philr

No, sys/block etc is there, but in devices there is no info file. [phil@undertaker device]$ ls block detach_state model queue_depth rev state type delete device_blocked power rescan scsi_level timeout vendor [phil@undertaker device]$ pwd /sys/block/sda/device [phil@undertaker device]$ Phil.

cfraz89

Cool. So maybe scsi disks do not have info files? Do you get one if you plug in a pen drive? Thanks, Chris.

philr

No, I don't - first thing I checked. This is on Fedora Core 3, and it's using udev - I'd blame that, it tries to do everything "dynamically" and has caused me problems with my joypad and getting a /dev/cdrom link, amongst other things. Phil.

Pling
0 Affiliates
Details
license
version 1.1.1
updated
added
downloads 24h 0
mediaviews 24h 0
pageviews 24h 0

Other Various KDE 1.-4. Improvements:

Slicker Debian Package for Woody
cirrusgr
last update date: 22 years ago

Score 5.0

Konqueror/kdesktop suggestion
PovMan
last update date: 22 years ago

Score 5.0

Biiig buttons
dbojan
last update date: 20 years ago

Score 5.0

Yet Another KControl
Frans
last update date: 21 years ago

Score 5.0

Next window and next/previos window
dbojan
last update date: 20 years ago

Score 5.0

Fantasie Toolbar
katoe
last update date: 19 years ago

Score 5.0