sfs_load-2.4 on-the-fly

Miscellaneous tools
Message
Author
User avatar
shinobar
Posts: 2672
Joined: Thu 28 May 2009, 09:26
Location: Japan
Contact:

Re: sfs_load-2.3.2 on pupmode=13

#316 Post by shinobar »

tnx mavrothal.
i am using sfs_load-2.3.2 on PUPMODE=13 and working with no problem so far.
Downloads for Puppy Linux [url]http://shino.pos.to/linux/downloads.html[/url]

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

#317 Post by mavrothal »

Thx
Any ideas how to adapt it for pupmode 2?
It should be possible as aufs is there just the same.
Is it worth trying to integrate it with the current or maybe write a new script and have it called from sfs_load?
Best
== [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
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#318 Post by Argolance »

Bonjour,
:arrow: Please take a look around this thread...

sfs_load (2.3.2) seems to generate a (wrong) path starting with '/initrd/initrd/' (pupmode 5)

Cordialement.

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

#319 Post by mavrothal »

Argolance wrote:Bonjour,
:arrow: Please take a look around this thread...

sfs_load (2.3.2) seems to generate a (wrong) path starting with '/initrd/initrd/' (pupmode 5)

Cordialement.
I did
== [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
ASRI éducation
Posts: 3197
Joined: Sat 09 May 2009, 12:10
Location: France
Contact:

#320 Post by ASRI éducation »

sfs_load-2.3.0.pet

I used the latest version of shinobar 'sfs_load-2.3.pet (2014-09-06)'.
I have not integrated the mavrothal changes (v2.3.1/2.3.2) because testing is not finished.

Proposed changes for /usr/sbin/sfs_load
#20150706 v2.3.0 by ASRI: Increase the size of main GUI # Add info "number of sfs mounted" # For the list of mounted sfs, use a "table" (instead of "list") to sort the list alphabetically # Add button refresh

Regards

Code: Select all

--- ./sfs_load_2.3	2014-09-06 10:44:34.000000000 +0200
+++ ./sfs_load_2.3.0	2015-07-07 16:06:31.000000000 +0200
@@ -51,9 +51,10 @@
 #v2.1.9: fix loop device conflict with irregular initramfs
 #2014-08-10 v2.2: fix was removed all sfs after abnormal shutdown
 #2014-09-06 v2.3: fix again save-to-directry, avoid always mounted puppy sfs partition under PUPMODE=5  
+#20150706 v2.3.0 by ASRI: Increase the size of main GUI # Add info "number of sfs mounted" # For the list of mounted sfs, use of a "table" (instead of "list") to sort the list alphabetically # Add button refresh
 MYPATH=$0
 MYNAME=$(basename "$0")
-VERSION=2.3
+VERSION=2.3.0
 ORGOPT="$@"
 #some options the puplet builder can choose
 WIPEWHITEONINIT="true"	# true/false
@@ -761,7 +762,18 @@
 }
 main_dialog() {
 	waitsplash $(gettext "Probing...")
-	BOXHEIGHT=150
+	BOXHEIGHT1=300
+	BOXWIDTH=650
+	TEXTWIDTH=580
+	TEXTWIDTHCHARS=30
+		list="/tmp/sfs_load/loop_device_list"
+		cntsfsloaded=0
+		while read LINE
+		do
+			if [ "$LINE" != "" ]; then
+				cntsfsloaded=`expr $cntsfsloaded + 1`
+			fi
+		done < "$list"
 	LOADVISIBLE="enabled"
 	UNLOADVISIBLE="eabled"
 	if [ "$ACTION" = "unload" ]; then
@@ -793,8 +805,9 @@
 	UNLOADCOMBO=""
 	if [ "$ALREADY_SFS_LIST" != "" ]; then
 	  UNLOADABLE="enabled"
-	  UNLOADCOMBO='<list tooltip-text="'$(gettext "Select the sfs file you want to unload.")'">
-	  <variable>UNLOADSFS</variable>'$(make_combo $ALREADY_SFS_LIST)'<visible>'$UNLOADVISIBLE'</visible></list>'
+	  UNLOADCOMBO='<table tooltip-text="'$(gettext "Select the sfs file you want to unload.")'">
+	  <label>'$(gettext 'Total of mounted SFS =')' '$cntsfsloaded'</label>
+	  <variable>UNLOADSFS</variable>'$(make_combo $ALREADY_SFS_LIST)'<visible>'$UNLOADVISIBLE'</visible></table>'
 	  [ "$QUEUELIST" ] && UNLOADCOMBO="$UNLOADCOMBO
 	  "'<text><input>echo -en "'$(gettext "Some are not loaded but in the queue.")'"</input></text>'
 	else
@@ -804,10 +817,10 @@
 	DIALOG='<window title="'$LONG_TITLE'"><vbox>
     <hbox>
     <pixmap><input file>'$MYICON'</input></pixmap>
-	<text width-chars="40"><input>echo -en "'$(gettext "You can load or unload extra SFS files on-the-fly.")'"</input></text>
+	<text width-chars="'$TEXTWIDTHCHARS'" width-request="'$TEXTWIDTH'"><input>echo -en "'$(gettext "You can load or unload extra SFS files on-the-fly.")'"</input></text>
    </hbox>
-	<hbox><frame '$(gettext "Load SFS")'>
-	<vbox height-request="'$BOXHEIGHT'">
+	<hbox width-request="'$BOXWIDTH'"><frame '$(gettext "Load SFS")'>
+	<vbox height-request="'$BOXHEIGHT1'">
    '"$LOADCOMBO
 	$WRONGTEXT"'
 	</vbox>
@@ -816,7 +829,7 @@
 	<action>EXIT:Load</action><visible>'$LOADVISIBLE'</visible></button>
 	</frame>
 	<frame '$(gettext "Unload SFS")'>
-	<vbox height-request="'$BOXHEIGHT'">
+	<vbox height-request="'$BOXHEIGHT1'">
    '$UNLOADCOMBO'
     </vbox>
      <button tooltip-text="'$(gettext "Which SFS do you want to unload?")' '$(gettext "Click here after you choose the extra sfs file.")'">
@@ -825,7 +838,8 @@
 
     </frame></hbox>
     <hbox>
-     <button><label>'$(gettext 'Quit')'</label><input file stock="gtk-quit"></input><action>EXIT:Abort</action></button>
+     <button tooltip-text="'$(gettext "Refresh list of loaded sfs.")'"><input file stock="gtk-refresh"></input><action>sfs_load &</action><action>EXIT:Abort</action></button>
+     <button tooltip-text="'$(eval_gettext "Quit $TITLE v$VERSION.")'"><input file stock="gtk-quit"></input><action>EXIT:Abort</action></button>
     </hbox>
 	</vbox></window>'
 	waitsplash --stop
Attachments
sfs_load-2.3.0.pet
md5 ac2aaf2b4d6831f6923dd70ba39d9f31
(33.94 KiB) Downloaded 345 times
sfs_load-2.3.0.jpg
(48.7 KiB) Downloaded 836 times
Projet ASRI éducation => [url=http://asri-education.org/]Association[/url] | [url=http://forum.asri-education.org/]Forum[/url] | [url=http://dl01.asri-education.org/]Dépôt[/url] | [url=http://kids.asri-education.org/]Espace kids[/url]

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#321 Post by Argolance »

Bonjour,
When trying to load an SFS file that is different but has the same name of an already loaded SFS file, SFS_load says this SFS is already loaded and asks user if he wants to unload it.
If user wants to load the new one and then to copy or to move it to /initrd/mnt/dev_save, SFS_load just says SFS file "was found" but does not allow user to choose if he wants to keep the old one or to overwrite it with the new one.
Is it silly or could the script be modified beneficially in this way? I tried to test/do this myself but am a bit afraid to break something so much the script is complicated for me :oops: .

Cordialement.

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

#322 Post by musher0 »

Bonjour Argolance.

It could be a simple matter of adding a check in the script for size and/or date of the
sfs file.

But I think it is Linux itself (and maybe all OS's) that cannot handle two files of the same
name at the same time. This is a good way to confuse the system, let alone sfs-load.
First trick explained in The Hacker's Book, I think.

A question, though: if you're using sfs-load and you get that message, does that means
that you have already and gleefully squished the existing sfs by the same name? :)

This situation happens every second month with java JRE for example :
someone does a new sfs for the new java JRE, we unload the old one and we load
the new one. Simple. But of course the javas don't have the same version number.

À plus tard.

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

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#323 Post by Argolance »

Bonjour,
Thanks for replying, dear musher0 :wink:
musher0 wrote:cannot handle two files of the same name at the same time.
I obviously do not intend to let user load two sfs files with the same name at the same time (for that strange purpose - probably useless - it is enough to name both differently), just replace the "old" one by the "new" one, which should be loaded at next startup. When SFS file is already present in /initrd/mnt/dev_save, SFS_load doesn't replace the old one with the new one, it just says that SFS file "was found" but keeps the old one that will be loaded at next startup anyway. If user chooses not to copy/move the SFS file to /initrd/mnt/dev_save, so there is no problem because the SFS file is directly loaded from the Downloads directory and the new one will be loaded at next startup. If it could be possible with moved/copied SFS files, using a dialog box prompting user if he wants or not do the overwriting, I think it would be convenient.

Cordialement.

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

#324 Post by musher0 »

Hello again, Argolance.

Je crois que ç'a à voir avec les couches / I think it has to do with the layers.
and you can't change an active layer mounted at /initrd/pup_ro-something without
un-mounting it first.

This layer is active, so removing it while it is active would be like cutting the branch
you are sitting on. The system will not let you do it.

On the other hand,

Code: Select all

more /initrd/tmp/EXTRASFSS
will tell you which sfs's are loaded at the moment in your Puppy, therefore which sfs
you must unload before mounting the new sfs.

From that list, it should be possible to write a script to
  • -- compare the names of the sfs's
    -- unmount the old sfs and
    -- mount the new one directly --
carefully, possibly bypassing sfs_load entirely.
(Not sure about this "bypassing").

Just a thought. / Une idée comme ça.
It needs testing, validation, of course -- and probably multiple checks in the script
in order not to "break" your system.

Autrement tu te retrouveras le bec à l'eau. / Otherwise you'll be left high and dry.

À+

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

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#325 Post by Argolance »

[EDIT]
Bonsoir,
Thank you musher0.
This layer is active, so removing it while it is active would be like cutting the branch you are sitting on. The system will not let you do it.
:?: May be I am wrong, but you can delete a mounted SFS file and you will see that it will work properly during all the session because, as layer, it is not affected. The only difference is that it will not be mounted at next startup (with all the troubles this implies). Now, if you delete any file of the mounted SFS file with your file manager, Puppy will remember this and deleted files will not be present at next startup though the (new or old) SFS is duly mounted. Deletion affects the layer but not the SFS file itself (which is read-only anyway) and what could happen to the SFS file seems to be none of its business all long the session.
Autrement tu te retrouveras le bec à l'eau.
Not sure: I really think replacing an SFS with another one is possible while it is currently mounted (it is what my little experiment tends to "prove": I did it manually with my devx file and even with my main ToOpPy sfs file during all my tests and at next startup, as far as I know, all works fine). So, I admit I would like to have (also) the opinion of another "leading light" of the forum and learn, if "feasible", how to modify the SFS_load script properly, using some added command lines inside and with all the required precautions!

To sum up: I download a SFS file that has the same name as a SFS file present (loaded/mounted or not) in /initrd/mnt/dev_save. If I try to install/load the new SFS, 2 cases:
  • - if already mounted, SFS_load asks me if I want to unload it. So, I unload it, then I click the new one, choose "Install SFS", SFS_load says he found it, then doesn't load the new one but reload the old one.
    - if not loaded/mounted, SFS_load says he found it and so on... :(
I just would like the old one to be replaced by the new one and not to have to do it manually..

Suggestion: the button "Install SFS" should be labeled "Un/Install SFS" because user can uninstall/unload any SFS file this way too.

Cordialement.
Last edited by Argolance on Sun 23 Aug 2015, 09:34, edited 5 times in total.

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

#326 Post by musher0 »

Hello Argolance.

Moi, a "leading light" among Puppyists?! Wow, that really is flattery! You must have a
favor to ask me! ;) :D

I find you courageous to change the devx file "in vivo". I know that I wouldn't risk it! :)
If it works, bravo!

I did follow your reasoning, and I think it makes sense, but I am more conservative
than you are, so I'll stick with the traditional procedure for changing sfs's.

However, this may be of interest to you:

I remember that on another thread (mais lequel dans le capharnaüm du forum ! / but
which one in this mess of a forum! ) mikeb (I think) had found a way to change
pupsaves without exiting the Puppy. I guess that what you are seeking is along those
lines. If he could do it with a pupsave, why not with a regular sfs?

The trick, if I remember correctly, was to be in the main puppy sfs (probably in urxvt)
when doing the change. He had various pupsaves in the form of pup_rw directories
neatly stored on /mnt/home. He would erase the current /initrd/pup_rw and copy another
one in its place. And vroom, he had another flavor of the Puppy at his fingertips.

I don't know if this helps, but there you have it!

Bye for now / À+

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

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#327 Post by Argolance »

I find you courageous to change the devx file "in vivo". I know that I wouldn't risk it! Smile
If it works, bravo!
Je n'y suis pour rien: tout le mérite en revient à Puppy et son génial système de fichiers à couches! :wink:
I updated my post above to make my question more understandable.

No answer: silly/untoward question? :roll:

Cordialement.

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#328 Post by Argolance »

Hello,
No answer: silly/untoward question?
:cry:
Note: the suggestion above is about filemount and has nothing to do here with SFS_load.

Cordialement.

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

#329 Post by musher0 »

Ahem. That statement is illogical: the file system in the sfs file has to be mounted to
be of any benefit to the user.

Without filemount, no sfs. Oh, the sfs will exist, but as I said, it won't be of any benefit.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#330 Post by Argolance »

Suggestion: the button "Install SFS" [of filemount] should be labeled "Un/Install SFS" because user can uninstall/unload any SFS file this way too,

User avatar
ASRI éducation
Posts: 3197
Joined: Sat 09 May 2009, 12:10
Location: France
Contact:

#331 Post by ASRI éducation »

Argolance wrote:
Suggestion: the button "Install SFS" [of filemount] should be labeled "Un/Install SFS" because user can uninstall/unload any SFS file this way too,
This is done for several months.
https://github.com/puppylinux-woof-CE/w ... 3a067b4c00
https://github.com/puppylinux-woof-CE/w ... a30efa84d1
Regards,
Projet ASRI éducation => [url=http://asri-education.org/]Association[/url] | [url=http://forum.asri-education.org/]Forum[/url] | [url=http://dl01.asri-education.org/]Dépôt[/url] | [url=http://kids.asri-education.org/]Espace kids[/url]

User avatar
Iguleder
Posts: 2026
Joined: Tue 11 Aug 2009, 09:36
Location: Israel, somewhere in the beautiful desert
Contact:

#332 Post by Iguleder »

There's a bug in sfs_load - it should obtain the numeric kernel version using `uname -r | cut -f 1 -d \-`. Otherwise, it doesn't work at all with kernels that have an extra version string.
[url=http://dimakrasner.com/]My homepage[/url]
[url=https://github.com/dimkr]My GitHub profile[/url]

User avatar
ASRI éducation
Posts: 3197
Joined: Sat 09 May 2009, 12:10
Location: France
Contact:

#333 Post by ASRI éducation »

Iguleder wrote:There's a bug in sfs_load - it should obtain the numeric kernel version using `uname -r | cut -f 1 -d \-`. Otherwise, it doesn't work at all with kernels that have an extra version string.
Yes, need to replace:
KERNVER="`uname -r`"
by
KERNVER="`uname -r | cut -f 1 -d \-`"

Thank you.
Projet ASRI éducation => [url=http://asri-education.org/]Association[/url] | [url=http://forum.asri-education.org/]Forum[/url] | [url=http://dl01.asri-education.org/]Dépôt[/url] | [url=http://kids.asri-education.org/]Espace kids[/url]

User avatar
ASRI éducation
Posts: 3197
Joined: Sat 09 May 2009, 12:10
Location: France
Contact:

#334 Post by ASRI éducation »

sfs_load-2.3.3

I incorporated:
- sfs_load-2.3 (by shinobar)
- sfs_load-2.3.0 (by ASRI)
- sfs_load-2.3.2 (by mavrothal)
- improve kernel detection KERNVER (by Iguleder)

Regards,
Attachments
sfs_load-2.3.3.jpg
(47.22 KiB) Downloaded 915 times
sfs_load-2.3.3.pet
(34.12 KiB) Downloaded 412 times
Last edited by ASRI éducation on Sun 04 Oct 2015, 19:14, edited 1 time in total.
Projet ASRI éducation => [url=http://asri-education.org/]Association[/url] | [url=http://forum.asri-education.org/]Forum[/url] | [url=http://dl01.asri-education.org/]Dépôt[/url] | [url=http://kids.asri-education.org/]Espace kids[/url]

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

#335 Post by musher0 »

ASRI éducation wrote:sfs_load-2.3.3

This version is based on:
- sfs_load-2.3 (by shinobar)
- sfs_load-2.3.0 (by ASRI)
- sfs_load-2.3.2 (by mavrothal)
- improve kernel detection KERNVER (by Iguleder)

Regards,
Hello, ASRI.

Sorry, I have to translate to understand... "Based on", you mean
"incorporates", right?

Also, if you could kindly look over the translation I made for 01micko's
change-kernels script. It's in that thread.

I translated to "international French", but I'd like to have an European
editor go over it, to make double sure there are no "canadianisms". If
you can't, that's fine, I'll ask someone else.

Thanks.

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

Post Reply