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 Wed 20 Aug 2014, 05:10
All times are UTC - 4
 Forum index » Advanced Topics » Cutting edge
live mounting of sfs is it possible ?
Moderators: Flash, Ian, JohnMurga
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 3 Posts_count   Goto page: 1, 2, 3 Next
Author Message
magerlab

Joined: 08 Jul 2007
Posts: 731

PostPosted: Wed 21 Jan 2009, 17:56    Post_subject:  live mounting of sfs is it possible ?
Sub_title: is there a way to make puppy install sfs without reboot?
 

is it possible to use a slax approach in puppy?
i mean to install sfs into a booted system and use it without reboot like it's done in slax?

_________________
skype: desafimager
Back to top
View user's profile Send_private_message 
disciple

Joined: 20 May 2006
Posts: 6427
Location: Auckland, New Zealand

PostPosted: Fri 23 Jan 2009, 00:41    Post_subject:  

You can just click on it to mount it, so it depends whether your particular sfs needs to be unioned to use it properly.
Puppy 1.x could union .sfs files on the fly (It was supposed to be unsafe to ununion them on the fly, but I did it all the time without ill effect), but it is supposed to be either impossible or unsafe in 2.x on. I think this was because unionfs is less stable with a 2.6 kernel, but I can't remember for sure - it could be because of the changes in Puppy's architecture.
Do you know if Slax unions an sfs, or just mounts it? I suspect it must be possible, and I seem to remember seeing something on the forum recently about unioning on the fly again... but it certainly isn't done commonly.

_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send_private_message 
jcoder24


Joined: 06 May 2005
Posts: 601
Location: Barbados

PostPosted: Fri 23 Jan 2009, 08:36    Post_subject:  

It depends on if you have additional loop devices available and the type of union you use. I find it works best with aufs rather than unionfs. Also while adding works ok, removal presents issues.

I use the following script to add additional loops while puppy is running. After running the script I would then run ldconfig and fixmenus.

Usage: scriptname` file.sfs

Code:
#/bin/sh
#jcoder24 20080412
#last mod 20080424

#--
# Initialise variables
#--
#if [ `echo $1 | grep -ic /' ]
#grep -ice "^./"

sfs_path=`dirname $1` #may need to check

sfs_file="$sfs_path/`basename $1`"
sfs_module=`echo $1 | gawk '{ gsub(".*/","",$0); gsub(".sfs","",$0); print $1 }'`
#sfs_module=`echo $1 | gawk '{ gsub(".sfs","",$0); print $1 }'`
#sfs_module=`echo $1 | gawk '{ gsub("[^a-zA-Z0-9].*","",$0); print $1 }'`
logger "sfs_handler: >> module: $sfs_module file: $sfs_file path: $sfs_path <<"

#--
# Check args and requirements
#--

