Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sun 23 Nov 2014, 13:19
All times are UTC - 4
 Forum index » Advanced Topics » Cutting edge
Mounting and Linking SFS files for use
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 2 of 3 [42 Posts]   Goto page: Previous 1, 2, 3 Next
Author Message
sunburnt


Joined: 08 Jun 2005
Posts: 5042
Location: Arizona, U.S.A.

PostPosted: Sat 19 Sep 2009, 14:16    Post subject:  

jrb is mounting SFS files but not unioning them. So the topic is non-unions.
The OS may or may not be running a union, but it`s not being used for this.
Back to top
View user's profile Send private message 
seaside

Joined: 11 Apr 2007
Posts: 887

PostPosted: Tue 22 Sep 2009, 12:37    Post subject:  

JRB,

I don't know whether you are still pursuing the "link" route over the "union" one, but I thought maybe one way to prevent any necessary installed files from being inadvertently removed by the Pet uninstaller is to test for "symlink files only" before removal.

"if not symlink file, don't remove" in the uninstaller code.

I realize there are many factors and tradeoffs between "linking" and "unioning" and perhaps "linking" might be a "safer" way.

How is your thinking going now?.

(I must make sure Choicepup stays healthy) Very Happy
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 5042
Location: Arizona, U.S.A.

PostPosted: Tue 22 Sep 2009, 16:43    Post subject:  

Hi seaside; My suggestion to have a small ram disk as another union layer solves this problem.
All the links go into it and so doesn`t make a mess of the file system.

BUT... Setting the paths is most important, it eliminates most of the links!

jrb; You have been silent, are you still with us?
I`ll provide details of how to use the paths if you`re still at it... Terry
Back to top
View user's profile Send private message 
PupGeek

Joined: 06 Sep 2009
Posts: 388

PostPosted: Tue 22 Sep 2009, 17:29    Post subject:  

@ sunburnt: I have been experimenting with using sfs files within a roxapp. This way the roxapp contains the script which mounts the sfs file and can copy any necessary files over. I have succeeded with one app thus far... Blender. I made it to contain all its dependencies as well as check for OpenGL and install it if necessary. I have uploaded it into the .pet store and I am waiting for it to be available.
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 5042
Location: Arizona, U.S.A.

PostPosted: Tue 22 Sep 2009, 17:47    Post subject:  

Hi PupGeek; I assume that you`re using this method of "mount but don`t union"?
If so... Why would you mess up the file system with copied files?

As to dependencies, I had wrote a script that runs an app. and if it errors,
it runs "ldd" on it to get library dependencies and then downloads them.
It could be expanded to include all types of dependencies for download.
This way any app. package or SFS file doesn`t need the dependencies.
All that`s required is a solid fixed web site to point to the download sites.
This way it acts as a clearing house for the dependency download sites,
so the download sites can come and go and the main site is just updated.
Back to top
View user's profile Send private message 
PupGeek

Joined: 06 Sep 2009
Posts: 388

PostPosted: Tue 22 Sep 2009, 18:06    Post subject:  

It will only copy files that actually have to be copied. For example, like that config file in gimp that needs to be copied to /etc. But it will simply mount and export PATH and LD_LIBRARY_PATH variables and such for files that do not need to be copied.

I include dependencies within the files to accomodate those without an internet connection at home (such as myself). That way the user can download the file from an online computer then copy it across to their offline machine. If you use a computer with no internet connection, dependency issues can really test your patience.... I am just thinking about others who have to deal with it is all.

Anyways, the overall concept is just like you mentioned but you are basically using a roxapp as a wrapper for the sfs file.
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 5042
Location: Arizona, U.S.A.

PostPosted: Tue 22 Sep 2009, 18:20    Post subject:  

No internet, how do you get the SFS in the first place? ( Just kidding! )

PupGeek, I`m curious... How are you setting the paths before running the apps.?
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 5042
Location: Arizona, U.S.A.

PostPosted: Tue 22 Sep 2009, 19:55    Post subject:  

Addendum to PupGeek; I ask because the paths can be used to actually replace older or incompatible dependencies that exist in the system!
If the existing paths come after the added ones pointing to the SFS, then the SFS dirs. are searched first and the files needed are found.

This is of course if you run the app. with a startup script that sets the paths.
Then the paths that are set for each SFS file are unique to it alone, so the main system paths do not grow to huge sizes, and also you don`t have to edit the main paths constantly, you just make new ones.
Back to top
View user's profile Send private message 
PupGeek

Joined: 06 Sep 2009
Posts: 388

PostPosted: Fri 25 Sep 2009, 16:40    Post subject:  

When I package the .sfs into a roxapp, I use the AppRun script to check if the sfs is mounted, mount the sfs if needed, set the PATH and LD_LIBRARY_PATH variables, and finally execute the program.

As I said, I am basically using a roxapp as a wrapper for a .sfs file. Keep in mind, that all a roxapp is is a directory with an executable script named AppRun, and maybe a .DirIcon image. I haven't really tried this with pre-packaged .sfs modules, I have only used ones I made myself.

Here is an example of the AppRun I use for my Blender Roxapp:

#!/bin/sh

# This section checks for a directory that Xorg_DRI would install
# and installs it if it is not found. Then it runs xorgwizard.
if !( [ -d /usr/X11/lib/dri ] )
then {
gxmessage -timeout 5 "OpenGl was not found. Please wait while OpenGl is installed"
BLSFSDIR=/root/my-roxapps/blender
mkdir /mnt/blender
rxvt -e mount -t squashfs -o loop $BLSFSDIR/blender.sfs /mnt/blender
gxmessage -timeout 2 "Installing OpenGl... please wait"
cp -ur /mnt/blender/X11R7 /usr
gxmessage "Running Xorg Video Wizard, please save all work then press ok to continue"
gxmessage -timeout 5 "Please select XorgWizard from next dialog or close dialog to cancel. You can run blender from the menu after X restarts"
if !( [ -f /usr/share/applications/Blender.desktop ] )
then
cp /mnt/blender/share/applications/blender.desktop /usr/share/applications
fi
xorgwizard
}
fi

