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 Sun 28 May 2017, 18:34
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
Replace your savefile/folder with an sfs storage file
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 2 of 5 [70 Posts]   Goto page: Previous 1, 2, 3, 4, 5 Next
Author Message
nic007


Joined: 13 Nov 2011
Posts: 1995
Location: Cradle of Humankind

PostPosted: Fri 24 Feb 2017, 07:22    Post subject:  

backi wrote:
Hi nic007 !

Your elegant Script answers a lot of Questions mentioned here on this Thread :

http://www.murga-linux.com/puppy/viewtopic.php?t=109585

Cheers ! Smile

Don't know about elegant but I'm glad it works for you. Smile
Back to top
View user's profile Send private message 
backi

Joined: 27 Feb 2011
Posts: 1029
Location: GERMANY

PostPosted: Fri 24 Feb 2017, 08:40    Post subject:  

Hi nic007 !

Quote:
Well, not so sophisticated but useful nevertheless. Just to add - if you have a savefile or savefolder, the script will include that data in the created sfs file (less browser cache and trash items, etc. unless you want to keep it). After running the script, you can rename your existing savefile/folder so that it doesn't load at next boot. If you are happy with the result you can delete the savefile/folder and never use one again. The script is an EXAMPLE and you need to adapt it according to your setup and needs.


How to accomplish including Savefile or Savefolder ..
As far as i understood your Script does not work/create adrv.sfs when Save/File/Folder is loaded at bootup .?
Back to top
View user's profile Send private message 
nic007


Joined: 13 Nov 2011
Posts: 1995
Location: Cradle of Humankind

PostPosted: Fri 24 Feb 2017, 09:14    Post subject:  

backi wrote:
Hi nic007 !

Quote:
Well, not so sophisticated but useful nevertheless. Just to add - if you have a savefile or savefolder, the script will include that data in the created sfs file (less browser cache and trash items, etc. unless you want to keep it). After running the script, you can rename your existing savefile/folder so that it doesn't load at next boot. If you are happy with the result you can delete the savefile/folder and never use one again. The script is an EXAMPLE and you need to adapt it according to your setup and needs.


How to accomplish including Savefile or Savefolder ..
As far as i understood your Script does not work/create adrv.sfs when Save/File/Folder is loaded at bootup .?

Same script should work if you make sure the paths are correct. If your savefile/folder is big though, it's going to take longer to create the adrv to include that data.
Back to top
View user's profile Send private message 
backi

Joined: 27 Feb 2011
Posts: 1029
Location: GERMANY

PostPosted: Fri 24 Feb 2017, 09:35    Post subject:  

Thanks man Smile

I think your cool Script should not get lost in somewhere in the Nowhere-Depths of the Forum .
Back to top
View user's profile Send private message 
backi

Joined: 27 Feb 2011
Posts: 1029
Location: GERMANY

PostPosted: Fri 24 Feb 2017, 10:30    Post subject:  

Sorry for steeling your precious time nic007 .

But tried with loaded SaveFOLDER at startup .......in this case the "puppyfilesystem" will not be created ....so no adrv.sfs .

Booting without SaveFOLDER loaded .........in this case the "puppyfilesystem" will e created ....so the adrv.sfs .
Back to top
View user's profile Send private message 
backi

Joined: 27 Feb 2011
Posts: 1029
Location: GERMANY

PostPosted: Fri 24 Feb 2017, 10:46    Post subject:  

Another observation is .....when starting fresh or booting with pfix=ram frugally from Usb-Stick ......If Usb-stick is not mounted .
When executing your script it does not work until Usb-Stick is mounted manually .
Back to top
View user's profile Send private message 
nic007


Joined: 13 Nov 2011
Posts: 1995
Location: Cradle of Humankind

PostPosted: Fri 24 Feb 2017, 12:37    Post subject:  

backi wrote:
Sorry for steeling your precious time nic007 .

