A SAVE-session to directory option added for PUPs [REOPENED]

A home for all kinds of Puppy related projects
Message
Author
User avatar
bigpup
Posts: 13886
Joined: Sun 11 Oct 2009, 18:15
Location: S.C. USA

#61 Post by bigpup »

Just wondering about something.

I see a lot of the word "folder" being used.

Should this be "directory"?

AS a "save directory"

This is Linux.
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected :shock:
YaPI(any iso installer)

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

#62 Post by mikeb »

I see progress... folder is easier to spell...that's my excuse

mike

slavvo67
Posts: 1610
Joined: Sat 13 Oct 2012, 02:07
Location: The other Mr. 305

#63 Post by slavvo67 »

Mike,

You're starting early... LOL or is it late where you are? :roll:

The save session is an excellent idea.

Best,

Slavvo67

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

#64 Post by gyro »

My apologies to all the Linux guru's for referring to "directories" as "folders".
I will try to not repeat my sins in the future.

gyro

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

#65 Post by mikeb »

We are all sinners...just some of us do it more often than others :D

mike

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

drive icons - AppRun script

#66 Post by gyro »

Would someone please tell me what I need to change to get "patched" "AppRun" scripts generated for the drive icons on the desktop?

As mentioned before, when a "save directory" is used instead of a "save file", there is a problem with the left clicking the drive icon for "/mnt/home". This can be fixed by directly editing the "AppRun" script for that particular icon, but I would much prefer to fix this at the source.

gyro

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#67 Post by SFR »

Would someone please tell me what I need to change to get "patched" "AppRun" scripts generated for the drive icons on the desktop?
It's /usr/local/bin/drive_all.

RE: folder vs. directory
Maybe we could use "foldir"? ;)

Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#68 Post by jamesbond »

directory vs folder:

"directory" is the fundamental term once you look at down at kernel and libc, and also most commonly used in command line prograns. "folder" is a "GUI object" that represents directory in a GUI. Thus, "cd to /usr/lib64 directory", but "open /usr/lib64 folder in Rox-filer".

As for "save directory" or "save folder" - either one is fine. I use "save directory", but "save folder" is fine too because we can expect that most people will access that directory through a GUI file manager - thus most access it as a "folder" rather than a "directory" (I know I do).
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

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

#69 Post by gyro »

SFR wrote:It's /usr/local/bin/drive_all.
Thank you very much.

gyro

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

#70 Post by mavrothal »

SFR wrote:
Would someone please tell me what I need to change to get "patched" "AppRun" scripts generated for the drive icons on the desktop?
It's /usr/local/bin/drive_all.

RE: folder vs. directory
Maybe we could use "foldir"? ;)

Greetings!
I believe drive_all just calls pmount.
pmount also brakes with savefolders but this little patch is fixing it

Code: Select all

--- a/usr/sbin/pmount	2014-02-26 09:36:01.000000000 +0200
+++ b/usr/sbin/pmount	2014-05-07 21:43:10.613321599 +0300
@@ -510,7 +510,7 @@
  ONEFS="`echo -n "$ONEPART" | cut -f 2 -d '|'`"
 
  DEVPATTERN="^${ONEDEV} "
- ONEMNTPT="`mount | grep "$DEVPATTERN" | cut -f 3 -d ' '`"
+ ONEMNTPT="`mount | grep "$DEVPATTERN" |grep -v pup_rw| cut -f 3 -d ' '`"
  [ "$ROOTDEV2" != "" ] && [ "$ROOTDEV2" = "$ONEDEV" ] && ONEMNTPT='/' #v3.96
  
  #in some cases prevent unmounting...
I'm not sure that there is something "central". pup_event_* maybe
== [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

#71 Post by gyro »

Replacing

Code: Select all

  #mounted...
  MNTPT="`df | grep "$dPATTERN" | tr -s ' ' | cut -f 6 -d ' '`"
with

Code: Select all

  #mounted...
  MNTPT="`df | grep "$dPATTERN" | grep -v 'pup_rw' | tr -s ' ' | cut -f 6 -d ' '`"
in either the "AppRun" script for the icon for "/mnt/home" partition, or in "/usr/local/bin/drive_all",
worked for me.
gyro

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

#72 Post by gyro »

I have patched Dpup Exprimo puppy_squeeze_5.X.3.4.12 to use save directories, and finally got it working for me.

The "init" script has a few less instances of "`mount ", since it does not have support for adrv, ydrv etc.

At first, any reboot or shutdown did not complete. X would shutdown but I was left at a command prompt.
So, I exported a few lines of code from Dpup wheezy "rc.shutdown".

I have attached diff files for the "init" script and "rc.shutdown"

Edit:
I think the difference between this and the previous 2 puppies, is that this is a pre woof-ce puppy, both the others were built with woof-ce.

gyro
Attachments
squeeze_rc.shutdown_diff.txt.gz
gzip of diff for "rc.shutdown" script
(255 Bytes) Downloaded 191 times
squeeze_init_diff.txt.gz
gzip of diff for "init" script
(570 Bytes) Downloaded 183 times
Last edited by gyro on Thu 08 May 2014, 10:49, edited 1 time in total.

gcmartin

#73 Post by gcmartin »

If not already a member, @Gyro should approach the WOOF-CE git for admission and presentation of the work that you, @MikeB and @Mavrothal are contributing to advancing this option in PUPPY persistence processing.

Just an idea

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

updated patch for slack 5.7

#74 Post by gyro »

This is a new version of the save directory patch to the 'init' script for slacko 5.7

This one goes for max:
1) All the pupsave "find" statements have been patched.
2) It always appends any found save files to the list of found save directories. So you can mix and match save files with save directories.
3) It includes mavrothal's fix to upgrading with multiple pupsaves.

