The time now is Tue 18 Jun 2013, 03:16
All times are UTC - 4 |
|
Page 1 of 2 [23 Posts] |
Goto page: 1, 2 Next |
| Author |
Message |
2byte
Joined: 09 Oct 2006 Posts: 356
|
Posted: Wed 17 Oct 2007, 10:17 Post subject:
TS3.03ce - USB device manager |
|
This project has been discontinued
As part of the effort to make Puppy more friendly to linux newbs I'm working on a tray program that will detect USB devices as they are plugged in and will offer the user a dialog to take the appropriate action. As a first step, only devices that are listed as "/dev/sd*" are being detected. These would mostly be pendrives.
I sincerely hope that the good people on this forum will take a few minutes to test the program and provide feedback. Also I do not own every type of USB device there is, so I am asking that anyone with a USB device that should be supported to run the commands 'fdisk -l', first without the device inserted, and then after the device is inserted. Then post or PM the device description. Once you have the device description please run the command disktype on the device. For example if the device is /dev/sda1 then run 'disktype /dev/sda1'. Please include the results in your post or PM. Also please include a real world description of the device, ie brand X mp3 player, etc.
To get things started here is a link to the first version and a description of what it does at this point in time. For lack of a better name I'm calling it usbmount for now.
usbmount is a semi-automated drive mounter for USB drives. This version recognizes devices tagged as /dev/sd*. It is designed to run in the background, so it's best to start it up a couple of seconds after the window manager is running.
It runs invisibly until a USB drive is plugged in, then as soon as the system recognizes the drive usbmount will pop up a dialog offering to mount the drive.
An icon will appear in the tray whenever a USB drive is present. The tray icon is compatible with JWM and IceWm (icewmtray must be running), and should work with any window manager that is compatible with eggtrayicon.
Hover the mouse pointer over the tray icon and a list of mounted drives will be displayed.
Clicking the tray icon will bring up a dialog listing all of your USB drives and these may be mounted or unmounted from the dialog.
Attempting to unmount a drive that is in use will be refused and a dialog will be presented with an appropriate message.
Unplugging a mounted drive will bring up a warning dialog with advice, and the drive will be automatically unmounted to forestall system errors.
Pmount, Mut, and commandline mounting of drives do not interfere with usbmount. It recognizes outside changes to drive status and adjusts itself accordingly.
The tray icon has a 2 pixel border that can be colored with a command line argument.
usbmont -b "red"
usbmount -b "#FF0000"
Compiled on Puppy 2.14 with GTK 2.8.17 and gcc.
Thank you for your time,
Vern
Last edited by 2byte on Sat 27 Oct 2007, 00:22; edited 1 time in total
|
|
Back to top
|
|
 |
cb88

Joined: 28 Jan 2007 Posts: 1160 Location: USA
|
Posted: Wed 17 Oct 2007, 10:55 Post subject:
|
|
pdrive already does the auto mount maybe you could look at it and maybe add your ideas to it since it is already really good
the interface is like a cross between grafburn and p-mount(on which it is based) also it has progress bars and does not need to refresh the window like p-mount has to do each time...
here is the link to the tread it is in : http://www.murga-linux.com/puppy/viewtopic.php?t=21200
also you may want to test it out in 3.00 since pdrive was broken in 3.00 due to the gtk upgrade to 2.10.x i guess and many other Upgrades pdrive .11 is fixed already in 3.00
_________________ Taking Puppy Linux to the limit of perfection. meanwhile try "puppy pfix=duct_tape" kernel parem eater.
BeOS Max-Vectorgamma: Tyan thund 2 512 ram 2x PII 300
Vectorsigma (laptop): Gentoo Athlon II X2 2Ghz 4Gb ram radeon 4200 mesa-git
|
|
Back to top
|
|
 |
2byte
Joined: 09 Oct 2006 Posts: 356
|
Posted: Wed 17 Oct 2007, 11:56 Post subject:
|
|
Ecomoney defined the goals for Talking Stick.
| Quote: | # Extremely friendly for Linux newbies.
# Boot up and run extraordinarily fast.
# Have all the applications needed for daily use.
# Will just work, no hassles.
# Will breathe new life into old PCs
Its important to remember, as Puppy Linux Developers, were not developing puppy for our own use . Were developing it for Linux Newbies. Not computer newbies, but people switching from *other* operating systems. |
usbmount is aimed at #1 and #4. It is not a replacement for Pdrive, Mut, Pmount or anything else. Newbies from *other* operating systems expect something to happen when they insert a pendrive, CD, etc. This is the goal for usbmount. It is not for experienced linux users who have no use for such a thing.
Vern
|
|
Back to top
|
|
 |
