Jump to content


Photo

SimpleUmount extension plugin

ENIGMA2

  • Please log in to reply
32 replies to this topic

Re: SimpleUmount extension plugin #21 Lukin

  • Senior Member
  • 137 posts

+8
Neutral

Posted 14 November 2011 - 21:27

Thx so much ambrosa for the very useful addition!!!

just installed the latest version and restarted just in case but then i started looking for it everywhere....it didn`t show up with the blue like you mentioned cause i have everything mapped with "multiquickbutton" so i was confused for a bit....just wondering whether it`d be possible to have it show up under Setup /System / Harddisk....with the other options like:

-harddisk setup
-initialization
-filesystem check
-simpleunmount

Thx again!

Re: SimpleUmount extension plugin #22 Dimitrij

  • PLi® Core member
  • 10,037 posts

+339
Excellent

Posted 14 November 2011 - 21:48

- 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

The same error in the plugin HddSleep.
http://openpli.org/f...post__p__221655

GigaBlue UHD Quad 4K /Lunix3-4K/Solo 4K


Re: SimpleUmount extension plugin #23 ambrosa

  • Senior Member
  • 161 posts

+35
Good

Posted 14 November 2011 - 22:06


- 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

The same error in the plugin HddSleep.
http://openpli.org/f...post__p__221655


I've not understood.
Please, can you give me more details ?
STB: Clarke Tech ET9100
Mass storage: internal SATA-II HDD 1TB WD10EACS GreenPower 5400rpm
Mass storage: external USB pen drive 2GB
Firmware: OpenPLi kernel 3.x.x
Tuner A: AVL2108 (DVB-S2) HotBird 13E
Tuner B: AVL2108 (DVB-S2) HotBird 13E
Tuner C: AverMedia A867 (DVB-T HD) (AF9035 + MXL5007T)
TV: plasma PANASONIC GT30 fullHD
Audio: PCM through HDMI (no Dolby decoder)

Re: SimpleUmount extension plugin #24 ambrosa

  • Senior Member
  • 161 posts

+35
Good

Posted 14 November 2011 - 22:07

Thx so much ambrosa for the very useful addition!!!

just installed the latest version and restarted just in case but then i started looking for it everywhere....it didn`t show up with the blue like you mentioned cause i have everything mapped with "multiquickbutton" so i was confused for a bit....just wondering whether it`d be possible to have it show up under Setup /System / Harddisk....with the other options like:

-harddisk setup
-initialization
-filesystem check
-simpleunmount

Thx again!


What is "multiquickbutton" ?
I've never used it...
STB: Clarke Tech ET9100
Mass storage: internal SATA-II HDD 1TB WD10EACS GreenPower 5400rpm
Mass storage: external USB pen drive 2GB
Firmware: OpenPLi kernel 3.x.x
Tuner A: AVL2108 (DVB-S2) HotBird 13E
Tuner B: AVL2108 (DVB-S2) HotBird 13E
Tuner C: AverMedia A867 (DVB-T HD) (AF9035 + MXL5007T)
TV: plasma PANASONIC GT30 fullHD
Audio: PCM through HDMI (no Dolby decoder)

Re: SimpleUmount extension plugin #25 Lukin

  • Senior Member
  • 137 posts

+8
Neutral

Posted 14 November 2011 - 22:21

the plugin that allows the remapping of remote buttons...

Go here for more details:
https://github.com/E...iQuickButton-vu

Re: SimpleUmount extension plugin #26 Dimitrij

  • PLi® Core member
  • 10,037 posts

+339
Excellent

Posted 15 November 2011 - 06:46

I've not understood.
Please, can you give me more details ?

When you call the plug-mounted devices are not found.
HddSleep,plugin.py,line 269:
def getMount(self):
  os.system("mount | sort > %s" % (TEMP))
  tmp = ""
  try:
   fd = open(TEMP, "r")
   if fd:
	for line in fd.readlines():
	 if line.find('/dev/sd') == 0:
	  self.getDisks(line)
	  p = line.find('type ')
	  tmp += line[<img src='http://openpli.org/forums/public/style_emoticons/<#EMO_DIR#>/tongue.png' class='bbc_emoticon' alt=':P' />-1] + "\n"
	self["mounted"].setText("%s" % (tmp))
	fd.close()
	os.system("rm %s" % (TEMP))
  except Exception, e:
   print "[hddsleep] getMount FAIL:", e
