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 1 of 5 [70 Posts]   Goto page: 1, 2, 3, 4, 5 Next
Author Message
nic007


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

PostPosted: Wed 22 Feb 2017, 07:17    Post subject:  Replace your savefile/folder with an sfs storage file  

I haven't been using a savefile/folder for ages, instead I save my changes to an sfs file. Some advantages: save at anytime you choose, read-only so chances of corruption small, small in size (data compressed). Note that the working directory for creating/editing the sfs file must be in a linux environment, eg. linux partition.

METHOD:
1. With your savefile/folder loaded run the example script below. You need to edit the directory paths and filenames in the script according to your setup if necessary. You can also run the script if you do not have an existing savefile/folder (edit the paths)
2. Your new sfs containing the contents of your savefile/folder (minus a few things excluded by the script) should now be created, check if it's there.
3. Rename your existing savefile/folder to something like 1save.
4. Select reboot from menu. Do not create a new savefile/folder. Your newly created sfs with your saved data should be loaded automatically at startup.
5. After booting, edit the script so that it reflects the correct directory paths according to your setup. Whenever you want to save something in future just run the script again. You don't need a savefile/folder anymore.
6. Delete your old savefile/folder.

Code:
#!/bin/sh
alsactl store
mkdir /mnt/home/puppyfilesystem
cp -a /initrd/pup_a/* /initrd/pup_ro1/* /initrd/pup_rw/*  /mnt/home/puppyfilesystem
cd /mnt/home/puppyfilesystem
rm -r ./tmp ./mnt ./initrd ./sys ./root/cache/* ./root/.thumbnails/* ./root/.Trash/* ./root/.XLOADED ./var/log
Xdialog -center -msgbox "Puppyfilesystem ready.  Check and edit if needed.  Press OK to proceed" 0 0
mksquashfs /mnt/home/puppyfilesystem /mnt/home/puppy605/adrv_tahr_6.0.5.sfs -noappend
rm -r /mnt/home/puppyfilesystem
Xdialog -center -title "SUCCESS!!!"  --no-buttons -infobox "Operation completed, exiting now" 0 0 1000
   
exit



In the example above we create a new sfs file which we name and use as the adrv. Older puppy's do not operate with an adrv but we can still achieve the end goal with a bit of manipulation. So if you have an older puppy do these three steps first:
a) Rename your base sfs to that of a zdrv, eg. zdrv_racy_5.5.sfs
b) Create an empty SFS-file and rename it to that of the original base sfs, eg. puppy_racy_5.5.sfs and place it in your puppy directory together with the zdrv
c) Reboot with your savefile/folder

Proceed by following the same method as stipulated in the beginning of this post but use the following example script instead.

Code:
#!/bin/sh
alsactl store
mkdir /mnt/home/puppyfilesystem
cp -a /initrd/pup_ro2/* /initrd/pup_ro1/* /initrd/pup_rw/*  /mnt/home/puppyfilesystem
cd /mnt/home/puppyfilesystem
rm -r ./tmp ./initrd ./mnt ./sys ./root/.Trash/* ./root/cache/* ./etc/.XLOADED ./var/log
Xdialog -center -msgbox "Puppyfilesystem ready. Check and edit if needed. Press OK when ready" 0 0
mksquashfs /mnt/home/puppyfilesystem /mnt/home/puppy550/puppy_racy_5.5.sfs -noappend
rm -r /mnt/home/puppyfilesystem
Xdialog -center -title "SUCCESS!!!"  --no-buttons -infobox "Operation completed, exiting now" 0 0 1000
   
exit


ADDITIONAL INFORMATION /TIPS:
- This method works best if you keep your sfs file with changes small. It is recommended to only save your personal settings and other small system changes with this method. Instead of installing programs, rather use sfs-addons. These additional sfs's can easily be loaded at startup with a simple command, eg: include the command, sfs_load -c -q /PathofSFStoLoad/NameOfSFS.sfs, in /etc/rc.d/rc.local OR you can load it on the fly during a session.
- If you have a big, existing savefolder/file (perhaps with programs already installed), the best would be to do a complete remaster first and then proceed with the method described here. Alternatively (if you have a newer puppy which support the ydrv) you can run the first script in this post and rename the resulting sfs to that of the ydrv, eg: ydrv_tahr_6.0.5.sfs. The ydrv will be loaded automatically at startup. Thereafter you can proceed with the method of creating an adrv for your personal settings as suggested.
- Omit the Xdialog check/edit prompt in the script if not required.
- The script can be run at anytime you want to save changes (I have an icon on the desktop). If you want to save automatically at reboot/shutdown do this: Rename the shutdownconfig script in /usr/sbin to something like shutdownconfig1 (keep as backup of the original) > copy the script in this post to /usr/sbin and rename it shutdownconfig.
- Your sfs file containing your changes is read-only (unlike a savefile/folder which is read and write). The result is that you can add new folders/files to the running filesystem and edit existing files during a session and this will automatically be recorded when you save to the sfs. If, however you want to delete folders/files you will need to delete them by editing the sfs (which option is available when running the script).

Last edited by nic007 on Thu 13 Apr 2017, 11:16; edited 18 times in total
Back to top
View user's profile Send private message 
backi

Joined: 27 Feb 2011
Posts: 1029
Location: GERMANY

PostPosted: Wed 22 Feb 2017, 09:38    Post subject:  

Hi di ho nic007 !

I am quite interested .
Do not exactly understand how this works .......could you explain a bit further ....
for dummies .... Do i only have to execute your script ? .......
How to save ?

I am using Tahrpup 6.0.6 with a Save-Folder on Usb-Flash .Would be helpful for me and others if you could give an example how to proceed .
Thank you in Advance .
Back to top
View user's profile Send private message 
nic007


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

PostPosted: Wed 22 Feb 2017, 11:16    Post subject:  

Hi, backi

The script saves your changes to an sfs file (the adrv in this case) and replaces the usage of a savefile or savefolder.

Do you need your current savings to your savefolder to be included or do you want to start afresh? How big is your savefolder currently? This works well if you want to keep your file with the changes very small.
Back to top
View user's profile Send private message 
backi

Joined: 27 Feb 2011
Posts: 1029
Location: GERMANY

PostPosted: Wed 22 Feb 2017, 11:39    Post subject:  

I want my current savefolder included . My Save-Folder is 125 megabytes.
I am running in pupmode=13 .......if this has any meaning .

You would do me a big favor if you fill your script with the components that fit to my TahrPup 6.0.6 with Save-Folder named tahrsave-1 on a Usb-Flash (sdb1 ? ).
Maybe i did not correctly re-named something .

This is my "modified " script .

#!/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/puppy606/adrv_tahr_6.0.6.sfs
mksquashfs /mnt/sdb1/puppyfilesystem /mnt/sdb1/puppy606/adrv_tahr_6.0.6.sfs -comp xz
rm -r /mnt/sdb1/puppyfilesystem

exit
Back to top
View user's profile Send private message 
nic007


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

PostPosted: Wed 22 Feb 2017, 11:57    Post subject:  

backi, it takes a bit of time to create an sfs file with that amount of data in your savefolder which may be a bit of a hassle. My setup works as follows: I do not install anything but use sfs-addons for additional programs, I do not include my browser cache or trash in my savings (my script clears these items). With this method you will make a new sfs file for your changes everytime you choose to do so, so best to keep it small. Decide if you still want to try it before I give further instructions.
Last edited by nic007 on Wed 22 Feb 2017, 12:03; edited 1 time in total
Back to top
View user's profile Send private message 
backi

Joined: 27 Feb 2011
Posts: 1029
Location: GERMANY

PostPosted: Wed 22 Feb 2017, 12:00    Post subject:  

Hi belham !

Did read your E-Mail !
Back to top
View user's profile Send private message 
backi

Joined: 27 Feb 2011
Posts: 1029
Location: GERMANY

PostPosted: Wed 22 Feb 2017, 12:10    Post subject:  

O.K nic007 !

So give me an example script related to my situation as described above if i want to start afresh .
Back to top
View user's profile Send private message 
nic007


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

PostPosted: Wed 22 Feb 2017, 12:38    Post subject:  

backi wrote:
O.K nic007 !

So give me an example script related to my situation as described above if i want to start afresh .

By afresh I mean starting without any savefile or savefolder and then using my metod further. Perhaps we should do it like this first so you can see how it works, so-
1. Rename your existing savefolder by putting a number at the beginning like 1tahrsave and reboot (without your savefolder)
2. Make some changes like changing the desktop background
3. Run the script and make sure the paths and filenames are correct according to your setup
4. An adrv with your changes should now be created
5. Reboot and check if the adrv loads as startup. You should see your changes.
Everytime you want to save changes, you run the script. That's basically it. BTW- When you restart/shutdown do not create a savefile or savefolder.
Back to top
View user's profile Send private message 
belham2

Joined: 15 Aug 2016
Posts: 687

PostPosted: Wed 22 Feb 2017, 13:02    Post subject:  

nic007 wrote:
backi wrote:
O.K nic007 !

So give me an example script related to my situation as described above if i want to start afresh .

By afresh I mean starting without any savefile or savefolder and then using my metod further. Perhaps we should do it like this first so you can see how it works, so-
1. Rename your existing savefolder by putting a number at the beginning like 1tahrsave and reboot (without your savefolder)
2. Make some changes like changing the desktop background
3. Run the script and make sure the paths and filenames are correct according to your setup
4. An adrv with your changes should now be created
5. Reboot and check if the adrv loads as startup. You should see your changes.
Everytime you want to save changes, you run the script. That's basically it. BTW- When you restart/shutdown do not create a savefile or savefolder.


Ah hah, that-----Rename your existing savefolder by putting a number at the beginning like 1tahrsave and reboot (without your savefolder)---is what I was messing up testing this. Thanks for this, Nic007, this is really useful as I have been trying to get away from savefiles (always remastering and/or now building Woof-CE creations with changes included).


P.S. Backi, I really had to, on testing this, cut the heck out of one of my savefiles on a fresh frugal install for this to work...as Nic007 said, he keeps it small, which is probably the best advice overall here. I'll have to remaste/build the browser and other large changes into the OS.
Back to top
View user's profile Send private message 
nic007


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

PostPosted: Wed 22 Feb 2017, 13:09    Post subject:  

belham2 wrote:
nic007 wrote:
backi wrote:
O.K nic007 !

So give me an example script related to my situation as described above if i want to start afresh .

By afresh I mean starting without any savefile or savefolder and then using my metod further. Perhaps we should do it like this first so you can see how it works, so-
1. Rename your existing savefolder by putting a number at the beginning like 1tahrsave and reboot (without your savefolder)
2. Make some changes like changing the desktop background
3. Run the script and make sure the paths and filenames are correct according to your setup
4. An adrv with your changes should now be created
5. Reboot and check if the adrv loads as startup. You should see your changes.
Everytime you want to save changes, you run the script. That's basically it. BTW- When you restart/shutdown do not create a savefile or savefolder.


Ah hah, that-----Rename your existing savefolder by putting a number at the beginning like 1tahrsave and reboot (without your savefolder)---is what I was messing up testing this. Thanks for this, Nic007, this is really useful as I have been trying to get away from savefiles (always remastering and/or now building Woof-CE creations with changes included).

You can of course delete your savefile/savefolder if you are happy with the method. We just kept the savefile/savefolder for testing purposes. So how did it go?
Back to top
View user's profile Send private message 
nic007


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

PostPosted: Wed 22 Feb 2017, 13:19    Post subject:  

belham2 wrote:
nic007 wrote:
backi wrote:
O.K nic007 !

So give me an example script related to my situation as described above if i want to start afresh .

By afresh I mean starting without any savefile or savefolder and then using my metod further. Perhaps we should do it like this first so you can see how it works, so-
1. Rename your existing savefolder by putting a number at the beginning like 1tahrsave and reboot (without your savefolder)
2. Make some changes like changing the desktop background
3. Run the script and make sure the paths and filenames are correct according to your setup
4. An adrv with your changes should now be created
5. Reboot and check if the adrv loads as startup. You should see your changes.
Everytime you want to save changes, you run the script. That's basically it. BTW- When you restart/shutdown do not create a savefile or savefolder.


Ah hah, that-----Rename your existing savefolder by putting a number at the beginning like 1tahrsave and reboot (without your savefolder)---is what I was messing up testing this. Thanks for this, Nic007, this is really useful as I have been trying to get away from savefiles (always remastering and/or now building Woof-CE creations with changes included).


P.S. Backi, I really had to, on testing this, cut the heck out of one of my savefiles on a fresh frugal install for this to work...as Nic007 said, he keeps it small, which is probably the best advice overall here. I'll have to remaste/build the browser and other large changes into the OS.

You can do a remaster first butI strongly suggest you start afresh and use sfs-addons instead of installing stuff. Your personal settings can be changed quickly so that's not a problem.
Back to top
View user's profile Send private message 
backi

Joined: 27 Feb 2011
Posts: 1029
Location: GERMANY

PostPosted: Wed 22 Feb 2017, 13:25    Post subject:  

Hi nic007
!
Did as you told me .
But no adrv will be created

This is my script .....maybe you have a look at it what could be wrong .

#!/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/puppy606/adrv_tahr_6.0.6.sfs
mksquashfs /mnt/sdb1/puppyfilesystem /mnt/sdb1/puppy606/adrv_tahr_6.0.6.sfs -comp xz
rm -r /mnt/sdb1/puppyfilesystem

exit

Maybe something in my Boot menu.lst is prventing something ....

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
Back to top
View user's profile Send private message 
nic007


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

PostPosted: Wed 22 Feb 2017, 13:42    Post subject:  

backi wrote:
Hi nic007
!
Did as you told me .
But no adrv will be created

This is my script .....maybe you have a look at it what could be wrong .

#!/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/puppy606/adrv_tahr_6.0.6.sfs
mksquashfs /mnt/sdb1/puppyfilesystem /mnt/sdb1/puppy606/adrv_tahr_6.0.6.sfs -comp xz
rm -r /mnt/sdb1/puppyfilesystem

exit

Maybe something in my Boot menu.lst is prventing something ....

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

According to your menu entry your puppy files are in /. In the script it's in a folder. You need to change that.
Back to top
View user's profile Send private message 
backi

Joined: 27 Feb 2011
Posts: 1029
Location: GERMANY

PostPosted: Wed 22 Feb 2017, 14:51    Post subject:  

Thanks nic007 !

Now your script does the job ......cool.... Very Happy Very Happy Very Happy
Back to top
View user's profile Send private message 
backi

Joined: 27 Feb 2011
Posts: 1029
Location: GERMANY

PostPosted: Thu 23 Feb 2017, 10:41    Post subject:  

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
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 5 [70 Posts]   Goto page: 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.1564s ][ Queries: 14 (0.0139s) ][ GZIP on ]