Savefolder without 'mount -o bind' - works

Under development: PCMCIA, wireless, etc.
Message
Author
gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

freememapplet_tray

#31 Post by gyro »

Here is a patch of 'freememapplet_tray.c':

Code: Select all

--- freememapplet_tray.c.orig	2012-05-19 20:02:51.000000000 +1000
+++ freememapplet_tray.c	2014-10-08 01:56:41.045027125 +1000
@@ -68,7 +68,9 @@
     /*100517 always read free space in save file, not RAM space...*/
     /*if (pupmode!=6 && pupmode!=12) {fp = (FILE *)popen("df -m | grep ' /$' | tr -s ' ' | cut -f 2,4 -d ' '","r");}
     else {fp = (FILE *)popen("df -m | grep ' /initrd/pup_rw$' | tr -s ' ' | cut -f 2,4 -d ' '","r");}*/
-    if (pupmode==3) fp = (FILE *)popen("df -m | grep ' /initrd/pup_ro1$' | tr -s ' ' | cut -f 2,4 -d ' '","r");
+    if ((readlink("/initrd/pup_rw", meminfo, sizeof meminfo) != -1) || (readlink("/initrd/pup_ro1", meminfo, sizeof meminfo) != -1))
+        fp = (FILE *)popen("df -m | grep ' /initrd/mnt/dev_save$' | tr -s ' ' | cut -f 2,4 -d ' '","r");
+    else if (pupmode==3) fp = (FILE *)popen("df -m | grep ' /initrd/pup_ro1$' | tr -s ' ' | cut -f 2,4 -d ' '","r");
     else if (pupmode==7) fp = (FILE *)popen("df -m | grep ' /initrd/pup_ro1$' | tr -s ' ' | cut -f 2,4 -d ' '","r");
     else if (pupmode==13) fp = (FILE *)popen("df -m | grep ' /initrd/pup_ro1$' | tr -s ' ' | cut -f 2,4 -d ' '","r");
 // BK 110805 testing with PUPMODE=2, needs fix, there is no /dev/root...
Yes, same problem, assuming that it can get size information for 'pup_rw' from a mount entry.
I have added a working version of 'freememapplet_tray' to http://www.fishprogs.software/puppy/whe ... 5.2.11.sfs. This is the version I happened to be able to find source for.

So the list of required patches increases. But this symbolic link method has 1 advantage, they're all very specific to puppy.

gyro
Last edited by gyro on Sun 22 May 2016, 01:47, edited 1 time in total.

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

Re: freememapplet_tray

#32 Post by mavrothal »

gyro wrote: I have added a working version of 'freememapplet_tray' to http://www.fishprogs.info/puppy/wheezy/ ... 5.2.11.sfs.
Also works in Precise so you may want to post it as a pet here.
BTW is it stripped? (is too big)

BK keeps sources in http://bkhome.org/sources/. Needs the usual user/pass. Has 7 versions of the applet in http://bkhome.org/sources/alphabetical/f/
== [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

Re: freememapplet_tray

#33 Post by mavrothal »

mavrothal wrote: Also works in Precise so you may want to post it as a pet here.
Here is BK's freememapplet_tray-2.4 patched as above to v2.5

BTW I have also updated the precise-5.7.2 ISO with this.
Attachments
freememapplet_tray-2.5.pet
patched to recognise savefolder symlink
(4.33 KiB) Downloaded 334 times
== [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

#34 Post by Bert »

A question from a simple soul: can I use the delta to update the precise 5.7.1 from within it, while it is running?

Or does this need to happen from another Puppy?
Apologies, I never used a delta before...
[url=http://pupsearch.weebly.com/][img]http://pupsearch.weebly.com/uploads/7/4/6/4/7464374/125791.gif[/img][/url]
[url=https://startpage.com/do/search?q=host%3Awww.murga-linux.com%2F][img]http://i.imgur.com/XJ9Tqc7.png[/img][/url]

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

#35 Post by mavrothal »

Bert wrote:A question from a simple soul: can I use the delta to update the precise 5.7.1 from within it, while it is running?

Or does this need to happen from another Puppy?
Apologies, I never used a delta before...
The delta will update the precise-5.7.1.iso (not the retro version), that you must have locally, to produce the precise-5.7.2.iso. So get the 5.7.1 iso and the delta and use "Xdelta file difference manager" to update the iso.
Then you can do a "manual frugal install" with the vmlinuz, initrd.gz and puppy_precise-5.7.2.sfs files from the new iso, either in a new folder or replacing the ones from 5.7.1 in your installation, or just burn and boot the iso.
== [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

Re: freememapplet_tray

#36 Post by gyro »

mavrothal wrote:Here is BK's freememapplet_tray-2.4 patched as above to v2.5
This also works in Dpup Wheezy. So I've replaced the 'freememapplet_tray' in http://www.fishprogs.software/puppy/whe ... 5.2.11.sfs with this one.

I've no idea why the other version was so large. Yes it was stripped.

gyro
Last edited by gyro on Sun 22 May 2016, 01:47, edited 1 time in total.

backi
Posts: 1922
Joined: Sun 27 Feb 2011, 22:00
Location: GERMANY

#37 Post by backi »

Tested 5.7.2 delta iso on USBstick but at shutdown did not create savefile .
Just shutdown *after asking to create a savefile ** without saving .

User avatar
Bert
Posts: 1103
Joined: Fri 30 Jun 2006, 20:09

#38 Post by Bert »

mavrothal wrote: The delta will update the precise-5.7.1.iso (not the retro version), that you must have locally, to produce the precise-5.7.2.iso. So get the 5.7.1 iso and the delta and use "Xdelta file difference manager" to update the iso.
Then you can do a "manual frugal install" with the vmlinuz, initrd.gz and puppy_precise-5.7.2.sfs files from the new iso, either in a new folder or replacing the ones from 5.7.1 in your installation, or just burn and boot the iso.
Perfect explanation... thank you mavrothal.

I updated an existing precise 5.7.1 to 5.7.2 successfully, writing from it now.

I am running Puppy from a usb stick with pupmode=12, my favourite way of using Puppy. Of course, this was lost during the update, because the initrd.gz
gets replaced by the new one. No problem: simply added "PUPMODE=12" again (with editinit).

So far, I did not succeed to change from save file to save folder.
As I did not find the "transform" script, I downloaded gyro's "savefile2dir", made executable and clicked it. Nothing happened.

Think I'll do a new installation tonight, to see if that makes a difference.
For now, I'm grateful having an up-to-date Precise!

Bert
[url=http://pupsearch.weebly.com/][img]http://pupsearch.weebly.com/uploads/7/4/6/4/7464374/125791.gif[/img][/url]
[url=https://startpage.com/do/search?q=host%3Awww.murga-linux.com%2F][img]http://i.imgur.com/XJ9Tqc7.png[/img][/url]

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

#39 Post by mavrothal »

Bert wrote: So far, I did not succeed to change from save file to save folder.
As I did not find the "transform" script, I downloaded gyro's "savefile2dir", made executable and clicked it. Nothing happened.
The savefile2dir script is in /root/my-applications/bin, so it's in the $PATH
You must call it from the terminal though like

Code: Select all

savefile2dir /full/path/to/savefile/savefile.2fs
# ie something like
savefile2dir /mnt/home/Precise/precisesave.3fs
If you just click on it nothing happens :D

@backi: see response 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] ==

backi
Posts: 1922
Joined: Sun 27 Feb 2011, 22:00
Location: GERMANY

#40 Post by backi »

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 ?

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

Post Reply