os.system("mount | sort > %s" % (TEMP))
At the command,list is = 0.
This occurs through a half-hour of E2.

Edited by Dima73, 15 November 2011 - 06:51.

GigaBlue UHD Quad 4K /Lunix3-4K/Solo 4K


Re: SimpleUmount extension plugin #27 ambrosa

  • Senior Member
  • 161 posts

+35
Good

Posted 15 November 2011 - 11:24

the plugin that allows the remapping of remote buttons...

Go here for more details:
https://github.com/E...iQuickButton-vu


Ok. So you have "remapped" remote control blu button to something else ?

In original mapping pressing BLUE button you get access to Enigma2 Extensions List, and there are many useful Extensions available/installable (ie. Cool Tv, Oscam control, .....)
With your BLUE remapping (bad idea in my opinion) the list is lost ... or not ?
STB: Clarke Tech ET9100
Mass storage: internal SATA-II HDD 1TB WD10EACS GreenPower 5400rpm
Mass storage: external USB pen drive 2GB
Firmware: OpenPLi kernel 3.x.x
Tuner A: AVL2108 (DVB-S2) HotBird 13E
Tuner B: AVL2108 (DVB-S2) HotBird 13E
Tuner C: AverMedia A867 (DVB-T HD) (AF9035 + MXL5007T)
TV: plasma PANASONIC GT30 fullHD
Audio: PCM through HDMI (no Dolby decoder)

Re: SimpleUmount extension plugin #28 ambrosa

  • Senior Member
  • 161 posts

+35
Good

Posted 15 November 2011 - 11:30


I've not understood.
Please, can you give me more details ?

When you call the plug-mounted devices are not found.
HddSleep,plugin.py,line 269:
def getMount(self):
  os.system("mount | sort > %s" % (TEMP))
  tmp = ""
  try:
   fd = open(TEMP, "r")
   if fd:
	for line in fd.readlines():
	 if line.find('/dev/sd') == 0:
	  self.getDisks(line)
	  p = line.find('type ')
	  tmp += line[<img src='http://openpli.org/forums/public/style_emoticons/<#EMO_DIR#>/tongue.png' class='bbc_emoticon' alt=':P' />-1] + "\n"
	self["mounted"].setText("%s" % (tmp))
	fd.close()
	os.system("rm %s" % (TEMP))
  except Exception, e:
   print "[hddsleep] getMount FAIL:", e
os.system("mount | sort > %s" % (TEMP))
At the command,list is = 0.
This occurs through a half-hour of E2.



Accessing to system function using original Python os.system() or os.popen() (or else) can be problematic.
Sometime they works fine, sometimes not. It's totally unreliable under Enigma2.

For example my SimpleUmount plugin: many users are using it without any problem. MiLo says to me that in its system the plugin doesn't work correctly failing run os.popen() . Why ? I don't know.

