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 Tue 22 May 2018, 23:41
All times are UTC - 4
 Forum index » Advanced Topics » Cutting edge
Savefolder without 'mount -o bind' - works
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 2 of 9 [132 Posts]   Goto page: Previous 1, 2, 3, 4, ..., 7, 8, 9 Next
Author Message
gyro

Joined: 28 Oct 2008
Posts: 1500
Location: Brisbane, Australia

PostPosted: Sun 05 Oct 2014, 05:04    Post subject:  

@mikeb
I do appreciate that the 'mount -o bind' method is all correct and above board Linux, and the scripts and programs are wrong.

gyro
Back to top
View user's profile Send private message 
mikeb


Joined: 23 Nov 2006
Posts: 11124

PostPosted: Sun 05 Oct 2014, 05:23    Post subject:  

No worries and I cannot think of any software that is affected other than puppy scripts. I once went around removing instances of rm -rf $VARIABLE from several places as such code can potentially wipe yer system if the generation of $VARIABLE gets upset. (lost a partition that way Very Happy )

Just as an aside slax manages to keep mounts made by the initrd separate from the main system so when running you only see 'normal' mounts and the loops and multiple mounts can only be seen by cat /path/to/initrd/proc/mtab ... not sure what the subtle difference is but it may be that the initrd system is not destroyed once booted since its reused at shutdown to keep things clean so I assume the kernel does not transfer over such special files/devs/proc info like it does in puppy.

Well have fun with the shoehorn... guess you like the challenge like me Smile

mike
Back to top
View user's profile Send private message 
gyro

Joined: 28 Oct 2008
Posts: 1500
Location: Brisbane, Australia

PostPosted: Sun 05 Oct 2014, 07:53    Post subject: Dpup Wheezy 3.5.2.11  

An 'initrd.gz' for dpup Wheezy 3.5.2.11 can be downloaded from here http://www.fishprogs.software/puppy/wheezy/initrd.gz
A ydrv for Wheezy containing 'rc.shutdown' and 'shutdownconfig' can be downloaded from here http://www.fishprogs.software/puppy/wheezy/ydrv_wheezy_3.5.2.11.sfs
The 'shutdownconfig' has been lifted directly from TahrPup.

This combination works ok.
The only failure I have noticed is 'freememapplet' did not seem to start. But then I always disable 'freememapplet' in any puppy using savefolder, since I don't think it's providing critical information in this situation.

gyro

Last edited by gyro on Sat 21 May 2016, 21:42; edited 1 time in total
Back to top
View user's profile Send private message 
gyro

Joined: 28 Oct 2008
Posts: 1500
Location: Brisbane, Australia

PostPosted: Sun 05 Oct 2014, 13:35    Post subject:  

Ok, I've found the problem with this implementation of 'savefolder'.
It's programs that try to find out how much space is left in the savefile. And they expect to get this from a mount entry. And of course there is no mount entry for '/initrd/pup_rw' (or '/initrd/pup_ro1' in pupmode=13).

I just looked at 'snapmergepuppy' source, and it definitely has this problem. So I suspect that in pupmode13 doing a 'save' will result in an error message saying that you have 0 space, and 0 files were copied. I haven't worked out a patch yet, but I don't think it will be too difficult.

I suspect that 'freememapplet' could have a similar problem. But it's not a script. Besides, I can easily live without it when using a savefolder, in fact I do. Which might explain why I didn't spot this one sooner.

I can't think of any other candidates for the problem.

It's a little frustrating that once again a side-effect breaks some puppy code, because it nullifies an assumption that seemed reasonable at the time the code was written.

gyro
Back to top
View user's profile Send private message 
gyro

Joined: 28 Oct 2008
Posts: 1500
Location: Brisbane, Australia

PostPosted: Sun 05 Oct 2014, 14:28    Post subject: snapmergepuppy for TahrPup  

Here is a possible patch for 'snapmergepuppy' in TahrPup 5.8.3.rc1.
Code:
--- snapmergepuppy.orig   2014-08-28 06:07:44.000000000 +1000
+++ snapmergepuppy   2014-10-06 18:00:13.693546346 +1000
@@ -66,9 +66,15 @@
  BASE="/initrd/pup_ro1"
 fi
 
+if [ -L $BASE ]; then #we have savefolder based on symbolic links
+ BASEMTP="/initrd${PUP_HOME}"
+else
+ BASEMTP="$BASE"
+fi
+
 # Precautions
 [ $PUPMODE -eq 3 -o $PUPMODE -eq 7 -o $PUPMODE -eq 13 ] || { echo "Wrong PUPMODE ($PUPMODE)!"; exit 1; }
-mountpoint -q "$BASE" || { echo "$BASE is not mounted!"; exit 1; }
+mountpoint -q "$BASEMTP" || { echo "$BASEMTP is not mounted!"; exit 1; }
 
 echo "Merging $SNAP onto $BASE..."
 
@@ -146,7 +152,7 @@
 
 #100222 a quick hack: BOOTCONFIG written to in init, before timezone set, can cause trouble...
 touch /etc/rc.d/BOOTCONFIG
