Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
Pages: (2) </ [1] 2 >/

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: mydsl-load idiot valve< Next Oldest | Next Newest >
jpeters Offline





Group: Members
Posts: 804
Joined: April 2006
Posted: Oct. 09 2007,09:34 QUOTE

After inadvertently umounting extensions (incl uci's) by forgetting that I already loaded them, I started including an exit line on mydsl-load scripts, like:


      if find /opt/wine-0.9.28_with_opengl/ &>/dev/null; then exit; fi
     
      mydsl-load /mnt/hda3//wine-0.9.28_with_opengl.unc

Now I can screw up without freezing up my computer.
Back to top
Profile PM 
mikshaw Offline





Group: Members
Posts: 4856
Joined: July 2004
Posted: Oct. 09 2007,13:09 QUOTE

I can see how it's easy to accidentally unmount a uci, as I used to do it myself quite often.

If you don't mind a little critique, your script could be simplified and be allowed to work without a forced exit:
Code Sample
[ -d /opt/wine-0.9.28_with_opengl ] || mydsl-load /mnt/hda3/wine-0.9.28_with_opengl.unc

This cuts down on the number of commands needed, which translates to smaller code and (possibly) less processing time. It also eliminates the need for exit, which allows you to use this command for multiple uci packages, or to add whatever other commands you might want after the mydsl-load commands.

Personally I haven't used mydsl-load noninteractively, other than the auto-loaded extensions during boot. I tend to use either a dmenu script or a modified version of the ucitool script to manage ucis, both of which visually separate the loaded packages from the available ones to help prevent accidental unloading.


--------------
http://www.tldp.org/LDP/intro-linux/html/index.html
Back to top
Profile PM WEB 
Juanito Offline





Group: Members
Posts: 1601
Joined: Sep. 2005
Posted: Oct. 09 2007,14:31 QUOTE

...perhaps mydsl-load could be modified (in the case of uci, unc) to check if an extension with the same name is already mounted?
Back to top
Profile PM 
mikshaw Offline





Group: Members
Posts: 4856
Joined: July 2004
Posted: Oct. 09 2007,20:01 QUOTE

Then you wouldn't be able to unload uci packages cleanly...the same command is used to load and unload. You'd have to unmount them manually and somehow deal with keeping track of the cloop files in use.

It's much simpler to leave the check to an external script that just doesn't run the mydsl-load command if it's not necessary.


--------------
http://www.tldp.org/LDP/intro-linux/html/index.html
Back to top
Profile PM WEB 
jpeters Offline





Group: Members
Posts: 804
Joined: April 2006
Posted: Oct. 10 2007,07:18 QUOTE

Quote (mikshaw @ Oct. 09 2007,16:01)
It's much simpler to leave the check to an external script that just doesn't run the mydsl-load command if it's not necessary.

I found an even simpler way for the wine.unc example. I have a script, "wine" that mydsl-loads wine.unc, and a script, "fm" that loads Fund Manager (fm.exe).  The "fm" script is:

'wine /mnt/hda3/MyFiles/"Fund Manager"/fm.exe &'

If not already loaded, "fm" installs wine. If it is, Fund Manager loads.
Back to top
Profile PM 
6 replies since Oct. 09 2007,09:34 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

Pages: (2) </ [1] 2 >/
reply to topic new topic new poll
Quick Reply: mydsl-load idiot valve

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code