Savefolder without 'mount -o bind' - works

Under development: PCMCIA, wireless, etc.
Message
Author
User avatar
mavrothal
Posts: 3096
Joined: Mon 24 Aug 2009, 18:23

#41 Post by mavrothal »

backi wrote:Could make it working with ----savefile2dir /full/path/to/savefile/savefile.2fs

Want to ask ....can this be used in other Puppies too for example "Raring" ?

Whats necessary ?
If the patches can be applied cleanly it should work.
Keep in mind that for the init patch you must expand initrd.gz, patch it and re-compress it (must be a pet somewhere in the forum that does that if you do not know how).
You will also need the freememapplet_tray pet from above and of cource the sevefile2dir script
== [url=http://www.catb.org/esr/faqs/smart-questions.html]Here is how to solve your[/url] [url=https://www.chiark.greenend.org.uk/~sgtatham/bugs.html]Linux problems fast[/url] ==
User avatar
Bert
Posts: 1103
Joined: Fri 30 Jun 2006, 20:09

#42 Post by Bert »

Success!

I now suddenly have 19GB to save to :D
Thanks to mavrothal.

EDIT: this may be useful for others: the savefile2dir script needs some time to do its work. Nothing appears in the terminal for maybe a minute and then 2 lines appear, indicating process is finished.
Last edited by Bert on Wed 08 Oct 2014, 16:21, edited 1 time in total.
backi
Posts: 1922
Joined: Sun 27 Feb 2011, 22:00
Location: GERMANY

#43 Post by backi »

Thanks for your answer mavrothal

Where to place these patches ?
User avatar
mavrothal
Posts: 3096
Joined: Mon 24 Aug 2009, 18:23

#44 Post by mavrothal »

Bert wrote: I now suddenly have 19GB to save to :D
Thanks to mavrothal.
Thanks, but this is gyro's work.
I just change the wrapping/packaging a bit :wink: so hopefully will be tested by more people and possible issues will be identified and solved, so it can make it to woof-CE.
== [url=http://www.catb.org/esr/faqs/smart-questions.html]Here is how to solve your[/url] [url=https://www.chiark.greenend.org.uk/~sgtatham/bugs.html]Linux problems fast[/url] ==
User avatar
mavrothal
Posts: 3096
Joined: Mon 24 Aug 2009, 18:23

#45 Post by mavrothal »

backi wrote: Where to place these patches ?
Patches are applied to files.
You need to have devx loaded to patch.
== [url=http://www.catb.org/esr/faqs/smart-questions.html]Here is how to solve your[/url] [url=https://www.chiark.greenend.org.uk/~sgtatham/bugs.html]Linux problems fast[/url] ==
backi
Posts: 1922
Joined: Sun 27 Feb 2011, 22:00
Location: GERMANY

#46 Post by backi »

Thank you mavrothal .........but sorry this is beyond my understanding i have to drop

*just beginner*
gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

#47 Post by gyro »

@mavrothal
I do appreciate the effort you are putting into this little project.

@backi
I don't expect most folk will need to apply the patches directly, rather I hope that a few folk will do exactly what mavrothal has done for precise 5.7. i.e. for a particular puppy, apply the patches and then bundle it all up, and make it readily available for others.
Of course eventually I hope it might be included in new versions of puppy.

@Bert
The utility 'savefile2dir' was developed as a test tool for creating a savefolder, because no 'shutdownconfig' supporting savefolder had yet been developed.
If a fresh frugal install is done with a puppy that contains a savefolder supporting 'shutdownconfig', then it should not be necessary to use 'savefile2dir'.

gyro
Last edited by gyro on Thu 09 Oct 2014, 11:58, edited 1 time in total.
backi
Posts: 1922
Joined: Sun 27 Feb 2011, 22:00
Location: GERMANY

#48 Post by backi »

Hi gyro
@gyro
i don't expect most folk will need to apply the patches directly, rather I hope that a few folk will do exactly what mavrothal has done for precise 5.7. i.e. for a particular puppy, apply the patches and then bundle it all up, and make it readily available for others.
Of course eventually I hope it might be included in new versions of puppy.

Yes the option to save wether to savefile or savefolder should be included in new versions of puppy or in existing puppies make it readily available for others.

But one question ......(maybe naive ..) what could be advantage ( beside no need resizing savefile ) savefolder versus savefile ?

Cheers !
User avatar
mavrothal
Posts: 3096
Joined: Mon 24 Aug 2009, 18:23

#49 Post by mavrothal »

backi wrote: Yes the option to save wether to savefile or savefolder should be included in new versions of puppy or in existing puppies make it readily available for others.
The option to save in a folder is included both in TahrPup and Slacko-6. They are currently in RC/Beta and hopefully will go final soon.
This here is a different implementation of the savefolder mechanism.

Regarding savefolder vs savefile, some people prefer savefolder because has no size limitations, while other the savefile because can be encrypted or can be used with a standard vfat USB stick of the windows file system.
== [url=http://www.catb.org/esr/faqs/smart-questions.html]Here is how to solve your[/url] [url=https://www.chiark.greenend.org.uk/~sgtatham/bugs.html]Linux problems fast[/url] ==
gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

savefolder vs savefolder

#50 Post by gyro »

This topic is not about savefolder vs savefile, it's about savefolder vs savefolder.
A while ago in http://murga-linux.com/puppy/viewtopic.php?t=93559 a savefolder facility was developed and added to woof-ce, and hence included in the current TahrPup and Slacko6. For more discussion about savefolder vs savefile, please refer to that topic.
This topic is about a different way of implementing savefolder, and whether it's "better" than the current one.
Currently under test is the portability of this alternate implementation of savefolder to puppies that do not use the latest woof-ce and do not have a savefolder facility. Hence mavrothal has ported it to precise 5.7. I have ported it to Dpup Wheezy 3.5.2.11.

gyro
gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

port for raring 3.9.9.2

#51 Post by gyro »

Here's a port of this implementation of savefolder to raring 3.9.9.2.
Download http://www.fishprogs.software/puppy/raring/initrd.gz and http://www.fishprogs.software/puppy/rar ... .9.9.2.sfs.
Move them both into the directory containing a frugal install of raring 3.9.9.2. (Of course this will clobber your current 'initrd.gz'.)
Boot, and hopefully it will all work. (Did for me.)

Note1: 'freememapplet_tray' might be the wrong version. If it's needed, someone would need to patch the source of the correct version.
(I always disable 'freememapplet_tray' when I'm using savefolder, because I'm not save space paranoid any more.)

Note2: How can a zdrv patch the puppy sfs?
Because the 'init' script in this 'initrd.gz' also includes a patch to place zdrv in the aufs stack, just above the puppy sfs, not below it.
Edit: See http://murga-linux.com/puppy/viewtopic.php?t=95996 if you are interested.

gyro
Last edited by gyro on Sun 22 May 2016, 01:48, edited 1 time in total.
User avatar
mavrothal
Posts: 3096
Joined: Mon 24 Aug 2009, 18:23

#52 Post by mavrothal »

Peebee pointed into an issue with SFS_load and this implementation.
Other puppy scripts that depend on pup_rw are pmount, drive_all and frontend_funcs to mount /mnt/home to / when the entire partition is used for saving (pupmode 6), remasterpup2 and calcfreespace.sh.
Resizepfile.sh also needs the patch to drop out when using savefolder that was added in woof-CE for the other implementation.
== [url=http://www.catb.org/esr/faqs/smart-questions.html]Here is how to solve your[/url] [url=https://www.chiark.greenend.org.uk/~sgtatham/bugs.html]Linux problems fast[/url] ==
backi
Posts: 1922
Joined: Sun 27 Feb 2011, 22:00
Location: GERMANY

Re: port for raring 3.9.9.2

#53 Post by backi »

gyro wrote:Here's a port of this implementation of savefolder to raring 3.9.9.2.
Download http://www.fishprogs.info/puppy/raring/initrd.gz and http://www.fishprogs.info/puppy/raring/ ... .9.9.2.sfs.
Move them both into the directory containing a frugal install of raring 3.9.9.2. (Of course this will clobber your current 'initrd.gz'.)
Boot, and hopefully it will all work. (Did for me.)


gyro
Let me tell you what i did
did as you mentioned above
made a backup of my raring-save.4sf to another place
Started Raring in ram////// shut down creating savefolder//
Started Raring again opened new savefolder //deleted its content ///openend//extracted my raring-save.4sf///copied all its content to the empty new savefolder //restarted again //

et voila after booting my old settings where rescued....except 2 or 3 simlink icons
Seems to work so far
gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

#54 Post by gyro »

mavrothal wrote:Peebee pointed into an issue with SFS_load and this implementation.
I just tried this on raring 3.9.9.2. The problem is that sfs_load rejects any "savefile" that dosen't have a '.' in it's name. I renamed the savefolder to 'raringsave.d', and lo it worked.
Any version of savefolder would have the same problem with this old version of sfs_load. (I assume that shinobar fixed this in his savefolder patched sfs_load.)
mavrothal wrote:Other puppy scripts that depend on pup_rw are pmount, drive_all and frontend_funcs to mount /mnt/home to / when the entire partition is used for saving (pupmode 6), remasterpup2 and calcfreespace.sh.
I've had no problems with unpatched 'pmount' or 'drive_all' in raring.
It makes a difference as to exactly how they "depend on pup_rw".The only ones that should have a problem are ones that try to get information about 'pup_rw' by searching mount entries. The significant difference is that '/initrd/pup_rw' is no longer a mountpoint. But the files can still be accessed under '/initrd/pup_rw/'.
mavrothal wrote:Resizepfile.sh also needs the patch to drop out when using savefolder that was added in woof-CE for the other implementation.
Yes, 'rezizepfile.sh' is not relevant to any savefolder implementation.

gyro
gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

calcfreespace.sh

#55 Post by gyro »

Here is a patch for 'calcfreespace.sh':

Code: Select all

--- calcfreespace.sh.orig	2013-08-14 01:07:11.000000000 +1000
+++ calcfreespace.sh	2014-10-11 02:18:36.713682298 +1000
@@ -16,7 +16,11 @@
 
 case $PUPMODE in
  3|7|13) #home partition/file mntd on pup_ro1, tmpfs on pup_rw
-  SIZEFREE=`df -k | grep ' /initrd/pup_ro1$' | tr -s ' ' | cut -f 4 -d ' '`
+  if [ -L /initrd/pup_ro1 ]; then
+   SIZEFREE=`df -k | grep ' /initrd/mnt/dev_save$' | tr -s ' ' | cut -f 4 -d ' '`
+  else
+   SIZEFREE=`df -k | grep ' /initrd/pup_ro1$' | tr -s ' ' | cut -f 4 -d ' '`
+  fi
   SIZETMP=`df -k | grep ' /initrd/pup_rw$' | tr -s ' ' | cut -f 4 -d ' '`
   #v2.21 now have true flushing for pet packages at least, so only use free space
   #in the pup_save file (pup_ro1), unless tmpfs gets too low...
@@ -24,7 +28,11 @@
   [ $SIZETMP -lt 4096 ] && SIZEFREE=$SIZETMP
   ;;
  6|12) #home partition/file mntd on pup_rw (no tmpfs)
-  SIZEFREE=`df -k | grep ' /initrd/pup_rw$' | tr -s ' ' | cut -f 4 -d ' '`
+  if [ -L /initrd/pup_rw ]; then
+   SIZEFREE=`df -k | grep ' /initrd/mnt/dev_save$' | tr -s ' ' | cut -f 4 -d ' '`
+  else
+   SIZEFREE=`df -k | grep ' /initrd/pup_rw$' | tr -s ' ' | cut -f 4 -d ' '`
+  fi
   ;;
  *)
   SIZEFREE=`df -k | grep ' /$' | tr -s ' ' | cut -f 4 -d ' '`
I did this in raring 3.9.9.2 but it will probably work on other puppies too.

In raring, I noticed a comment in the top of the code that said this script is not used anymore.

I've updated http://www.fishprogs.software/puppy/rar ... .9.9.2.sfs to include 'calcfreespace.sh'.

gyro
Last edited by gyro on Sun 22 May 2016, 01:49, edited 1 time in total.
gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

Re: port for raring 3.9.9.2

#56 Post by gyro »

backi wrote:Seems to work so far
I'm glad it works for you too.

Don't worry too much about my previous post, raring 3.9.9.2 might not actually use the 'calcfreespace.sh' script. But if you feel the need, just download the zdrv again and clobber the old one.

sfs_load: If you rename your savefolder by appending ".d", the old version of sfs_load in raring 3.9.9.2 will again find any sfs's in your psubdir.

gyro
User avatar
mavrothal
Posts: 3096
Joined: Mon 24 Aug 2009, 18:23

#57 Post by mavrothal »

gyro wrote:
mavrothal wrote:Peebee pointed into an issue with SFS_load and this implementation.
I just tried this on raring 3.9.9.2. The problem is that sfs_load rejects any "savefile" that dosen't have a '.' in it's name. I renamed the savefolder to 'raringsave.d', and lo it worked.
Any version of savefolder would have the same problem with this old version of sfs_load. (I assume that shinobar fixed this in his savefolder patched sfs_load.)
Yes sfs_load-2.3 is working OK.
== [url=http://www.catb.org/esr/faqs/smart-questions.html]Here is how to solve your[/url] [url=https://www.chiark.greenend.org.uk/~sgtatham/bugs.html]Linux problems fast[/url] ==
gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

sfs_load

#58 Post by gyro »

If you don't want to rename your savefolder, or install the latest sfs_load, here is a patch:

Code: Select all

--- sfs_load.orig	2013-06-09 17:45:13.000000000 +1000
+++ sfs_load	2014-10-11 04:02:36.942885305 +1000
@@ -1851,7 +1851,11 @@
 DESTDIR=""
 if [ "$PUPSAVE" != "" ]; then
   SAVEPART=$(echo $PUPSAVE| cut -d',' -f1)
-  SAVEFILE=$(echo $PUPSAVE| cut -sd',' -f3| grep '\.') # PUPMODE=6 or 77 have not '.'
+  if [ $PUPMODE -eq 12 -o $PUPMODE -eq 13  ]; then
+    SAVEFILE=$(echo $PUPSAVE| cut -sd',' -f3)
+  else
+    SAVEFILE=$(echo $PUPSAVE| cut -sd',' -f3| grep '\.') # PUPMODE=6 or 77 have not '.'
+  fi
   [ "$PUP_HOME" != "" ] && PUPHOME=/initrd$PUP_HOME
   [ "$PUPHOME" = "/initrd$PUP_HOME" ] && PUPHOME=/mnt/home && DESTDIR=$PUPHOME
 else
I tested this this on raring 3.9.9.2.
http://www.fishprogs.software/puppy/rar ... .9.9.2.sfs has been updated to include a patch sfs_load

gyro
Last edited by gyro on Sun 22 May 2016, 01:50, edited 1 time in total.
gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

savefile2dir

#59 Post by gyro »

For those who have an existing savefile, I have uploaded http://www.fishprogs.software/puppy/savefile2dir.gz, a utility that converts a savefile to a savefolder. The savefile remains, but is renamed by prepending 'X' to it's name.

The file is a gziped script, download it to somewhere convenient, and gunzip it.

Ideally this utility should be run from another instance of puppy.

Then an upgrade consists of:
1) copy a patched 'initrd.gz' to frugal install directory
2) copy a ydrv (or zdrv) containing patched programs for the running system, to frugal install directory.
3) run 'savefile2dir' to convert current savefile to a savefolder.
4) Boot.

gyro
Last edited by gyro on Sun 22 May 2016, 01:51, edited 1 time in total.
User avatar
mavrothal
Posts: 3096
Joined: Mon 24 Aug 2009, 18:23

#60 Post by mavrothal »

For the latest/last update to savefolder function of precise-5.7.1 look here
== [url=http://www.catb.org/esr/faqs/smart-questions.html]Here is how to solve your[/url] [url=https://www.chiark.greenend.org.uk/~sgtatham/bugs.html]Linux problems fast[/url] ==
Post Reply