-FREEBASE=`df -B 1 | grep -w "$BASE"| head -n 1 | tr -s ' ' | cut -f 4 -d ' '` #110212 Jemimah #110222 shinobar # SFR: result in bytes (see 'find' below)
+FREEBASE=`df -B 1 | grep -w "$BASEMTP"| head -n 1 | tr -s ' ' | cut -f 4 -d ' '` #110212 Jemimah #110222 shinobar # SFR: result in bytes (see 'find' below)
 
 rm -f /tmp/snapmergepuppy-nospace #110222 shinobar
 rm -f /tmp/snapmergepuppy-error   #140102 SFR
@@ -171,7 +177,7 @@
 
  #stop saving if not enough room left in ${DISTRO_FILE_PREFIX}save file...
  if [ $((NSIZE+204800)) -gt $FREEBASE ]; then   # 204800 = 200K slack space
-  FREEBASE=`df -B 1 | grep -w "$BASE" | head -n 1 | tr -s ' ' | cut -f 4 -d ' '` #110212 Jemimah: this is very slow; try not to check every iteration #110222 shinobar: fix for pup_ro10 and more
+  FREEBASE=`df -B 1 | grep -w "$BASEMTP" | head -n 1 | tr -s ' ' | cut -f 4 -d ' '` #110212 Jemimah: this is very slow; try not to check every iteration #110222 shinobar: fix for pup_ro10 and more
   if [ $((NSIZE+204800)) -gt $FREEBASE ]; then   #110212 Jemimah.
    touch /tmp/snapmergepuppy-nospace  #110222 shinobar
    break
This is untested, I don't run any pupmode=13.
I have also include the patched version of 'snapmergepuppy' in the ydrv for TahrPup here http://www.fishprogs.software/puppy/tahr/ydrv_tahr_5.8.3.rc1.sfs

Edit: I'm terribly sorry, there is a bug in the original code I published here. (Missing 'fi') I have fixed the diff here and the patched 'snapmergepuppy' in http://www.fishprogs.software/puppy/tahr/ydrv_tahr_5.8.3.rc1.sfs

gyro

Last edited by gyro on Sat 21 May 2016, 21:44; edited 2 times in total
Back to top
View user's profile Send private message 
mikeb


Joined: 23 Nov 2006
Posts: 11124

PostPosted: Sun 05 Oct 2014, 14:38    Post subject:  

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

sorry to vent there Very Happy

mike
Back to top
View user's profile Send private message 
gyro

Joined: 28 Oct 2008
Posts: 1500
Location: Brisbane, Australia

PostPosted: Sun 05 Oct 2014, 15:02    Post subject: snapmergepuppy for Dpup Wheezy  

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

gyro

Last edited by gyro on Sat 21 May 2016, 21:44; edited 1 time in total
Back to top
View user's profile Send private message 
gyro

Joined: 28 Oct 2008
Posts: 1500
Location: Brisbane, Australia

PostPosted: Mon 06 Oct 2014, 01:17    Post subject:  

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
Back to top
View user's profile Send private message 
gyro

Joined: 28 Oct 2008
Posts: 1500
Location: Brisbane, Australia

PostPosted: Mon 06 Oct 2014, 04:26    Post subject: Bug in 'snapmergepuppy' code  

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/ydrv_tahr_5.8.3.rc1.sfs and http://www.fishprogs.info/puppy/wheezy/ydrv_wheezy_3.5.2.11.sfs has been fixed.

Apologies,
gyro
Back to top
View user's profile Send private message 
gyro

Joined: 28 Oct 2008
Posts: 1500
Location: Brisbane, Australia

PostPosted: Mon 06 Oct 2014, 07:04    Post subject: puppy package manager - /usr/local/petget  

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:
--- 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/tahr/ydrv_tahr_5.8.3.rc1.sfs and http://www.fishprogs.software/puppy/wheezy/ydrv_wheezy_3.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 Sat 21 May 2016, 21:45; edited 1 time in total
Back to top
View user's profile Send private message 
mikeb


Joined: 23 Nov 2006
Posts: 11124

PostPosted: Mon 06 Oct 2014, 07:49    Post subject:  

Quote:
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 Very Happy . 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
Back to top
View user's profile Send private message 
mavrothal


Joined: 24 Aug 2009
Posts: 2965

PostPosted: Mon 06 Oct 2014, 10:42    Post subject:  

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.

_________________
== Here is how to solve your Linux problems fast ==
Back to top
View user's profile Send private message 
gyro

Joined: 28 Oct 2008
Posts: 1500
Location: Brisbane, Australia

PostPosted: Mon 06 Oct 2014, 12:56    Post subject:  

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
Back to top
View user's profile Send private message 
mavrothal


Joined: 24 Aug 2009
Posts: 2965

PostPosted: Tue 07 Oct 2014, 09:31    Post subject:  

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.
patches.tar.gz
Description  gyro's patches for savefolder as a symlink
md5:ddc0d5658c70f6e08f182034cb13bf9b
gz

 Download 
Filename  patches.tar.gz 
Filesize  70 KB 
Downloaded  232 Time(s) 

_________________
== Here is how to solve your Linux problems fast ==

Last edited by mavrothal on Sun 12 Oct 2014, 09:48; edited 3 times in total
Back to top
View user's profile Send private message 
gyro

Joined: 28 Oct 2008
Posts: 1500
Location: Brisbane, Australia

PostPosted: Tue 07 Oct 2014, 10:21    Post subject:  

@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
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 2 of 9 [132 Posts]   Goto page: Previous 1, 2, 3, 4, ..., 7, 8, 9 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.0835s ][ Queries: 14 (0.0277s) ][ GZIP on ]