cb88

Joined: 28 Jan 2007 Posts: 1160 Location: USA
|
Posted: Wed 17 Oct 2007, 12:28 Post subject:
|
|
I think you miss understood me I do think you have a good idea!!
I just think that it should be integrated with pdrive so the first time you plug in a usb drive a window pops up asking if you want to automount all the time or never automount that would only mean a small modification to pdrive so that it shows that option instead of automounting the first time a usb drive is pluged in.
also might be a good idea to never mount the u3 part of a flash drive(if it has one) because it is not used in linux....
I have only mounted a u3 drive once and it had a name like /mnt/sr0 for the u3 part I think i'll see if i can get a hold of it again later
If it doesn't conflict with pdrive's auto mount the that is good but I don't see how it won't can't test it now cause i'm not at home...
also it appears that usbmount is already twice the size of pdrive why?
_________________ Taking Puppy Linux to the limit of perfection. meanwhile try "puppy pfix=duct_tape" kernel parem eater.
BeOS Max-Vectorgamma: Tyan thund 2 512 ram 2x PII 300
Vectorsigma (laptop): Gentoo Athlon II X2 2Ghz 4Gb ram radeon 4200 mesa-git
|
|
Back to top
|
|
 |
zigbert

Joined: 29 Mar 2006 Posts: 5290 Location: Valåmoen, Norway
|
Posted: Wed 17 Oct 2007, 13:57 Post subject:
|
|
Here are the base code of the Pdrive deamon. It all became so tiny, that I felt it was a puppy.
If we only could detect cdroms without using huge cpu resources.......
| Code: | echo -e "`ls -1 /sys/block | grep -E '^scd|^sd|^mmc|^sr'`" > /tmp/pdrive_deamon_old
while [ "$LOOP" != "something" ]; do
echo -e "`ls -1 /sys/block | grep -E '^scd|^sd|^mmc|^sr'`" > /tmp/pdrive_deamon
NEW_DEVICE=`diff -B /tmp/pdrive_deamon_old /tmp/pdrive_deamon | grep ">" | sed -e "s/> //g"`
REMOVED_DEVICE=`diff -B /tmp/pdrive_deamon_old /tmp/pdrive_deamon | grep "<" | sed -e "s/< //g"`
if [ "$NEW_DEVICE" ]; then
...
fi
if [ "$REMOVED_DEVICE" ]; then
..
fi
cp -f /tmp/pdrive_deamon /tmp/pdrive_deamon_old
sleep 2
done |
_________________ Stardust resources
|
|
Back to top
|
|
 |
cb88

