Script to permanently install UCI extensions


Forum: DSL Ideas and Suggestions
Topic: Script to permanently install UCI extensions
started by: john.martzouco

Posted by john.martzouco on Dec. 20 2007,14:21
I've recently been playing with the python.uci extension.  As I use a traditional HD install, I copied the /opt/python folder to a temp location and then copied it back permanently the next time I rebooted.

I omitted to copy the python.app file that used to show up in MyDSL, so now I can't launch Python from the MyDSL submenu.  This isn't a big deal, I can get it later and put it in there.

It has made me think that it would be helpful to have a menu command that could have done all the work for me.  I find many of the menu commands helpful not only for the service they provide, but also for the understanding that they give me when I read the scripts.  I've learned many things from these scripts.

I'd write the PermanentInstallUCI myself, but there are a few things I don't understand yet...

1) Is there a way to see what's inside a UCI without mounting it?  Something akin to tar -t?

2) Does the python.app file in MyDSL come from inside the UCI or is it generated by the script that mounts the UCI?

3) Is there a way to unmount a UCI?

Much thanks,
John

Posted by mikshaw on Dec. 20 2007,16:16
1) I wouldn't be surprised if there is, but I don't know what it might be. Please note that one major benefit of using tar -t is that it doesn't extract the files. This benefit doesn't apply to mounting file systems, as the only disk use is the mountpoint. Mounting a uci doesn't really use any more resources than simply looking into the file would.

2) I believe it is created when mydsl-load is run, but I still haven't looked into the new installation process. This is just a guess. It may require running mydsl-load /opt/python/user.tar.gz *after* you remove the uci and copy the temp directory to /opt/python.

3) They are unmounted the same way they are mounted, using mydsl-load <filename>

Posted by lucky13 on Dec. 20 2007,16:18
Sorry, there shouldn't be a menu entry to do what DSL isn't intended for. And DSL really isn't intended for traditional hard drive install.

That said, I wrote on the following entry what I do when I use DSL for traditional hard drive installs.
< http://lucky13linux.wordpress.com/2007....a-point >

Unmounting UCI/UNC files is the same as mounting. Either execute mydsl-load or click on it in dfm. If you do a hard drive install, you can rearrange your menus and directories and symlinks to suit your tastes sans a MyDSL folder.

Edit: Regarding your first question, isofs is a separate filesystem rather than a tarball so it would need to be mounted to get to its contents. I stand to be corrected if there's a way to see contents in a filesystem without mounting it.

Posted by curaga on Dec. 20 2007,17:23
I've seen some iso-utils that list the contents without mounting, but the wouldn't work with cloop..
Posted by john.martzouco on Dec. 20 2007,18:52
Is it possible to mount a UCI to a mount point other than the one that mydsl-load will use automatically?  That would help to make copying the files to HD install a 2-step process.

Thanks

Posted by mikshaw on Dec. 20 2007,20:00
Yes. Take a look at the /etc/init.d/mountci script to see how Robert has it working now. You could probably use that as a base for a permanent-install script. The APP variable sets the directory name, although I'm not sure at the moment how you'd be able to properly unmount and free up the cloop device if the variable is changed.

The easiest thing I can think of, though, is just to use the existing mydsl-load command within a small script of your own to mount, copy, and unmount automatically

Code Sample
source /etc/init.d/dsl-functions
SOURCE_DIR=/opt/`getbasefile "$1"`
TMP_DIR="$SOURCE-temp"
mydsl-load "$1"
sudo cp -Rp "$SOURCE_DIR" "$TMP_DIR"
mydsl-load "$1"
sudo mv "$TMP_DIR" "$SOURCE_DIR"
mydsl-load "$SOURCE_DIR/user.tar.gz"

THIS IS NOT TESTED! I just spit it out as a pseudo-script.

Posted by lucky13 on Dec. 20 2007,20:34
Quote
Is it possible to mount a UCI to a mount point other than the one that mydsl-load will use automatically?  That would help to make copying the files to HD install a 2-step process.

I don't understand the concern with streamlining any process since the goal is only to add the full package and make it persistent. By choosing hard drive install, you're already going against the grain. Why go even more against it? The more you muck it up with new mount points, the more room for error. Use what's already there -- it works the way it was designed to work (I don't think you can improve on Robert's design). The simplest way to skin this cat is to mydsl-load to mount, cp -Rp, mydsl-load to unmount, mv.

Posted by john.martzouco on Dec. 20 2007,21:25
Hi lucky,

My main interest in asking this was to find a mechanism for discovering the contents of the UCI and to make the permanent installs easier for myself.  With trad hd installs, every new version to which I want to upgrade will necessitate this path for me.  I run P2-300 laptops with low RAM as thin-clients so I think this type of install is the best way to leverage my hardware.

I also think that DSL is the absolute best OS on the market right now.