#- If wrong number of args or file not found, show usage and quit
if [ $# -ne 1 ] ; then
   echo "Usage: `basename $0` file.sfs"
   exit 1
else
   if [ `echo $1 | grep -ice ".\.sfs$"` -ne 1 ]; then
      echo "Usage: `basename $0` file.sfs"
      exit 1
   elif [ ! -f $1 ]; then
      echo "File not found!"
      exit 1
   fi
fi

#- This only works with aufs, so if it's not loaded advise accordinly and quit
if [ `lsmod | grep -ic aufs` -eq 0 ]; then
   echo "`basename $0` requires aufs. To correct boot puppy with layerfs=aufs"
   exit 1
fi

#--
# Search for a free loop device and determine if file mounted already
#--
free_loop=""

for aloop in `ls /dev/loop* | grep -ve loop0 -e loop1 -e loop2`
#for aloop in `ls /dev/loop* | grep -ve loop0 -e loop1 -e loop2 -e loop6 -e loop7 -e loop4 -e loop5`
do
   sfs_loaded=`losetup-FULL $aloop 2>/dev/null`
   status=$?
   echo $aloop err_code $status

   if [ $status -gt 0 ]; then
#      echo $aloop "FREE"
      [ -z "$free_loop" ] && free_loop=$aloop
   fi

   if [ `echo $sfs_loaded | grep -ic $sfs_module` -gt 0 ]; then
      echo "A module with this name is already loaded! Aborting..."
      Xdialog --title "sfs_handler" --msgbox "`basename $sfs_module` is already loaded.\n"  6 0
      exit 0
   fi

   last_loop=`echo $aloop | cut -c10-`
done
logger "sfs_handler: Free $free_loop Last $last_loop"


#--
# If no free loops found, create a new one
#--
if  [ -z "$free_loop" ]; then
   logger "sfs_handler: No loop devices available."
   Xdialog --title "sfs_handler" --msgbox "Failed! No loop devices available.\n"  6 0
   exit

   next_loop=`expr $last_loop + 1`
   free_loop="/dev/loop$next_loop"
##   echo "Last $last_loop Next $next_loop"
##   mknod /dev/loop$next_loop b 7 $next_loop
#   echo "Creating new loop $next_loop..."
#   [ ! -b /dev/loop$next_loop ] && "mknod /dev/loop$next_loop" b 7 $next_loop
#   chown root:root /dev/loop$next_loop
#   chmod 666 /dev/loop$next_loop
fi


#--
# Load Module
#--

#- If module on cd then advise user
for cd in `mount | grep iso9660 | cut -d " " -f3`
do
   if [ `echo $sfs_path | grep -ic $cd` -gt 0 ]; then
      msg="sfs is located on a cdrom, do you still want to load it"
      Xdialog --title "sfs_handler" --yesno "$msg"  6 0
           [ $? -ne 0 ] && exit 0
      break
   fi
done
echo "Lets go!"

status=0
[ ! -d "/mnt/$sfs_module" ] && mkdir /mnt/$sfs_module
echo "Mounting $sfs_module..."

losetup-FULL $free_loop $sfs_file
status=$?
if [ $status -eq 0 ]; then
logger "sfs_handler: losetup $status"

   mount $free_loop /mnt/$sfs_module
   status=$?
   if [ $status -eq 0 ]; then
logger "sfs_handler: mount $status"

      mount -o remount,append:/mnt/$sfs_module=ro /
      status=$?
      if [ $status -eq 0 ]; then
logger "sfs_handler: aufs $status"

         Xdialog --title "sfs_handler" --msgbox "Success! `basename $sfs_module` module loaded.\n"  6 0
      else
         Xdialog --title "sfs_handler" --msgbox "Failed! `basename $sfs_module` module not loaded.\n"  6 0
      fi
   else
      umount $free_loop
      losetup-FULL -d $free_loop
      Xdialog --title "sfs_handler" --msgbox "Failed! Could not mount $sfs_module.\n"  6 0
   fi
else
   Xdialog --title "sfs_handler" --msgbox "Failed! Could not setup $free_loop for $sfs_module.\n"  6 0
fi
Back to top
View user's profile Send_private_message 
magerlab

Joined: 08 Jul 2007
Posts: 731

PostPosted: Fri 23 Jan 2009, 10:52    Post_subject:  

thank you for the answers !
how to use that script? can i associate it to sfs files?

_________________
skype: desafimager
Back to top
View user's profile Send_private_message 
WhoDo


Joined: 11 Jul 2006
Posts: 4441
Location: Lake Macquarie NSW Australia

PostPosted: Fri 23 Jan 2009, 16:23    Post_subject:  

jcoder24 wrote:
It depends on if you have additional loop devices available and the type of union you use. I find it works best with aufs rather than unionfs. Also while adding works ok, removal presents issues.

Since the Puppy 4.xx series uses aufs by default, does this mean that we could include hot mounting of sfs files as a feature from now on? Shocked

What issues does removal present? Can these be overcome?

This would be a "killer" feature to add to Puppy 4.2 Deepthought. It just requires a little deep thought is all. Wink

_________________
Actions speak louder than words ... and they usually work when words don't!
SIP:whodo@proxy01.sipphone.com; whodo@realsip.com
Back to top
View user's profile Send_private_message 
J-Bob


Joined: 09 Feb 2008
Posts: 283
Location: Canada

PostPosted: Fri 23 Jan 2009, 17:51    Post_subject:  

WhoDo wrote:
jcoder24 wrote:
It depends on if you have additional loop devices available and the type of union you use. I find it works best with aufs rather than unionfs. Also while adding works ok, removal presents issues.

Since the Puppy 4.xx series uses aufs by default, does this mean that we could include hot mounting of sfs files as a feature from now on? Shocked

What issues does removal present? Can these be overcome?

This would be a "killer" feature to add to Puppy 4.2 Deepthought. It just requires a little deep thought is all. Wink


My thoughts exactly.

Having this in 4.2 could lead to to it getting an even better advantage over the competition.

- J-Bob
Back to top
View user's profile Send_private_message Visit_website 
jcoder24


Joined: 06 May 2005
Posts: 601
Location: Barbados

PostPosted: Fri 23 Jan 2009, 20:22    Post_subject:  

magerlab wrote:
how to use that script? can i associate it to sfs files?

You can
- associate it with sfs files.
- drag and drop sfs files onto it
- run it from a console eg "sfs_handler myfile.sfs"

If I remember correctly removal caused the system to become unresponsive forcing the need to reboot. However, I haven't tested this recently with the newer version of aufs in puppy 4.

If removal still causes problems you could just leave out the 'feature'. In that case you could inform users that manually loaded sfs files remain loaded until reboot.

Another thing that will have to be accounted for in the above script include loading sfs files from cds and usb drives. Another useful thing would be to have a pinstall.sh for the sfs file that would run fixmenus, ldconfig (make libraries available without rebooting), restart xwindows, make fonts available, etc.

There may be other things to consider which the pros like MU would be able to highlight like the layering of the files esp when dealing with libraries.
Back to top
View user's profile Send_private_message 
technosaurus


Joined: 18 May 2008
Posts: 4334

PostPosted: Fri 23 Jan 2009, 20:24    Post_subject:  

add a little fixmenus and some restartwm in and you have a winning recipe

also if this goes we should make a little pet2sfs script as well (I may have seen one already - something like.... pet2tgz ..., tar ..., dir2sfs ....)

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send_private_message 
jrb


Joined: 11 Dec 2007
Posts: 1030
Location: Smithers, BC, Canada

PostPosted: Fri 06 Feb 2009, 22:29    Post_subject: Mount and use .sfs files from the OpenWith menu  

I have taken jcoder24's script and added "fixmenus" and "restartwm" to lines 123 and 124. I then placed it in a file called "load_sfs" along with a symlink in /root/.config/rox.sourceforge.net/OpenWith to /usr/sbin/load_sfs and made a .pet out of it.

Install the .pet and you can right click on an .sfs file and OpenWith load_sfs.

The .sfs will be installed and menu entries created (if they were in the .sfs).

Tested with OpenOffice-3.sfs in puppy412 and puppy420a3. I OpenedWith load_sfs, went to the document menu and opened OpenOfficeWriter, typed a test document and saved. When I rebooted OpenOffice and menu entries were gone. Too Cool! Very Happy

Edit: Latest version 23feb09 only restarts jwm (or icewm), not X, so does not shut down open programs.
load_sfs_412.pet
Description  improved, with ldconfig and only restarts jwm (or icewm), not X
pet

 Download 
Filename  load_sfs_412.pet 
Filesize  231.87 KB 
Downloaded  801 Time(s) 

Edited_times_total
Back to top
View user's profile Send_private_message 
reckrhodes

Joined: 30 May 2007
Posts: 116

PostPosted: Sun 08 Feb 2009, 07:23    Post_subject:  

I tried this wonderful pet. Yes, it works fine. Devx_410.sfs and OpenOffice-3.0.sfs function greatly.

How many sfs's can I load without rebooting my computer?
Back to top
View user's profile Send_private_message 
jrb


Joined: 11 Dec 2007
Posts: 1030
Location: Smithers, BC, Canada

PostPosted: Sun 08 Feb 2009, 10:42    Post_subject:  

Hi, reckrhodes,
I've only tried two at a time up to this point but I'm planning on experimenting with puppy-4.1.2-barebones from:
http://www.murga-linux.com/puppy/viewtopic.php?t=36727 and adding everything, browser, office suite, games, wine, etc. with .sfs files

If you do plan on using a lot of .sfs files I would definitely keep your pup_save.2fs backed up just to be safe.
Back to top
View user's profile Send_private_message 
jrb


Joined: 11 Dec 2007
Posts: 1030
Location: Smithers, BC, Canada

PostPosted: Mon 09 Feb 2009, 15:09    Post_subject:  

Exciting stuff,
I just rebuilt the puppy420a4 .iso to include Opera10.sfs, OpenOffice3.0.sfs and devx412.sfs, and then burned it to cd.

I am currently typing in Opera10, have already typed and saved a short letter in OpenOfficeWriter and loaded devx412.sfs. if I knew how to compile I would do that too. All from cd loaded with load_sfs.

I booted pfix=ram and have not yet created a pup_save file. Interestingly my puppy space monitor shows no memory being used (OK it's actually .01Gb). Does anyone know where the contents of mounted .sfs files gets stored (or not)?
Back to top
View user's profile Send_private_message 
WhoDo


Joined: 11 Jul 2006
Posts: 4441
Location: Lake Macquarie NSW Australia

PostPosted: Mon 09 Feb 2009, 15:25    Post_subject:  

jrb wrote:
Does anyone know where the contents of mounted .sfs files gets stored (or not)?

/initrd/pup_roX where X is the assignment number for each sfs file mounted.

_________________
Actions speak louder than words ... and they usually work when words don't!
SIP:whodo@proxy01.sipphone.com; whodo@realsip.com
Back to top
View user's profile Send_private_message 
jrb


Joined: 11 Dec 2007
Posts: 1030
Location: Smithers, BC, Canada

PostPosted: Mon 09 Feb 2009, 15:40    Post_subject:  

Thanks WhoDo,
I'm just wondering why they don't seem to take up any memory?
Back to top
View user's profile Send_private_message 
reckrhodes

Joined: 30 May 2007
Posts: 116

PostPosted: Mon 09 Feb 2009, 18:04    Post_subject:  

Good job jrb.

I tested again this wonderful pet, this time sfs files are located from 3 levels of subdirectories and it works fine. (My partition is vfat)

Both jcoder24 and you should be applauded for a job well done.

Hope this will be included to the Puppy 4.2 final and Woof.
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 3 Posts_count   Goto page: 1, 2, 3 Next
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Advanced Topics » Cutting edge
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0963s ][ Queries: 12 (0.0047s) ][ GZIP on ]