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. ThanksLast 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.
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.
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.
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.
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?
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.
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.
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 ;)
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
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.
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.
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.
Ratings & Comments
14 Comments
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.
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.
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.
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?
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.
...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.
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.
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 ;)
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
I would except the info (file) isn't there. My sda and sdb are scsi discs. Anything else I can try? Phil.
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.
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.
Cool. So maybe scsi disks do not have info files? Do you get one if you plug in a pen drive? Thanks, Chris.
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.