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 Tue 02 Sep 2014, 18:00
All times are UTC - 4
 Forum index » Advanced Topics » Cutting edge
Factory Reset
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 3 [32 Posts]   Goto page: 1, 2, 3 Next
Author Message
Announcer


Joined: 03 Jan 2012
Posts: 155

PostPosted: Mon 12 Aug 2013, 19:32    Post subject:  Factory Reset
Subject description: A different approach to save file management
 

Instead of a user having to create and configure his own savefile, why not create one for him, and then provide a simple utility to erase it?

That's the idea behind Factory Reset.

This script is for people who are running off a usb drive and have an existing save file in use. The save file is wiped clean without deleting it.

Factory_Reset.pet
Description 
pet

 Download 
Filename  Factory_Reset.pet 
Filesize  2.64 KB 
Downloaded  236 Time(s) 

Last edited by Announcer on Fri 23 Aug 2013, 05:35; edited 10 times in total
Back to top
View user's profile Send private message 
Karl Godt


Joined: 20 Jun 2010
Posts: 3964
Location: Kiel,Germany

PostPosted: Mon 12 Aug 2013, 21:07    Post subject:  

I am not a fan of USB Pendrives . They are risky in a way that they could easily disconnect .
I don't understand this USB-Hype .

But that Hype apparently exists .

I wish you good luck with your approach !

_________________
«Give me GUI or Death» -- I give you [[Xx]term[inal]] [[Cc]on[s][ole]] .
Macpup user since 2010 on full installations.
People who want problems with Puppy boot frugal Razz
Back to top
View user's profile Send private message Visit poster's website 
Announcer


Joined: 03 Jan 2012
Posts: 155

PostPosted: Wed 14 Aug 2013, 02:09    Post subject:  

Thanks, Karl!

I've updated the first post, and attached a .pet package.

Last edited by Announcer on Fri 23 Aug 2013, 05:53; edited 1 time in total
Back to top
View user's profile Send private message 
greengeek

Joined: 20 Jul 2010
Posts: 2512
Location: New Zealand

PostPosted: Wed 14 Aug 2013, 03:11    Post subject:  

I think it would be worthwhile to offer the user a choice of "backup existing savefile then erase"

I would not want to erase a savefile unless I was sure I had a backup of the previous one (but then I do sometimes drink a little too much wine and make unintended mistakes...)

Also - your script suggests that it will reset the usb "stick" yet leave the data untouched - however the stick might contain 2 partitions. (I usually keep my data on the 2nd usb partition). Maybe it should say that it will reset the usb "boot partition" and leave any other data partitions untouched...
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 5016
Location: Arizona, U.S.A.

PostPosted: Wed 14 Aug 2013, 04:24    Post subject:  

greengeek has the right idea, don`t keep anything in the Save file.

Announcer; Its a compressed backup Save file either way.
If the Save file`s saved right after it`s created, then it`s "factory", right?

It`s fairly common for Puppy to scramble the Save file and become unbootable.
So then boot to ram, erase the Save file, reboot and shutdown creating a new one.
If a Save file`s backed up after it`s "configured", then a "nuke & restore" isn`t needed.

Unless you run Puppy like Flash does, from a CD in ram with no Save file.
.
Back to top
View user's profile Send private message 
Announcer


Joined: 03 Jan 2012
Posts: 155

PostPosted: Wed 14 Aug 2013, 05:27    Post subject:  

@ greengeek: Sorry, I've made a couple of changes to the script. It no longer mentions that it leaves the data partition untouched. But it doesn't delete anything except for files inside the .4fs savefile.

As for backing up the savefile first, all you have to do is copy it somewhere and rename it. So that's pretty easy.

I used the changes to /etc/rc.d/rc.shutdown you and 01micko made, so that it reboots without saving after using Factory Reset. So, thanks! Smile It's not included in the pet package though, because it needs to be in the main system sfs. So that's another thing to keep in mind:

*If you are asked after if you want to save, choose "No" for the wipe to take effect.*

@sunburnt: The whole idea of this is to keep things as simple as possible. An option to back up the sfs defeats the purpose, because I don't want the user to have to know anything about savefiles or saving or boot options etc. It just does it and doesn't ask questions, and if things go wrong there is a simple solution.

Look at smartphones. Changes are persistent, and good phones have a factory reset option. Same sort of idea.
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2505
Location: Burghaslach, Germany somewhere also known as "Hosla"

PostPosted: Wed 14 Aug 2013, 06:01    Post subject: Factory Reset  

What is so difficult with

boot pfix=ram

which is Puppy's (factory Question ) reset Question
Back to top
View user's profile Send private message 
Announcer


Joined: 03 Jan 2012
Posts: 155

PostPosted: Wed 14 Aug 2013, 09:15    Post subject: Re: Factory Reset  

L18L wrote:
What is so difficult with

boot pfix=ram

which is Puppy's (factory Question ) reset Question


Nothing. But Factory Reset:

