sfs_load-2.4 on-the-fly
- Argolance
- Posts: 3767
- Joined: Sun 06 Jan 2008, 22:57
- Location: PORT-BRILLET (Mayenne - France)
- Contact:
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 .
Cordialement.
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 .
Cordialement.
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
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)
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
- Argolance
- Posts: 3767
- Joined: Sun 06 Jan 2008, 22:57
- Location: PORT-BRILLET (Mayenne - France)
- Contact:
Bonjour,
Thanks for replying, dear musher0
Cordialement.
Thanks for replying, dear musher0
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.musher0 wrote:cannot handle two files of the same name at the same time.
Cordialement.
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,
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
(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
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
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 --
(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)
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
- Argolance
- Posts: 3767
- Joined: Sun 06 Jan 2008, 22:57
- Location: PORT-BRILLET (Mayenne - France)
- Contact:
[EDIT]
Bonsoir,
Thank you musher0.
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:
Suggestion: the button "Install SFS" should be labeled "Un/Install SFS" because user can uninstall/unload any SFS file this way too.
Cordialement.
Bonsoir,
Thank you musher0.
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.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.
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!Autrement tu te retrouveras le bec à l'eau.
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...
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.
Hello Argolance.
Moi, a "leading light" among Puppyists?! Wow, that really is flattery! You must have a
favor to ask me!
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
Moi, a "leading light" among Puppyists?! Wow, that really is flattery! You must have a
favor to ask me!
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)
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
- Argolance
- Posts: 3767
- Joined: Sun 06 Jan 2008, 22:57
- Location: PORT-BRILLET (Mayenne - France)
- Contact:
Je n'y suis pour rien: tout le mérite en revient à Puppy et son génial système de fichiers à couches!I find you courageous to change the devx file "in vivo". I know that I wouldn't risk it! Smile
If it works, bravo!
I updated my post above to make my question more understandable.
No answer: silly/untoward question?
Cordialement.
- ASRI éducation
- Posts: 3197
- Joined: Sat 09 May 2009, 12:10
- Location: France
- Contact:
This is done for several months.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,
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]
- ASRI éducation
- Posts: 3197
- Joined: Sat 09 May 2009, 12:10
- Location: France
- Contact:
Yes, need to replace: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.
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]
- ASRI éducation
- Posts: 3197
- Joined: Sat 09 May 2009, 12:10
- Location: France
- Contact:
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,
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 420 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]
Hello, ASRI.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,
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)
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
- ASRI éducation
- Posts: 3197
- Joined: Sat 09 May 2009, 12:10
- Location: France
- Contact:
That's it.musher0 wrote:Sorry, I have to translate to understand... "Based on", you mean "incorporates", right?
Thank you for pointing that out, I'll edit my previous message.
I just do it, everything seems ok.musher0 wrote:look over the translation I made for 01micko's
change-kernels script. It's in that thread
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]
As reported sfs_load in PUPMODE=5 fails to install as SFS saved in /tmp (ok when saved in other locations)
The problem is that the union (re)mount fails in this case. I think that this may be the expected behavior of aufs but it needs further investigation.
Till then the attached patch stops sfs_load from loading an SFS from /tmp or suggesting to copy it there when running in pupmode 5
The patch is against ASRI's 2.3.3 but should work in other versions too.
Since the forum may add spaces at the end of the lines, it is also attached below.
The problem is that the union (re)mount fails in this case. I think that this may be the expected behavior of aufs but it needs further investigation.
Till then the attached patch stops sfs_load from loading an SFS from /tmp or suggesting to copy it there when running in pupmode 5
The patch is against ASRI's 2.3.3 but should work in other versions too.
Code: Select all
--- a/usr/sbin/sfs_load 2015-10-04 15:25:30.000000000 +0300
+++ b/usr/sbin/sfs_load 2015-10-09 11:45:01.760463314 +0300
@@ -885,7 +885,7 @@
local TOPPART="$1"
# Offer RAM only if enough
RAMPART=""
- if [ "$FILEISAT" != "tmpfs" -a "$FILEISAT" != "ata" ]; then
+ if [ "$FILEISAT" != "tmpfs" -a "$FILEISAT" != "ata" -a "$PUPMODE" != "5" ]; then
RAMPART=$(echo "RAM|($(gettext "Available"):$(kbyte2 $RFREE))"|tr ' ' '_')
REST=$(($RFREE - $FILESIZE))
if [ $REST -gt $RESERVRAM ]; then
@@ -1697,7 +1697,7 @@
DIRNAME=$(dirname "$EXTRASFS")
FILENAME=$(basename "$EXTRASFS")
#if echo "$DIRNAME" | grep -qw '/tmp$' || [ "$(df "$DIRNAME" | tail -n 1 | cut -d ' ' -f1)" = "tmpfs" ]; then
- if [ "$(df "$DIRNAME" | tail -n 1 | cut -d ' ' -f1)" = "tmpfs" ]; then
+ if [ "$(df "$DIRNAME" | tail -n 1 | cut -d ' ' -f1)" = "tmpfs" -a "$PUPMODE" != "5" ]; then
rm -f "$EXTRASFS"
RMLOG=$(printf "$(gettext "The temporary file '%s' is deleted.")" "$EXTRASFS")
FOUND=""
@@ -1734,6 +1734,14 @@
basename "$0" | grep -q '^un' && ACTION="unload"
[ "$DISPLAY" != "" ] && GUI="y"
basename "$0" | grep -q 'debug' && DEBUGFLAG="y" # v1.3.9
+
+# Temp work around. Do not mount SFS from /tmp when running in pupmode 5
+. /etc/rc.d/PUPSTATE
+if [ "$(echo $ORGOPT | cut -f2 -d/)" = "tmp" -a "$PUPMODE" = "5" ]; then
+ Xdialog --title "$(gettext 'Error')" --msgbox \
+ "$(gettext 'You can not install an SFS saved in the /tmp directory \nwhen running in PUPMODE=5')" 0 0
+ exit 0
+fi
#v1.9.2: allow --skip-fixmenus with multiple files
while [ "$1" ] ; do
case "$1" in
- Attachments
-
- sfs_load.patch.gz
- Patch to stop loading SFSs saved in /tmp when running in PUPMODE=5
- (842 Bytes) Downloaded 344 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] ==
- ASRI éducation
- Posts: 3197
- Joined: Sat 09 May 2009, 12:10
- Location: France
- Contact:
Thank you for the patch (sfs_load.patch.gz).mavrothal wrote:sfs_load in PUPMODE=5 fails to install as SFS saved in /tmp (ok when saved in other locations)
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]
Is there a way to launch an sfs file with this :
And then have a box that say "The software is launching" and then launch the software ?
I want to do this because i found annoying to click on x box to launch an sfs file .
Code: Select all
sfs_load -c -q xxx.sfs
I want to do this because i found annoying to click on x box to launch an sfs file .
My script to load the wine sfs and then run irfanview called from a desktop file:jplt wrote:Is there a way to launch an sfs file with this :
And then have a box that say "The software is launching" and then launch the software ?Code: Select all
sfs_load -c -q xxx.sfs
I want to do this because i found annoying to click on x box to launch an sfs file .
Code: Select all
#!/bin/sh
# Purpose: To convert Linux-style filename to Windows-style
# to pass as an argument to Irfanview within wine
sfs_load -n -c wine.sfs
Filename=${1//\//\\}
wine "C:\Program Files\IrfanView\i_view32.exe" "$Filename"
sleep 8
sfs_load -n -c -wine.sfs
sfs_load -n -c -wine.sfs &
LxPup = Puppy + LXDE
Main version used daily: LxPupSc; Assembler of UPups, ScPup & ScPup64, LxPup, LxPupSc & LxPupSc64
Main version used daily: LxPupSc; Assembler of UPups, ScPup & ScPup64, LxPup, LxPupSc & LxPupSc64