Savefolder without 'mount -o bind' - works

Under development: PCMCIA, wireless, etc.
Message
Author
User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#21 Post by mikeb »

The best patch for snapmergepuppy is the delete button...biggest pile of garbage out there.

sorry to vent there :D

mike

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

snapmergepuppy for Dpup Wheezy

#22 Post by gyro »

The ydrv for Dpup Wheezy at http://www.fishprogs.software/puppy/whe ... 5.2.11.sfs has had a patched 'snapmergepuppy' added to it.

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

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

#23 Post by gyro »

I just realised there is another candidate for puppy code that this breaks, that's 'Puppy Package Manager'. When it checks to see if you have enough room to install, in pupmode=12 it will most likely find 0.
A patch using similar techniques to the patch for 'snapmergepuppy' might work. I'll investigate.

gyro

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

Bug in 'snapmergepuppy' code

#24 Post by gyro »

There is a bug in the 'snapmergepuppy' code I published earlier.
The patch in the earlier post has been fixed.
The code in http://www.fishprogs.info/puppy/tahr/yd ... .3.rc1.sfs and http://www.fishprogs.info/puppy/wheezy/ ... 5.2.11.sfs has been fixed.

Apologies,
gyro

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

puppy package manager - /usr/local/petget

#25 Post by gyro »

Strangely enough, Puppy Package Manager, works as is.
In 'installpreview.sh' it checks the size of the package against the free space available.
It gets the free space number from '/tmp/pup_event_sizefreem'. I suspect that this is maintained by 'freememapplet', and if 'freememapplet' is not running, then the file is empty.
But apparently in script arithmetic, an empty variable is not equated to 0. So the test "[ $SIZEVALx2 -ge $SIZEFREEK ]" fails because $SIZEFREEK is empty. So 'installpreview.sh' tells you that all's well, go ahead and install.

So I have made a patch for '/usr/local/petget/installpreview.sh':

Code: Select all

--- installpreview.sh.orig	2014-08-28 06:07:44.000000000 +1000
+++ installpreview.sh	2014-10-06 19:14:25.659426937 +1000
@@ -75,8 +75,17 @@
 
 [ "$DB_description" = "" ] && DB_description="$(gettext 'no description available')"
 
+. /etc/rc.d/PUPSTATE
+
 SIZEFREEM=`cat /tmp/pup_event_sizefreem | head -n 1` #100821 bug in Lucid 5.1, file had two identical lines.
-SIZEFREEK=`expr $SIZEFREEM \* 1024`
+if [ $SIZEFREEM ]; then
+ SIZEFREEK=`expr $SIZEFREEM \* 1024`
+else
+ BASEMTP="/initrd${SAVE_LAYER}"
+ [ -L $BASEMTP ] && BASEMTP="/initrd${PUP_HOME}"
+ SIZEFREEK=`df | grep -m1 -w "$BASEMTP"| tr -s ' ' | cut -f 4 -d ' '`
+ SIZEFREEM=`expr $SIZEFREEK / 1024` 
+fi
 
 if [ $DB_size ];then
  SIZEMK="`echo -n "$DB_size" | rev | cut -c 1`"
The purpose of the patch is twofold:
1) Do something a bit sensible if 'freememapplet' is not running.
2) Within this, use the save partition if we have a link based savefolder.

Patched versions of 'installpreview.sh' have been included in http://www.fishprogs.software/puppy/tah ... .3.rc1.sfs and http://www.fishprogs.software/puppy/whe ... 5.2.11.sfs

I have tested this code in normal frugal installs of both TahrPup 5.8.3.rc1 and Dpup Wheezy 3.5.2.11.

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

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#26 Post by mikeb »

It gets the free space number from '/tmp/pup_event_sizefreem'. I suspect that this is maintained by 'freememapplet',
It used to be and probably still is coming from puppy_frontend_d in its free space check...which probably uses similar code and I found equally useless so removed it :D . You have probably highlighted why it is so.
Indeed if the drive icons are replaced with something better much of this becomes irrelevant anyway.

As a further aside Xfce4 has a great free space monitor as a an applet and I use that... reliable and immeasurable cpu.

Onward and upward.... funny how working on one thing improves several others.

mike

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

#27 Post by mavrothal »

Does "pup_rw" shows in mounted volumes/mounts? I would think that any puppy script that looks to pup_rw for info may have a problem with this implementation.
I also wonder if any aufs functions (auchk?) have problems since pup_rw does not appear as a branch.

BTW you may ant to provide deltas against the original ISO. Are equally small and the iso can be tested in a wider range of conditions.
== [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

#28 Post by gyro »

mavrothal wrote:Does "pup_rw" shows in mounted volumes/mounts? I would think that any puppy script that looks to pup_rw for info may have a problem with this implementation.
"pup_rw" does not show in any 'mount' list because it is not a mount point, it's just a directory within a mounted partition. That's why programs like 'freememapplet' and 'snapmergpuppy' have difficulties, because they try to obtain the free space in "pup_rw" from it's mount information.
mavrothal wrote:I also wonder if any aufs functions (auchk?) have problems since pup_rw does not appear as a branch.
I am not familiar with 'auchk', but if it's an aufs function then surely it would work on the actual branches in the aufs stack. And the directory that is the savefolder is a branch. Why would aufs care what the puppy common name is for one of them?

gyro

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

#29 Post by mavrothal »

mavrothal wrote:BTW you may ant to provide deltas against the original ISO.
Oh well, I put together a delta for Puppy Prceise 5.7.1, to become 5.7.2.
I contains the gyro's changes (patches) and the shellshock-safe bash-4.1.17.

So if you want to test gyro's new savefolder changes in precise, download the precise-5.7.1.iso___precise-5.7.2.iso.delta (md5:b6ea7b96f49848776186ad7ea7dc907d), update you precise 5.7.1 iso and check it out.

I tested only briefly, ie boot, save to directory and reboot using the said directory, but not any further.

NOTE: The 5.7.2 iso will update precise-5.7.1 if installed. If you do not want to test how it behaves after an update, use pfix=ram. Backup your original savefile if you do update.

Edit: New version Oct 12, also includes fixed freememapplet 2.4, a script to transform your savefile to savefolder, updated Puppy-package-* files, sfs_load and a fix for a soft block in wifi.
Attachments
patches.tar.gz
gyro's patches for savefolder as a symlink
md5:ddc0d5658c70f6e08f182034cb13bf9b
(70 KiB) Downloaded 348 times
Last edited by mavrothal on Sun 12 Oct 2014, 13:48, edited 3 times in total.
== [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

#30 Post by gyro »

@mavrothal
Thanks for providing the delta.
Thanks for providing the collection of patches.
There's just one little thing, the "df.diff" is not required by savefolder symbolic link, (although it won't hurt). It's the last piece of the jigsaw for savefolder bind mount.
(Until recently I was unaware that 'df' in puppy is a wrapper script.)

gyro

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 336 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 ?

Post Reply