So MiLo suggested me the correct way: Use in E2 plugins only Enigma2 Console.ePopen() function or parsing data directly from file (i.e. /proc/* , /sys/* ......): using simple Python open() looks to be safe.

Contach the author of HddSleep.py or try to change code yourself ......
STB: Clarke Tech ET9100
Mass storage: internal SATA-II HDD 1TB WD10EACS GreenPower 5400rpm
Mass storage: external USB pen drive 2GB
Firmware: OpenPLi kernel 3.x.x
Tuner A: AVL2108 (DVB-S2) HotBird 13E
Tuner B: AVL2108 (DVB-S2) HotBird 13E
Tuner C: AverMedia A867 (DVB-T HD) (AF9035 + MXL5007T)
TV: plasma PANASONIC GT30 fullHD
Audio: PCM through HDMI (no Dolby decoder)

Re: SimpleUmount extension plugin #29 Dimitrij

  • PLi® Core member
  • 10,037 posts

+339
Excellent

Posted 15 November 2011 - 11:59

Accessing to system function using original Python os.system() or os.popen() (or else) can be problematic.
Sometime they works fine, sometimes not. It's totally unreliable under Enigma2.

For example my SimpleUmount plugin: many users are using it without any problem. MiLo says to me that in its system the plugin doesn't work correctly failing run os.popen() . Why ? I don't know.

So MiLo suggested me the correct way: Use in E2 plugins only Enigma2 Console.ePopen() function or parsing data directly from file (i.e. /proc/* , /sys/* ......): using simple Python open() looks to be safe.

I have this too is not working properly.
And in the various plug-ins.
I can not understand what it is connected.

GigaBlue UHD Quad 4K /Lunix3-4K/Solo 4K


Re: SimpleUmount extension plugin #30 MiLo

  • PLi® Core member
  • 14,045 posts

+298
Excellent

Posted 15 November 2011 - 12:28

The best way to parse mounts is not at all - just ask Harddisk.py for a list.

The "mount" command doesn't do anything else than just echoing what's in /proc/mounts. So instead of the needlessly complex routine with temporary files and multiple shell forks, you can simply do this:

for line in open('/proc/mounts','r'):
  items = line.split()
  if items[0].startswith('/dev/sd'):
	print "Found", items[1]

That's it. You don't have to close files (Python is not Java, so files are closed immediately).

If you want to delete a file, please don't use os.system('rm %s' % filename). This may fail in horribly unexpected ways (what happens if filename is "-rf /" or just "*" for some freaky reason?) and also starts a shell which parses that line of text to figure out it has to call the "rm" command which again parses the line. You're using about 2MB RAM memory for this now.
To delete a file, just use "os.unlink(filename)". Put a try/catch around it to prevent a greenscreen when the file can't be deleted.

Edited by MiLo, 15 November 2011 - 12:29.

Real musicians never die - they just decompose

Re: SimpleUmount extension plugin #31 ambrosa

  • Senior Member
  • 161 posts

+35
Good

Posted 15 November 2011 - 12:38

I agree with you.
More or less it's the same code that I've used in my SimpleUmount 0.08
STB: Clarke Tech ET9100
Mass storage: internal SATA-II HDD 1TB WD10EACS GreenPower 5400rpm
Mass storage: external USB pen drive 2GB
Firmware: OpenPLi kernel 3.x.x
Tuner A: AVL2108 (DVB-S2) HotBird 13E
Tuner B: AVL2108 (DVB-S2) HotBird 13E
Tuner C: AverMedia A867 (DVB-T HD) (AF9035 + MXL5007T)
TV: plasma PANASONIC GT30 fullHD
Audio: PCM through HDMI (no Dolby decoder)

Re: SimpleUmount extension plugin #32 Lukin

  • Senior Member
  • 137 posts

+8
Neutral

Posted 15 November 2011 - 19:21

@ambrosa,

Yes the remapping still works if i need to change it, but i was hoping to have it show up under "Setup /System / Harddisk" like i mentioned, if i may; this is where i`d look first if i ever need to mount/unmount a device..i thought it`d be simpler.

Thx again.

Re: SimpleUmount extension plugin #33 ambrosa

  • Senior Member
  • 161 posts

+35
Good

Posted 17 November 2011 - 18:18

SimpleUmount is now included in main OpenPli Enigma2 extensions.
You can download it directly from you STB with:

opkg install enigma2-plugin-extensions-simpleumount

I've just upgraded it to rel. 0.09 but wait tomorrow to download it: it will be rebuild this night

Edited by ambrosa, 17 November 2011 - 18:18.

STB: Clarke Tech ET9100
Mass storage: internal SATA-II HDD 1TB WD10EACS GreenPower 5400rpm
Mass storage: external USB pen drive 2GB
Firmware: OpenPLi kernel 3.x.x
Tuner A: AVL2108 (DVB-S2) HotBird 13E
Tuner B: AVL2108 (DVB-S2) HotBird 13E
Tuner C: AverMedia A867 (DVB-T HD) (AF9035 + MXL5007T)
TV: plasma PANASONIC GT30 fullHD
Audio: PCM through HDMI (no Dolby decoder)



1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users