But tried with loaded SaveFOLDER at startup .......in this case the "puppyfilesystem" will not be created ....so no adrv.sfs .

Booting without SaveFOLDER loaded .........in this case the "puppyfilesystem" will e created ....so the adrv.sfs .

The directories when you boot with a savefolder and when you boot without savefolder may be different. Booting with a savefile/folder may give you a mnt/home directory. Check and change the script accordingly. Your stck must be mounted because you are writing data to the stick.
Back to top
View user's profile Send private message 
backi

Joined: 27 Feb 2011
Posts: 1029
Location: GERMANY

PostPosted: Fri 24 Feb 2017, 13:37    Post subject:  

When booting with Savefolder loaded at bootup
I replaced in my case sdb1 with home in the script ....now adrive will be created .
But looking in puppyfilesystem Folder in Usb Stick alot of Directories are missing opt for example
Creating the adrive is happening after modifying my script but a lot of .....Rebooted
but it seems it will not work correctly . Seems it will not work with loaded Savefolder as a kind of saving or remastering the whole running System into an adrive .
Maybe one have to copy Folder root and Folder etc into tmp as in the remaster procedure .
Back to top
View user's profile Send private message 
nic007


Joined: 13 Nov 2011
Posts: 1995
Location: Cradle of Humankind

PostPosted: Fri 24 Feb 2017, 13:57    Post subject:  

backi wrote:
When booting with Savefolder loaded at bootup
I replaced in my case sdb1 with home in the script ....now adrive will be created .
But looking in puppyfilesystem Folder in Usb Stick alot of Directories are missing opt for example
Creating the adrive is happening after modifying my script but a lot of .....Rebooted
but it seems it will not work correctly . Seems it will not work with loaded Savefolder as a kind of saving or remastering the whole running System into an adrive .
Maybe one have to copy Folder root and Folder etc into tmp as in the remaster procedure .

How did you install your programs, are you using any sfs-addons? This script only includes stuff that were installed to savefile/savefolder
Back to top
View user's profile Send private message 
backi

Joined: 27 Feb 2011
Posts: 1029
Location: GERMANY

PostPosted: Fri 24 Feb 2017, 15:07    Post subject:  

Thanks for your support .
But for me it seems not to work with a Savefolder loaded at Startup.....for what reason ever .In the moment i find it to complicated to research deeper into this type of Replacement for a Savefolder .
On the first sight looked like an easy alternative for a Save/folder/file... but seems not to work the way i expected ....its not your fault .