Joined: 28 Jan 2007 Posts: 1160 Location: USA
|
Posted: Wed 17 Oct 2007, 23:00 Post subject:
|
|
this is a little bit of a long shot (and i'm not sure my terminology is right ) but could the the cd detecting code be searated out and give a very low nice value that way it has a very low priority... since it probably spends a lot of time just waiting for the drive to respond..
_________________ Taking Puppy Linux to the limit of perfection. meanwhile try "puppy pfix=duct_tape" kernel parem eater.
BeOS Max-Vectorgamma: Tyan thund 2 512 ram 2x PII 300
Vectorsigma (laptop): Gentoo Athlon II X2 2Ghz 4Gb ram radeon 4200 mesa-git
|
|
Back to top
|
|
 |
ecomoney

Joined: 25 Nov 2005 Posts: 2183 Location: Lincolnshire, England
|
Posted: Wed 17 Oct 2007, 23:54 Post subject:
Goals for talking stick |
|
Hi, just to remind you, those wernt just the goals for TS 3.03ce, they are the goals concieved by BarryK in the Puppy Linux Mission Statement.
{rant}
Pmount doesnt work. I can make this bold statement because Ive tested it on "linux newbs" and they didnt have a clue how to use it. It doesnt explain what it does, or have labels and assumes people know the theory of device mounting linux. It is possible even more unfriendly than MUT. Newbies dont know what "mounting" is because they've never had to do it with windows. I have to give them a 10 minute tutorial just so they can read their pendrives, cd's and cameras that used to "just work" and they see it as a disadvantage and an inconvenience.
{/rant}
I was very happy indeed that 2byte dropped me a pm with details of this project. Puppy could be made to be 100 times more successful at achieving its stated and noble aims with very little coding effort. Ive seen this by using it "in the field". With the 2.15ce release and the feature of not presenting the user with a black screen full of writing they didint understand everytime there was a powercut cut down my call-outs/support calls by about half. This should cut them down by half again. It is already a feature in most other distros that dont even have "linux-newbie-friendly" in their aims.
Sorry its late, and Im grumpy, and I cant find my pendrive (Why do they make those things so small!)
_________________ Puppy Linux's Mission
Sorry, my server is down atm!
|
|
Back to top
|
|
 |
cb88

Joined: 28 Jan 2007 Posts: 1160 Location: USA
|
Posted: Thu 18 Oct 2007, 11:18 Post subject:
|
|
pen drives are small because they (the manufacturers) want you to loose them and have to buy new ones cause they take too long to wear out....
I tried out usbmount and it worked (in 3.00) with my pendrive (1gb simpletech) and the taskbar icon is a nice touch it also provides a very familiar usb drive interface...
I still think it should be integrated with pdrive....
_________________ Taking Puppy Linux to the limit of perfection. meanwhile try "puppy pfix=duct_tape" kernel parem eater.
BeOS Max-Vectorgamma: Tyan thund 2 512 ram 2x PII 300
Vectorsigma (laptop): Gentoo Athlon II X2 2Ghz 4Gb ram radeon 4200 mesa-git
|
|
Back to top
|
|
 |
Pizzasgood

Joined: 04 May 2005 Posts: 6270 Location: Knoxville, TN, USA
|
Posted: Thu 18 Oct 2007, 20:28 Post subject:
|
|
| Quote: | | (Why do they make those things so small!) |
While I generally have pockets large enough to hold a full sized harddrive, that doesn't mean doing so would be comfortable. Also, at least from what I've seen, most women tend to wear pants with much smaller and tighter pockets than guys do, which would make carrying a full sized harddrive even more cumbersome for them (though I suppose they could stick one in their purse if they happen to carry one).
I'll test this out later tonight (the USB thing, not my harddrive carrying theories...). I'd do it now, but the last time I tested something immediately, I locked up my computer while I still had about twelve unread tabs in Firefox (thank goodness for "restore session").
_________________ Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib

|
|
Back to top
|
|
 |
JB4x4
Joined: 30 Jul 2006 Posts: 256
|
Posted: Thu 18 Oct 2007, 21:28 Post subject:
|
|
2byte - Thank you for your time with this project. I too spend a lot of time explaining mount / unmount. I tried out your program, here's what I got. Mounted an external usb hard drive, worked, sda1. Mounted a flash key, worked, sdb2. Tried to unmount external hd, usbmount died, and I got the following error...
USER PID ACCESS COMMAND
/dev/sda1: root F.... ntfs-3g
Segmentation fault
Both drives were left mounted. I forgot to mention above that the external has an ntfs formated hd in it. On the plus side just using the usb key worked fine.
P.S. My Nikon 3200 camera also worked (justed tested by itself)
|
|
Back to top
|
|
 |
Pizzasgood

Joined: 04 May 2005 Posts: 6270 Location: Knoxville, TN, USA
|
Posted: Thu 18 Oct 2007, 23:22 Post subject:
|
|
I get a segmentation fault as soon as I try running it, in both Puppy 2.14 and 3.00.
One thing I've been wondering since I read about this though: You detect the drives based on sd*. But USB drives aren't the only things that use that designation. My internal SATA harddrive uses it too. Could that be what's causing the error?
_________________ Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib

|
|
Back to top
|
|
 |
Lobster
Official Crustacean

Joined: 04 May 2005 Posts: 15109 Location: Paradox Realm
|
Posted: Fri 19 Oct 2007, 02:22 Post subject:
|
|
| Quote: | | Newbies don't know what "mounting" is because they've never had to do it with windows. |
Give us the 10 minute lecture / explanation
I don't get it
One of the most frustrating things I experienced with Knoppix (most Linux do this) is a locked CD, that could only be opened from software
On a desktop Linux if a device is on my computer I want access to it
I do not want to mount it it, password circumvent it or contact the Linus Torvalds SU team . . .
It I am a tinfoil geek I may want to turn off deamons and only allow access to my USB drive under bizarre circumstances involving blowfish encryption . . .
Robert keep using your test group of unreasonable real world users
Would some reasonable person like to Put the TS spec together for the wiki?
I will go make a start
http://puppylinux.org/wikka/TalkingStickSpec
May the Force be with us
_________________ Puppy WIKI
Last edited by Lobster on Sun 25 Nov 2007, 13:28; edited 1 time in total
|
|
Back to top
|
|
 |
2byte
Joined: 09 Oct 2006 Posts: 356
|
Posted: Fri 19 Oct 2007, 10:14 Post subject:
|
|
JB4x4 and Pizzasgood, thanks for the feedback. Very helpful reports. This is exactly what I need to establish a baseline for the device detection methods (not to mention my program logic). Even the segmentation fault reports are helpful.
JB4x4, was anything accessing your external usb hard drive at the time of the fault, like Rox or anything? I ask because the output you reported is from the command 'fuser -v -m /dev/sda1' and it should have triggered a 'device is busy' dialog.
Pizzasgood, was there any console output before it died on you? Would you run the command fdisk -l and tell me what that output is please?
Again, thanks for the feedback. This project will never get off the ground without this kind of help.
Vern
|
|
Back to top
|
|
 |
Pizzasgood

Joined: 04 May 2005 Posts: 6270 Location: Knoxville, TN, USA
|
Posted: Fri 19 Oct 2007, 15:19 Post subject:
|
|
Nothing that means anything, just a complaint about the locale:
| Code: | sh-3.00# ./usbmount
(usbmount:24916): Gtk-WARNING **: Locale not supported by C library.
Using the fallback 'C' locale.
Segmentation fault |
That was in Pizzapup, which was based on Puppy 2.14. I've installed a whole mess of stuff in that save-file though, which I think is where the locale issue comes from. But it doesn't matter, nearly every app displays that now.
In Puppy 3.00 (with a clean pup-save), I don't think it had the locale error. I'll double-check later today if I have time before I have to leave.
| Code: | sh-3.00# fdisk -l
Disk /dev/sda: 164.6 GB, 164696555520 bytes
255 heads, 63 sectors/track, 20023 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 4980 40001818+ 7 HPFS/NTFS
/dev/sda2 4981 5042 498015 82 Linux swap / Solaris
/dev/sda3 5043 13511 68027242+ 5 Extended
/dev/sda4 13512 20023 52307640 83 Linux
/dev/sda5 5043 10955 47496141 83 Linux
/dev/sda6 10956 11079 995998+ c W95 FAT32 (LBA)
/dev/sda7 11080 13511 19535008+ 83 Linux |
EDIT: That's without a usb drive plugged in. Just so it's clear. /dev/sda is my sata drive.
_________________ Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib

Last edited by Pizzasgood on Sun 21 Oct 2007, 00:24; edited 1 time in total
|
|
Back to top
|
|
 |
cb88

Joined: 28 Jan 2007 Posts: 1160 Location: USA
|
Posted: Sat 20 Oct 2007, 16:07 Post subject:
|
|
that is with my flash drive (currently sde1 it changes) and an sd card pluged in (currently sdc1)
the sd card takes longer to mount and is only detected if I run pdrive or i refresh prive (or mut or pmount)
| Code: | # fdisk -l
Disk /dev/hdb: 82.3 GB, 82348277760 bytes
255 heads, 63 sectors/track, 10011 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hdb1 * 266 3834 28667992+ 7 HPFS/NTFS
/dev/hdb2 1 265 2128581 12 Compaq diagnostics
/dev/hdb3 3835 6392 20547135 5 Extended
/dev/hdb4 6393 10011 29069617+ b W95 FAT32
/dev/hdb5 4219 4600 3068415 83 Linux
/dev/hdb6 4601 5446 6795463+ 83 Linux
/dev/hdb7 5447 6392 7598713+ 83 Linux
/dev/hdb8 3835 4218 3084417 b W95 FAT32
Partition table entries are not in disk order
Disk /dev/sdc: 1015 MB, 1015808000 bytes
5 heads, 4 sectors/track, 99200 cylinders
Units = cylinders of 20 * 512 = 10240 bytes
Device Boot Start End Blocks Id System
/dev/sdc1 13 99200 991875+ 6 FAT16
Disk /dev/sde: 1043 MB, 1043333120 bytes
216 heads, 24 sectors/track, 393 cylinders
Units = cylinders of 5184 * 512 = 2654208 bytes
Device Boot Start End Blocks Id System
/dev/sde1 * 1 394 1018863+ 12 Compaq diagnostics
Partition 1 has different physical/logical beginnings (non-Linux?):
phys=(0, 0, 33) logical=(0, 1, 9)
Partition 1 has different physical/logical endings:
phys=(125, 215, 24) logical=(393, 18, 15)
#
|
_________________ Taking Puppy Linux to the limit of perfection. meanwhile try "puppy pfix=duct_tape" kernel parem eater.
BeOS Max-Vectorgamma: Tyan thund 2 512 ram 2x PII 300
Vectorsigma (laptop): Gentoo Athlon II X2 2Ghz 4Gb ram radeon 4200 mesa-git
|
|
Back to top
|
|
 |
|
|
Page 1 of 2 [23 Posts] |
Goto page: 1, 2 Next |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|