*is instant. You don't have to reboot three times using a special cheat code. It's done in about two seconds.

*is simple. You just click the entry in the menu.

*is an actual factory reset, because the only thing on the drive that is changed during use is the save file, so formatting returns it to its original state.

Last edited by Announcer on Fri 23 Aug 2013, 05:55; edited 1 time in total
Back to top
View user's profile Send private message 
mikeb


Joined: 23 Nov 2006
Posts: 8232

PostPosted: Wed 14 Aug 2013, 13:29    Post subject:  

Forget messing with flimsy save files and work on using the sfs instead.... Wink

mike
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 5016
Location: Arizona, U.S.A.

PostPosted: Wed 14 Aug 2013, 14:15    Post subject:  

mikeb; I forget who ( SeaSide.? ), but someone here replaced the Save file with an SFS file.
As I said, just takes someone who knows the Puppy boot code.

Announcer; Why would anyone want to backup an SFS file?
What`s so hard about making a copy of the Save file ( ext2 or ext3 ) and gzip it?
I`m not sure what all the effort you`re going to is doing. A first boot Save file`s still needed.
After that both methods accomplish the same thing ( I believe...). Just copy and gzip is easier.

Make a script, call it "pup-save":
Code:
#!/bin/sh
######### Puppy Save file backup and restore.

savePF=`losetup /dev/loop1 |cut -d' ' -f3`

### Backup Save file.
if [ "$1" = 'backup' ];then
 cp $savePF $savePF'_BU'
 gzip -9 $savePF'_BU'

### Restore Save file.
elif [ "$1" = 'restore' ];then
 rm $savePF
 gunzip $savePF'_BU'
fi

Easily added to Puppy`s menu or a GUI dialog.
.
Back to top
View user's profile Send private message 
mikeb


Joined: 23 Nov 2006
Posts: 8232

PostPosted: Wed 14 Aug 2013, 14:34    Post subject:  

Quote:
mikeb; I forget who ( SeaSide.? ), but someone here replaced the Save file with an SFS file.


well I have added this option to puppy for over 2 years... its solid and especially good for say a netbook using flash as the stick can be removed once booted and saves are optional. It also means the resident filesystem is not left with the dirty flag set which can be a nuisanse. Think in terms of multisession cd but from flash/harddrive.

mike
Back to top
View user's profile Send private message 
greengeek

Joined: 20 Jul 2010
Posts: 2512
Location: New Zealand

PostPosted: Wed 14 Aug 2013, 15:18    Post subject:  

mikeb wrote:
well I have added this option to puppy for over 2 years... its solid and especially good for say a netbook using flash as the stick can be removed once booted and saves are optional.
I would be very keen to see a tutorial about doing this if anyone feels like making one. For some reason I have mostly stayed away from using an sfs but it sounds like your method creates a personalised sfs instead of a savefile. Is that how you use it?
Back to top
View user's profile Send private message 
mikeb


Joined: 23 Nov 2006
Posts: 8232

PostPosted: Wed 14 Aug 2013, 15:51    Post subject:  

Quote:
it sounds like your method creates a personalised sfs instead of a savefile. Is that how you use it?


Yes.

I did use tar for a while but the tinylibc version was too buggy. With machines with a decent amount of ram and sensible save usage its a tidy option. I also use sfs for applications so no pets loaded in there.

As for the op I would think an option to boot pfix=ram and load the sfs contents to the pup_rw layer as a boot menu option would be something that could be made user friendly. A bit like safe mode for firefox.

mike
Back to top
View user's profile Send private message 
Announcer


Joined: 03 Jan 2012
Posts: 155

PostPosted: Wed 14 Aug 2013, 17:51    Post subject:  

The problem with these other ideas is that you still can't delete a save file while it is in use - you have to reboot with pfix=ram, then boot again, and create a new save file. With this script you do not.

You just click the app in the menu, and it wipes the existing save file clean in two seconds, and reboots "new".

I'm not going to replace the script with some other one that does something entirely different. I know what I am trying to do, and how I am trying to do it.

So please stop hijacking the thread.
Back to top
View user's profile Send private message 
mikeb


Joined: 23 Nov 2006
Posts: 8232

PostPosted: Wed 14 Aug 2013, 19:43    Post subject:  

I did sneak back onto your topic but whatever...
Quote:

I also added a link to an FR.sfs file, which will have to be created for different versions of Puppy. To do so, boot and then save right away, creating a save file. Then reboot using "puppy pfix=ram", click the savefile, and copy the files inside into a directory called FR. Delete the contents of the /root folder inside FR, then do:
Code:

dir2sfs FR FR.sfs

inside whatever folder you created the FR folder in. Put it into /mnt/home and you're done.


If the intention is simple I did not see where this is done by the 'user'... an easy script though.

mike
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 3 [32 Posts]   Goto page: 1, 2, 3 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Cutting edge
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.0855s ][ Queries: 13 (0.0090s) ][ GZIP on ]