lsrwy, list files in save layer that hide ydrv files

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

lsrwy, list files in save layer that hide ydrv files

#1 Post by gyro »

The attached command line utility "lsrwy", lists all the files in the save layer that hide files existing in the ydrv sfs, thus preventing the ydrv from fixing the issue.
In PUPMODE=13, relevant files in both "pup_rw" and "pup_ro1" are listed.

This is a utility meant to support the use of the ydrv as a mechanism for "patching" the puppy...sfs.

Usage:
Exceute the file in a terminal windlw.
The output is displayed on the terminal.

If there is no ydrv, then it shows nothing.

gyro
Attachments
lsrwy.gz
gunzip to produce script file "lsrwy"
(558 Bytes) Downloaded 149 times

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

#2 Post by gyro »

Example:

Code: Select all

# ./lsrwy 
Files in save layer that hide files in [sda4]/puppy/tahr/ydrv_tahr_6.0.6.sfs
Files in /initrd/mnt/dev_save/pups/tahr/tahrsave:
    /etc/rc.d/rc.sysinit
    /root/.sfs_load/sfs_load_alt.conf
# 
gyro

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#3 Post by musher0 »

Very strange thinking you have there, gyro, IMO.

First of all, the ydrv is not hidden (or any other ?drv for that matter).

And I can list the contents in the simplest possible way by typing in console:

Code: Select all

tree -fish /initrd/pup_y
So why your script? I'm not getting its usefulness.

#3, the ydrv's I created or got from other Puppies always worked on my
recent pups.

Now on the older pups, ydrv is not implemented. So of course it won't
work!!! In that case just create and load a regular sfs file.

BTW, you didn't mention for what Pups your script was for? And your own
originating Puppy of course (the one you wrote your script for). Maybe
that would help solve your issue. (If it is an issue.)

Also the tree utility is not present on older pups. ls is not well suited to
drill down through sub-directories. It can do it if you choose some "convo-
luted" settings, but tree is better and more straightforward for that.

Finally, IIRC, a ydrv is not meant to patch a Puppy. If a Puppy is broken,
you should open up the main sfs and do the repair there. The use of
?drv's is as follows, AFAIK:

adrv: reserved for general programs

fdrv: reserved for add'l file managers and utilities (e.g. archivers)

ydrv: reserved for add'l window managers.

zdrv: this is where the kernel drivers and similar basics go.

BFN
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

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

Re: lsrwy, list files in save layer that hide ydrv files

#4 Post by mavrothal »

gyro wrote:The attached command line utility "lsrwy", lists all the files in the save layer that hide files existing in the ydrv sfs,
Handy.
You might want to add a "case $1 in" on top and expand it for all standard puppy SFSs. Could be useful in version updates too, in case the update script misses important files.
== [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

#5 Post by gyro »

musher0 wrote:So why your script?
If you do use an sfs (In this example the ydrv), to introduce a different version of a file, somtimes the new version of the file is not seen by the running puppy. This can be because there is a copy of the file in the save layer and this is hiding any such file in the sfs.
This script identifies files in the save layer that are hiding files in the sfs, so it's easy to see if the file you are interested in is one of them.

gyro

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

Re: lsrwy, list files in save layer that hide ydrv files

#6 Post by gyro »

mavrothal wrote:You might want to add a "case $1 in" on top and expand it for all standard puppy SFSs. Could be useful in version updates too, in case the update script misses important files.
Yes, it could easily be modified to check against any standard puppy sfs file.
This would be more obvious if the "SFS_DIR" definition were moved up to the top of the script.

I did think of providing a mechanism to specify the sfs, but couldn't decide on the exact form of the specification, so I left it as is.
(I wish we could get used to referring to the puppy...sfs as the pdrv.)

gyro

User avatar
nic007
Posts: 3408
Joined: Sun 13 Nov 2011, 12:31
Location: Cradle of Humankind

#7 Post by nic007 »

What do you mean by hiding? The ydrv takes preference to the base sfs like the adrv and a savefile. The savefile/folder (if you have one) is at the very top layer as I anderstand it so in that case it will load on top of similar named files that may be in the base sfs or other sfs files (including the adrv and ydrv).

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#8 Post by musher0 »

gyro wrote:
musher0 wrote:So why your script?
If you do use an sfs (In this example the ydrv), to introduce a different version of a file, somtimes the new version of the file is not seen by the running puppy. This can be because there is a copy of the file in the save layer and this is hiding any such file in the sfs.
This script identifies files in the save layer that are hiding files in the sfs, so it's easy to see if the file you are interested in is one of them.

gyro
I see. Thanks for the explanation, gyro.

A couple of things come to mind, here.

My instinct would be to use the remove built-ins script to get the old
version out of the way. Then install a pet of the new version to the
pupsave file and try it out.

If it works and I'm satisfied with it, then I open up the main puppy sfs and
replace the old version of the executable with the new file there -- and
re-squash the main puppy sfs.

Or use a ydrv.sfs. That all depends on how one likes to work to upgrade
his Puppy. That's the nice thing about Puppy: there are various ways to
modify it.

On the subject of comparisons, why not use < diff -r > between the
directories in /initrd?

One last thing: if a new version of anything doesn't work, the ydrv may
have nothing to do with it. It could be that your Puppy is missing a lib
for this new version.

BFN.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

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

#9 Post by gyro »

nic007 wrote:What do you mean by hiding?
If there is an old version of a file in the savefolder and a newer version of the same file is introduced in a ydrv, the puppy will continue to use the old version of the file rather than the new version.
The copy of the file in the higher layer (savefolder) "hides" the copy of file in the lower layer (ydrv).

gyro

Post Reply