←  [EN] Enduser support

Forums

»

SimpleUmount extension plugin

ambrosa's Photo ambrosa 12 Nov 2011

From my post http://openpli.org/f...ive-mounted-rw/

I realize that every USB mass storage device (HDD or FlashDisk) inserted after E2 is up and running are mounted RW (ReadWrite).
I've made a simple E2 extension (I've called SimpleUmount) to provide a simple way to umount one device simple pressing remote control blue button and select SimpleUmount from extensions list.

- Download the file attached here
- Put it in STB / directory
- cd /
- tar xvzf SimpleUmount-x.xx.tgz
- restart Enigma2


Press on remote control the BLUE key and select SimpleUmount


Feedback and bug report are welcome.
If it will work fine, I will add multilanguage support.

In this new version 0.03 I've added confirm message, warning message if device cannot be umounted (because "busy") and auto reload device list after umount.
Quote

ambrosa's Photo ambrosa 12 Nov 2011

Rel. 0.04
Added multilanguage support.
Addes English and Italian translation

Next step create IPK archive ^_^
Quote

Gennar1's Photo Gennar1 12 Nov 2011

Really nice work, works perfectly on my ET9000. I plugged in and then umounted/unplugged my external drive many times, and it was always umounted properly and then recognized again after reconnection.

The only drawback I see is that an inexperienced user may get confused if the internal drive is shown in the list together with the external ones. If you find a way to detect if a drive is internal or external, then you could add a setting like "hide internal drive" active by default. In this way experienced users could still umount their internal drive if they wish, while inexperienced users will have an easier life ;)
Edited by Gennar1, 12 November 2011 - 18:19.
Quote

pieterg's Photo pieterg 12 Nov 2011

you could check the 'removable' flag
Quote

ambrosa's Photo ambrosa 12 Nov 2011

@gennar1 : you are right. Thanks for idea

@pieterg: /sys/block/sd?/removable Great ! Tomorrow I add your suggestion in my code.
Quote

ambrosa's Photo ambrosa 13 Nov 2011

Done. Added "removable" check and config option about show only removable devices

This is my GitHub repo: https://github.com/a...in-SimpleUmount
Quote

ambrosa's Photo ambrosa 13 Nov 2011

Please, don't use 0.05 : bug just discovered. Sorry. Wait 0.06
Quote

ambrosa's Photo ambrosa 13 Nov 2011

Ok new release 0.06 works fine
https://github.com/a...in-SimpleUmount

Enjoy

If someone has translation, let me know please: I will add in package
Quote

Frogman's Photo Frogman 13 Nov 2011

i give you a first german translation :)

Attached Files

Quote

daddelfalk's Photo daddelfalk 13 Nov 2011

Hi,

maybe umount procedure is just a tiny bit of a more complex Devicemanager Plugin as seen in here:

http://www.newnigma2...65606#post65606

Just my two cents on this ;)

Quote

Dimitrij's Photo Dimitrij 13 Nov 2011

-Russian language
Quote

ambrosa's Photo ambrosa 13 Nov 2011

Thanks people for DE and RU translation.

This is the updated version with RU and DE languages
Quote

ambrosa's Photo ambrosa 13 Nov 2011

Hi,

maybe umount procedure is just a tiny bit of a more complex Devicemanager Plugin as seen in here:

http://www.newnigma2...65606#post65606

Just my two cents on this ;)


Yes. In many images there is something like you suggest.
But I've not found something similar as above in OpenPLI

So I've start to code my plugin. I believe it's simple and fast.
But if anyone what use a more complete DeviceManager ... yes he can ! :D
Edited by ambrosa, 13 November 2011 - 11:47.
Quote

Gennar1's Photo Gennar1 13 Nov 2011

The hiding of removable devices works fine, but my USB 2TB Verbatim drive is marked as "not removable" so it is still shown together with the internal drive:

root@et9x00:~# cat /sys/block/sdb/removable
0

Any idea?
Quote

ambrosa's Photo ambrosa 13 Nov 2011

The hiding of removable devices works fine, but my USB 2TB Verbatim drive is marked as "not removable" so it is still shown together with the internal drive:

root@et9x00:~# cat /sys/block/sdb/removable
0

Any idea?


Mmhhhhh which type of filesystem ?

I've tried with:
- USB stick ext2
- USB stick vfat
- USB HDD 2.5" NTFS
all these are marked as 'removable' (= 1)

My internal SATA ext4 is marked (obviously) as not removable (= 0)

Your HDD is externally powered (I think 2TB USB HDD 2.5" doesn't exist .....) ? This can make difference ?

Too big ?
Quote

Gennar1's Photo Gennar1 13 Nov 2011

Yes, it's externally powered. Moreover it has an USB 3.0 interface. Tomorrow I will check with other drives to see if it's an isolated issue. Anyway, it's not an issue of your plugin, which is working perfectly fine.
Quote

ambrosa's Photo ambrosa 14 Nov 2011

Try inserting it in a Linux PC and test
/sys/block/sdb/removable


I think that there will be no differences with CT9x00 but test this can be a nice idea. Just to compare different architectures.
Quote

Gennar1's Photo Gennar1 14 Nov 2011

In fact it's the same even under Ubuntu. Also I tested a few more devices: another big external drive (USB 2.0 this time) shows the same behaviour, while small USB flash drives are correctly marked as removable.
Probably the problem is that those big external drives are just normal 3.5" SATA desktop disks into an USB enclosure, so they are probably detected by the kernel as not removable drives.

No big deal anyway, your plugin works fine.
Quote

Graffy's Photo Graffy 14 Nov 2011

Great job @ambrosa !

One suggestion :
<widget name="wdg_label_legend_2" position="140,60" size="170,30" font="Regular;20" />

Polish translation :

Attached Files

  • Attached File  pl.zip   2.13KB   3 downloads
Quote

ambrosa's Photo ambrosa 14 Nov 2011

I attach here new version 0.08

- completely rewritten mount point parsing code. A user (MiLo) report me crash.
Now I don't use anymore unrealiable 'os.popen' but much safer Console.ePopen() and read /proc/mounts file

- added Polish translation (Thanks Graffy)


GitHub : https://github.com/a...in-SimpleUmount

Attached Files

Quote