Because my manual copy of python excluded the associated python.app launcher, I developed the feeling that there may be other elements that I might have missed.  What I`ve learned by bringing it to the forum is that there is a script I can read to understand how UCIs are loaded and find out how any automatically generated relatives are formed.  The discussion has also shown me that maybe all I need to do after I understand UCIs is a one-argument script with the four steps you mentioned last.

Thank you to every one who`s shared wisdom with me... it`s helping me be more comfortable with this product and increasing my productivity and enjoyment.

Regards,
John

Posted by lucky13 on Dec. 20 2007,23:25
Quote
I run P2-300 laptops with low RAM as thin-clients so I think this type of install is the best way to leverage my hardware.

If you intend to upgrade frequently, I would strongly recommend frugal install. At some point you'll appreciate the difference between leveraging hardware and leveraging your time.

FWIW, I've run DSL in various configurations on various machines. I also run DSL from USB-HDD.

I presently have one computer (400mhz Celeron, 128MB RAM) with hard drive install. Barring a power outage in the next five hours, it will have 38 days uptime today. That machine ran for a very long time on DSL 2.1b and completely skipped DSL 3+ (edit: I would probably *still* run DSL 2.1b on it if I hadn't installed FreeBSD and used the whole drive). It's now running 4.0-release. It will not get an upgrade until I'm convinced that it's worth the hassle of backing up files and going through the process of reconfiguring everything on that drive. If you're going to the hassle of putting /home on a separate partition, go ahead and put /opt there as well so you needn't set up funky scripts to circumvent the way UCIs are supposed to work.

I also presently have DSL installed frugal on the following computers:
- 200 mhz Pentium Pro, 64 MB RAM
- 200 mhz Pentium MMX, 64 MB RAM (rescued this week)
- 266 mhz Pentium Pro, 32 MB RAM

I don't know what you consider low RAM, but frugal works very well on the above machines. I've mixed hard drives with different installs -- frugal, hard drive -- between these and faster computers for testing various things. The difference in performance between hard drive install and frugal is insignificant on the P2xx boxes above.

You might want to try it before you dismiss it and instead create a lot more work for yourself than DSL is intended to be.

Posted by john.martzouco on Dec. 21 2007,04:28
Can you run GIMP on those 200MHz boxes?  I'm running with 128MB of RAM and need to edit graphics under those conditions.

I'd also prefer not to have the CDROM spin up every time I start the machine and have it available; and I'd rather not have to depend on a USB sticking out the side either... I guess that sets me up for a poorman's install.

Definitely willing to give it a try if I can run Firefox, GIMP, WINE and  < my favorite editor > at the same time.

Posted by lucky13 on Dec. 21 2007,04:41
Yes, but I don't use the GTK2 version. And since 4.2 has mtpaint, I haven't felt compelled to use GIMP at all. As far as WINE and bringing over Windows applications, whatever floats your boat. I have Windows for strictly-Windows apps and prefer cross-platform apps like vim, scite, etc., that don't force me to make those kinds of decisions.

Add another frugal install to my list tonight:
- 500 MHz Celeron, 64MB RAM (laptop)

No, haven't tried GIMP with it. Wont, either (about to install ratpoison).

Now why would you not have the CDROM/USB and choose poorman over frugal?

Posted by john.martzouco on Dec. 21 2007,10:13
Is ratpoison image manipulation software?  We're dying to get rid of GIMP over here.
Posted by lucky13 on Dec. 21 2007,11:37
No, ratpoison is a window manager oriented for people who hate using a mouse, touchpad, etc. You probably wouldn't like it since it has zero eye candy.

< http://www.nongnu.org/ratpoison/ >

Posted by john.martzouco on Dec. 21 2007,13:41
I just checked it out.  I think it's wonderful.
Posted by WDef on Dec. 21 2007,15:35
What sort of image manipulation do you need to do John?

Quite a lot can be done with mtpaint, xnview.uci or Imagemagick.uci - but I imagine you know that.

Posted by john.martzouco on Dec. 21 2007,15:49
WDef,

Only a few things.  In general:

1) shrink an image from 1024x786 down to 200x150.
2) save as gif or jpg.
3) crop an image.
4) copy a piece from one image and paste it into another.

Those were the simple ones.  Here are the advanced:

5) print an image across many pages as a poster; with crop marks for alignment would be best.  My wife uses large paper patterns for her work, but we use small digital images to prepare them.
6) histogram, color-balancing, contrast-balancing, fading, enhancing etc for photo retouching.  We use Paintshop Pro in Windows for this.  GIMP is going to be a challenge for both of us, it has a different setup from any program I've ever used.  I'm versant with layers et al techniques, but I can't wrap my head around how to do simple things in GIMP (yet, as my time is focused on other things).

I'll add more if I remember anything later.

Posted by lucky13 on Dec. 21 2007,15:57
Most -- if not all -- of that can be done via command line with imagemagick.
< http://www.imagemagick.org/script/command-line-tools.php >
< http://www.ioncannon.net/linux....-part-1 >

I'm surprised you had something nice to say about ratpoison considering it's devoid of aesthetics, icons, etc. :-)

Posted by john.martzouco on Dec. 21 2007,23:31
lucky13,

I knew you would be.

I'm a power user.  I support a bunch of friends who aren't.  I've always tried to make it clear that the thinsg I suggested were in the context of helping new people get on board.

If you ever search the Multi-Edit forum, you'll see that I prefer to get things done by keyboard... and rarely use a mouse... it's the fastest way to get around.

You and I are strong enough to do whatever we want with computers.  Not everybody is.

I'm looking onto ImageMagick.

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.