Warning, the following is a whinge.
The pupsave "find" commands look for pupsaves in the root of the partition if none are found in the psubdir.
When I moved my save directory from the psubdir to the root of the partition, it was not used, slacko booted in pupmode 5.
After much time trying to find why my code did not work, I became desperate, reinstated the release initrd.gz and then moved the "slackosave.2fs" to the root of the partition.
Lo, this "slackosave.2fs" was not used.
I found the problem in a different part of the original code, (line 907)

Code: Select all

   grep "${PSUBDIR}/" /tmp/PUPSAVES > /tmp/PUPSAVES2 #note: need this as above probing may have got some invalid hits.
I do not understand why puppy goes to the bother of finding these pupsaves and then throws them away.
The moral of the story is, make sure you have checked what the existing code actually does, before you test if your code has broken it.
End whinge.

gyro
Attachments
slacko-saveDirectoryDiff.txt.gz
gzip of a patched 'init' script for slacko 5,7
(869 Bytes) Downloaded 211 times

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

#75 Post by mikeb »

@gyro
Your whinge and similar is why I abandoned the 'find' based inits... and might explain why there are many 'pup_xxx.sfs not found' posts on this forum...one I will bear in mind.

Such defeats of logic and basically loss of features are beyond my tolerance level so full marks for persisting ....as with anything puppy once you scratch the surface you end up fixing far more than you intended

mike

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

#76 Post by gyro »

@mikeb
Thanks for your supportive comments.
gyro

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

updated patch for wheezy 3.5.2.11

#77 Post by gyro »

This is a new version of the save directory patch to the 'init' script for wheezy 3.5.2.11
It's just the wheezy version of slacko-saveDirectoryDiff.txt.gz, i.e it's save directory to the max.

gyro
Attachments
wheezy-saveDirectoryDiff.txt.gz
gzip of a patched 'init' script for wheezy 3.5.2.11
(874 Bytes) Downloaded 183 times

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

#78 Post by gyro »

Here is an sfs containing the patched versions of applications that have been reported as broken because of the save directories code.
Currently there are just 2, "/usr/sbin/pmount" and "/usr/local/bin/drive_all".

In slacko 5.7 a ydrv can be mounted at boot time, by adding a "ydrv" boot parameter in your "menu.lst", (assuming you are using grub4dos). Something like the following:

Code: Select all

kernel /slacko/vmlinuz   psubdir=slacko pmedia=atahd pfix=fsck ydrv=sda4:/slacko/ydrv-slacko-saveDirectory.sfs
The advantage of a "ydrv" is that it overrides "puppy_slacko_5.7.sfs", even during the first boot. This is particularly useful for "drive_all", as it means that all the "AppRun" scripts for the drive icons, get created with the patched version of "drive_all".

gyro
Attachments
ydrv-slacko-saveDirectory.sfs.gz
gzip of ydrv sfs for slacko 5.7
(14.49 KiB) Downloaded 201 times

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

#79 Post by mikeb »

The advantage of a "ydrv" is that it overrides "puppy_slacko_5.7.sfs", even during the first boot.
Are you saying finally in puppy an sfs is layered over the main sfs after 8 years and much tub thumping.... lets do a dance :D

I will not suggest diving into the init and fixing that one either...that would be mean.

mike

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

Re: updated patch for slack 5.7

#80 Post by mavrothal »

gyro wrote:This is a new version of the save directory patch to the 'init' script for slacko 5.7
Unfortunately I may not have time to test this for few days but it looks good.

I was wondering however what is the advantage of

Code: Select all

[ "$ONEFS_IS_LINUX" = "Y" ] && FND_PUPSAVES="`find /mnt/data -maxdepth ${SEARCHDEPTH} -xdev -type d -iname ${DISTRO_FILE_PREFIX}save'*'| grep -v ' ' | sed -e 's%^/mnt/data%%' | tr '\n' ' '`"
FND_PUPSAVES="${FND_PUPSAVES}`find /mnt/data -maxdepth ${SEARCHDEPTH} -xdev -type f -iname ${DISTRO_FILE_PREFIX}save*.[234]fs | grep -v ' ' | sed -e 's%^/mnt/data%%' | tr '\n' ' '`"
instead of just

Code: Select all

FND_PUPSAVES="`find /mnt/data -maxdepth ${SEARCHDEPTH} -xdev -iname ${DISTRO_FILE_PREFIX}save*.[234]fs | grep -v ' ' | sed -e 's%^/mnt/data%%' | tr '\n' ' '`"
?
Saves one round of find|grep|sed and keeping the naming common will also make things simpler in the pupsaveconfig script that should give the option to generate the savefolder at first shut down.
== [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