I myself don`t have any Problems with Save File/Folder ......nevertheless ....find your script quite interesting .
Back to top
View user's profile Send private message 
gyro

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

PostPosted: Fri 24 Feb 2017, 15:20    Post subject:  

backi wrote:
title Puppy tahr 6.0.6 (sdb1)
find --set-root --ignore-floppies --ignore-cd /puppy_tahr_6.0.6.sfs
kernel /vmlinuz pmedia=usbflash pfix=fsck,nocopy
initrd /initrd.gz
I'm surprised that the script works reliably with "pfix=nocopy" in the boot entry.

Usually the "init" script copies these sfs files into a tmpfs in ram and uses those. So the adrv on disk is not in use and so can be deleted and recreated, and the affect is not seen until the next boot.

But, with "pfix=nocopy", these sfs files are not copied and the ones on disk are mounted and active in the aufs stack. So I'm surprised that deleting and re-creating such a file works reliably.

But hey, if it works for you, go for it.

Hmm.., you could be saved by Unix/Linux.
An open file can be "deleted" and the process retains access to the file via it's "inode" until it closes the file, only then does the file actually go away.
So perhaps the aufs stack continues to use the "deleted" copy of the adrv file.

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


Joined: 12 Jun 2015
Posts: 125
Location: In the peninsula shaped like a boot.

PostPosted: Fri 24 Feb 2017, 15:22    Post subject:  

Hi all, following my experience about:

Puppy booted from USB key with savefolder:

Code:
#!/bin/sh
mkdir /mnt/home/puppyfilesystem
cp -a /initrd/pup_ro1/* /initrd/pup_rw/*  /mnt/home/puppyfilesystem
wait
cd /mnt/home/puppyfilesystem
rm -r ./tmp ./mnt ./initrd ./sys ./root/.cache/* ./root/.thumbnails/* ./root/.Trash/* ./root/.XLOADED ./var/log
wait
Xdialog -center -msgbox "Puppyfilesystem ready.  Check and edit if needed.  Press OK to proceed" 0 0
rm /mnt/home/tahr64/adrv_tahr64_6.0.5.sfs
mksquashfs /mnt/home/puppyfilesystem /mnt/home/tahr64/adrv_tahr64_6.0.5.sfs -comp xz
rm -r /mnt/home/puppyfilesystem

exit


"adrv" created successfully, in my case 18MB in 10 seconds.

Rebooted and reloaded puppy with pfix=ram, during boot "adrv" loaded with success, mounted sdb1 (my USB stick) and renamed my savefolder "1tahr64save".

At this point I changed again nic007's script in order to save any changes.

Code:
#!/bin/sh
mkdir /mnt/sdb1/puppyfilesystem
cp -a /initrd/pup_a/* /initrd/pup_rw/*  /mnt/sdb1/puppyfilesystem
wait
cd /mnt/sdb1/puppyfilesystem
rm -r ./tmp ./mnt ./initrd ./sys ./root/.cache/* ./root/.thumbnails/* ./root/.Trash/* ./root/.XLOADED ./var/log
wait
Xdialog -center -msgbox "Puppyfilesystem ready.  Check and edit if needed.  Press OK to proceed" 0 0
rm /mnt/sdb1/tahr64/adrv_tahr64_6.0.5.sfs
mksquashfs /mnt/sdb1/puppyfilesystem /mnt/sdb1/tahr64/adrv_tahr64_6.0.5.sfs -comp xz
rm -r /mnt/sdb1/puppyfilesystem

exit


The only drawback with this method is that you have to load on the fly your .sfs file and configuring them each time.

Thank's for your work nic007 much appreciated.

_________________
Hoc unum scio, me nihil scire. Socrate

Last edited by corvus on Fri 24 Feb 2017, 15:41; edited 1 time in total
Back to top
View user's profile Send private message 
nic007


Joined: 13 Nov 2011
Posts: 1995
Location: Cradle of Humankind

PostPosted: Fri 24 Feb 2017, 15:32    Post subject:  

backi wrote:
Thanks for your support .
But for me it seems not to work with a Savefolder loaded at Startup.....for what reason ever .In the moment i find it to complicated to research deeper into this type of Replacement for a Savefolder .
On the first sight looked like an easy alternative for a Save/folder/file... but seems not to work the way i expected ....its not your fault .

I myself don`t have any Problems with Save File/Folder ......nevertheless ....find your script quite interesting .

Do a proper remaster and then use the script from then on to record your changes in future. The other thing is that this should definitely work with a current savefile, perhaps the same can not be achieved with a savefolder (although I can not see why not). This is not a remaster script as such that's why I asked the questions. I don't install anything but use sfs add-ons instead. So I have the base sfs, sfs-addons (additional programs) which gets loaded automatically at boot and then my adrv with personal changes (about 5MB). Personally I hate big savefile/folders but some like them. Works a treat for me but each to their own.

BTW - I seem to remember from long ago when I still did remasters that somehow /opt (normally the java installation) does not copy from /initrd/pup_rw so you will have to copy it from the main running system located at /opt if you want to save that data from your savefolder to your adrv. You only need to do this once of course.

Last edited by nic007 on Fri 24 Feb 2017, 17:29; edited 1 time in total
Back to top
View user's profile Send private message 
nic007