# This section checks to see of the .sfs file has been mounted
# and mounts it if necessary. This one also checks if there is a
# .desktop file in /usr/share/applications and copies it there if needed.
if !( [ -f /mnt/blender/bin/blender ] )
then {
BLSFSDIR=/root/my-roxapps/blender
mkdir /mnt/blender
rxvt -e mount -t squashfs -o loop $BLSFSDIR/blender.sfs /mnt/blender
gxmessage -timeout 3 "Configuring Blender. You can run Blender from the menu next time."

if !( [ -f /usr/share/applications/Blender.desktop ] )
then {
cp /mnt/blender/share/applications/blender.desktop /usr/share/applications
fixmenus
jwm -refresh
jwm -restart
}
fi

gxmessage -timeout 5 "Blender is configured and will now start"
}
fi

# Here is where we set the paths. These paths only seem to be valid
# within the program, but they are reset every time the program is
# started anyways.
BLENDERDIR=/mnt/blender
export BLENDERDIR

PATH=$BLENDERDIR/bin:$PATH
LD_LIBRARY_PATH=$BLENDERDIR/lib:$LD_LIBRARY_PATH


# Here, of course is where we execute the program.
exec $BLENDERDIR/bin/blender
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 5042
Location: Arizona, U.S.A.

PostPosted: Fri 25 Sep 2009, 17:08    Post subject:  

Looks good PupGeek; I think that the paths would need to be exported, but maybe not.

I wrote a general purpose script that runs the app. exec. given to it.
Then any special needs that the app. has can be done in the SFS`s script.
It takes the paths from $PATH and adds the SFS file mount point on to them.
Then it checks if the new path exists in the SFS file and removes it if it doesn`t.
This way the code to do this (and more) isn`t duplicated for every app. and SFS file.

There`s no doubt in my mind that this is the correct way to use SFS files.
Mount but don`t union them, and selectable auto. menus and DT icons.
Back to top
View user's profile Send private message 
PupGeek

Joined: 06 Sep 2009
Posts: 388

PostPosted: Sun 27 Sep 2009, 17:31    Post subject:  

Ive noticed that even if i export the paths, the appendages are still only valid within the program for some reason... It really hasn't been a big deal to me so far.
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 5042
Location: Arizona, U.S.A.

PostPosted: Sun 27 Sep 2009, 21:12    Post subject:  

Yep... $PATH is inherited from the script that runs the app.
The new PATH is only good to the script that set it and it`s children,
but not the parents of the script ( main $PATH ). It`s handed down not up.
Back to top
View user's profile Send private message 
rexterd

Joined: 01 Oct 2008
Posts: 12

PostPosted: Fri 23 Oct 2009, 00:45    Post subject:  

I am using aufs2 that can layer/detach sfs on the fly using gtkdialog3

http://picasaweb.google.com/rexterd/Linux#5393634739359479890
Back to top
View user's profile Send private message 
PupGeek

Joined: 06 Sep 2009
Posts: 388

PostPosted: Sat 24 Oct 2009, 16:13    Post subject:  

I think roxapps are the bomb... That way, when building packages and dealing with dependencies, you can just add them to the roxapp directory instead of your system directories (this helps big time in case you place a dependency that is compiled for the wrong glib version or something like that, which will screw up your system if placed in a normal location). Also, you don't have to worry about the constant mount/union of .sfs mods either. Although sunburnt seems to have something good going on too.
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 5042
Location: Arizona, U.S.A.

PostPosted: Tue 27 Oct 2009, 14:55    Post subject:  

Again the forum didn`t email me that this thread had progressed, same with other threads...
I`m hoping jrb will join us here for more discussion...

This is an embedded script called "sfs-nounion" that goes into the root dir. of the SFS file:
Code:
#!/bin/sh
##########   This is a setup file for: Mount SFS file but no-union.

###   USAGE:   sfs-nounion (-l , load | -u , unload) (/path/sfs-mount-dir.)

if [ -z "$2" ];then exit ;fi
sfsMNT=`echo $2 | sed 's#/$##'`                  # make sure no trailing /
MENU='/usr/share/applications/mediainfo-gui.desktop'

if [ "$1" = '-l' -o "$1" = 'load' ];then         # add to paths & make links
 PATH=$PATH':$sfsMNT/usr/bin'
 LD_LIBRARY_PATH=$LD_LIBRARY_PATH':$sfsMNT/usr/lib'
 ln -s $sfsMNT$MENU $MENU
elif [ "$1" = '-u' -o "$1" = 'unload' ];then      # remove paths & links
 PATH=`echo $PATH | sed 's#:$sfsMNT/usr/bin$##'`
 LD_LIBRARY_PATH=`echo $LD_LIBRARY_PATH | sed 's#:$sfsMNT/usr/lib$##'`
 rm -f $MENU
fi

There was only one PATH and LD_LIBRARY_PATH to add for this app.,
and one link for the menu file. There were no config. files to copy.

This is the same code that a "Load SFS" utility uses, but this way any
Linux system can use the SFS file, full or frugal installs, unioned or no-union.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 2 of 3 [42 Posts]   Goto page: Previous 1, 2, 3 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Cutting edge
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0954s ][ Queries: 11 (0.0167s) ][ GZIP on ]