WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Alternate mount tool  (Read 7103 times)

Offline althalus

  • Sr. Member
  • ****
  • Posts: 351
Alternate mount tool
« on: April 28, 2010, 01:15:55 AM »
Hey guys,

I've made a small modification (it makes the mnt tool more useful to me, at any rate) to the mnttool command, and thought I might as well share it with the rest of the community. All devices are visible at once, allowing for one click to mount or unmount a drive, rather than having to click through the list.

I ditched the FL file, since fluid doesn't really seem designed for interfaces which more or less build themselves, but the code is based on TinyCore's original mount tool. compiled mnttool and source code are in the attached binary. it would be nice to see something along these lines in the next TC release for the mnttool.


I compiled the cxx file using "fltk-config --compile mnttool.cxx".
Compile with "g++ -Os -fno-exceptions -fno-rtti -lfltk -o mnttool mnttool.cxx"
I'm curious as to how the TC team got the filesize for the mnttool down to 8K... Mine is still 150KB after being stripped...
EDIT: Recompiled on clean boot (base norestore) brings the size down to 9K, so the bloat must be caused by having something installed that shouldn't be there when aiming for tiny apps... (attached file has been updated to include the smaller binary)
« Last Edit: April 28, 2010, 02:30:10 AM by althalus »

Offline jur

  • Hero Member
  • *****
  • Posts: 863
    • cycling photo essays
Re: Alternate mount tool
« Reply #1 on: April 30, 2010, 05:17:48 AM »
I like it!

(Now to add auto-mounting of ntfs volumes...)

Offline sandras

  • Jr. Member
  • **
  • Posts: 53
Re: Alternate mount tool
« Reply #2 on: April 30, 2010, 05:59:04 AM »
+1

looks much nicer. this is, I think the optimal point between size and usability/interface design. looks matter.

Offline frimical

  • Jr. Member
  • **
  • Posts: 75
Re: Alternate mount tool
« Reply #3 on: April 30, 2010, 06:21:27 AM »
hello,


I think one button is sufficient for all three needs :
- show a label,
- reflect a status info and
- provide action.

this will reduce the size of the dialog too.

good job


Offline OldAdamUser2

  • Full Member
  • ***
  • Posts: 199
Re: Alternate mount tool
« Reply #4 on: April 30, 2010, 08:01:13 AM »
well done!

Offline althalus

  • Sr. Member
  • ****
  • Posts: 351
Re: Alternate mount tool
« Reply #5 on: April 30, 2010, 10:06:34 PM »
Thanks guys, glad it's useful for others.

hello,


I think one button is sufficient for all three needs :
- show a label,
- reflect a status info and
- provide action.

this will reduce the size of the dialog too.

good job
Not sure if I follow, but that doesn't sound quite as user friendly. The current layout is perfect for my requirements. With regard to the size of the dialog, as far as I'm concerned, the only point at which it is too large would be if you happened to have more than 20 or so mountable partitions.

EDIT: Maybe I do see what you mean. Will tinker, and see what I can come up with.
« Last Edit: April 30, 2010, 10:09:55 PM by althalus »

Offline althalus

  • Sr. Member
  • ****
  • Posts: 351
Re: Alternate mount tool
« Reply #6 on: April 30, 2010, 10:33:26 PM »
And now it's a bit smaller. Uses a light button now, button label is the device (sda[1-9] etc), and the button's light indicates mounted or unmounted as lit or unlit. I'll leave this and the previous version, people can pick which visual layout they prefer.

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: Alternate mount tool
« Reply #7 on: April 30, 2010, 11:54:08 PM »
I don't know if you plan to address this, but any external change of the mount-status does not get reflected in your tool.

Lets do the following little test:
(1) Assuming the device in question (e.g. '/dev/hdc') is not mounted.
(2) Start your tool, and it will show 'hdc' with an inactive (i.e. gray) button.
(3) Now lets be a spoilsport and do mount /dev/hdc (obviously via the command line). The button remains grey.
(4) Now attempt to mount 'dev/hdc' via your tool, and you'll get an error message like mount: mounting /dev/hdc on /mnt/hdc failed: Device or resource busy and the button still remains gray (instead of getting updated to yellow). Furthermore you then can't un-mount with your tool, since it insists on the wrong status (as it has not updated itself correctly).

To a degree this behavior is the same with the "original" mnttool, but if you cycle through the devices (providing one has more than one available to be mounted) it will (eventually) update itself to the correct current status and therefore becomes useful again.

Offline althalus

  • Sr. Member
  • ****
  • Posts: 351
Re: Alternate mount tool
« Reply #8 on: May 01, 2010, 02:35:07 AM »
I don't know if you plan to address this, but any external change of the mount-status does not get reflected in your tool.

Lets do the following little test:
(1) Assuming the device in question (e.g. '/dev/hdc') is not mounted.
(2) Start your tool, and it will show 'hdc' with an inactive (i.e. gray) button.
(3) Now lets be a spoilsport and do mount /dev/hdc (obviously via the command line). The button remains grey.
(4) Now attempt to mount 'dev/hdc' via your tool, and you'll get an error message like mount: mounting /dev/hdc on /mnt/hdc failed: Device or resource busy and the button still remains gray (instead of getting updated to yellow). Furthermore you then can't un-mount with your tool, since it insists on the wrong status (as it has not updated itself correctly).

To a degree this behavior is the same with the "original" mnttool, but if you cycle through the devices (providing one has more than one available to be mounted) it will (eventually) update itself to the correct current status and therefore becomes useful again.

I typically only have the window open long enough to mount something, then close it, so I wasn't aware of that, though it makes sense. The original tool developed by roberts refreshes the list when you cycle through to the end. I'll consider ways I can address that.

Offline althalus

  • Sr. Member
  • ****
  • Posts: 351
Re: Alternate mount tool
« Reply #9 on: May 01, 2010, 04:53:09 AM »
Now with refresh button. I dislike apps that poll, and I assume that any user who can use the command line to mount a drive is smart enough to realise they should probably click refresh after doing so.

Offline Onyarian

  • Sr. Member
  • ****
  • Posts: 337
Re: Alternate mount tool
« Reply #10 on: May 01, 2010, 05:01:49 AM »
In the second version of mnttool the buttons are to small to reflect my drives, because I have in my AAO two SD readers: mmcblk0p1 and mmcblk1p1. The last letter is out of the button.

In the first version is OK.


Edit: the last three version has the same issue as the second!
« Last Edit: May 01, 2010, 05:04:11 AM by Onyarian »

Offline althalus

  • Sr. Member
  • ****
  • Posts: 351
Re: Alternate mount tool
« Reply #11 on: May 01, 2010, 05:30:59 AM »
In the second version of mnttool the buttons are to small to reflect my drives, because I have in my AAO two SD readers: mmcblk0p1 and mmcblk1p1. The last letter is out of the button.

In the first version is OK.


Edit: the last three version has the same issue as the second!


Hmm, next version will have longer buttons.