Joined: 13 Nov 2011
Posts: 1995
Location: Cradle of Humankind

PostPosted: Fri 24 Feb 2017, 17:14    Post subject:  

corvus wrote:
Hi all, following my experience about:

Puppy booted from USB key with savefolder:

Code:
#!/bin/sh
mkdir /mnt/home/puppyfilesystem
cp -a /initrd/pup_ro1/* /initrd/pup_rw/*  /mnt/home/puppyfilesystem
wait
cd /mnt/home/puppyfilesystem
rm -r ./tmp ./mnt ./initrd ./sys ./root/.cache/* ./root/.thumbnails/* ./root/.Trash/* ./root/.XLOADED ./var/log
wait
Xdialog -center -msgbox "Puppyfilesystem ready.  Check and edit if needed.  Press OK to proceed" 0 0
rm /mnt/home/tahr64/adrv_tahr64_6.0.5.sfs
mksquashfs /mnt/home/puppyfilesystem /mnt/home/tahr64/adrv_tahr64_6.0.5.sfs -comp xz
rm -r /mnt/home/puppyfilesystem

exit


"adrv" created successfully, in my case 18MB in 10 seconds.

Rebooted and reloaded puppy with pfix=ram, during boot "adrv" loaded with success, mounted sdb1 (my USB stick) and renamed my savefolder "1tahr64save".

At this point I changed again nic007's script in order to save any changes.

Code:
#!/bin/sh
mkdir /mnt/sdb1/puppyfilesystem
cp -a /initrd/pup_a/* /initrd/pup_rw/*  /mnt/sdb1/puppyfilesystem
wait
cd /mnt/sdb1/puppyfilesystem
rm -r ./tmp ./mnt ./initrd ./sys ./root/.cache/* ./root/.thumbnails/* ./root/.Trash/* ./root/.XLOADED ./var/log
wait
Xdialog -center -msgbox "Puppyfilesystem ready.  Check and edit if needed.  Press OK to proceed" 0 0
rm /mnt/sdb1/tahr64/adrv_tahr64_6.0.5.sfs
mksquashfs /mnt/sdb1/puppyfilesystem /mnt/sdb1/tahr64/adrv_tahr64_6.0.5.sfs -comp xz
rm -r /mnt/sdb1/puppyfilesystem

exit


The only drawback with this method is that you have to load on the fly your .sfs file and configuring them each time.

Thank's for your work nic007 much appreciated.


Put your sfs-addons in your ydrv like I do and/or add to your zdrv so they are loaded automatically at startup OR load them automatically by way of including a command in /etc/rc.d/rc.local. Smile
BTW - Why did you include /initrd/pup_ro1 in your first script?
Back to top
View user's profile Send private message 
corvus


Joined: 12 Jun 2015
Posts: 125
Location: In the peninsula shaped like a boot.

PostPosted: Fri 24 Feb 2017, 19:05    Post subject:  

nic007 wrote:
BTW - Why did you include /initrd/pup_ro1 in your first script?

Because I want to include my savefolder stuff in "adrv" and when I run puppy with savefolder /initrd/pup_a/ is only an empty folder as shown in screenshot 1, the savefolder stuff are stored in /initrd/mnt/dev_save/tahr64/tahr64save and /initrd/pup_ro1 is a symlink to that folder as shown in screenshot 2.
Screenshot_1.png
 Description   
 Filesize   28.65 KB
 Viewed   94 Time(s)

Screenshot_1.png

Screenshot_2.png
 Description   
 Filesize   22.94 KB
 Viewed   93 Time(s)

Screenshot_2.png


_________________
Hoc unum scio, me nihil scire. Socrate
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 2 of 5 [70 Posts]   Goto page: Previous 1, 2, 3, 4, 5 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » HOWTO ( Solutions )
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.2828s ][ Queries: 14 (0.0128s) ][ GZIP on ]