Remove automatic pupsave for frugal installs

How to do things, solutions, recipes, tutorials
Message
Author
jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

Remove automatic pupsave for frugal installs

#1 Post by jpeps »

For anyone who is having having trouble locating this information, I'll post it. I've never liked automatic saving, and for frugal installs gaining control involves tricking the system into believing you're running a flash drive (i.e, switch to pupmode 13), altering rc.shutdown so that it asks whether you want to save, and setting the events manager save time to "0" (don't save).

1. set the Utilities/PupShutdownManger/Manage System Events/Save Session dialogue to "0" (no save).

2. change in menu.lst: change pmedia=atahd to ataflash.

3. change in /etc/rc.shutdown

13) #PDEV1 and PUPSFS and PUPSAVE
#/initrd/pup_rw has tmpfs, pup_ro1 has ${DISTRO_FILE_PREFIX}save.2fs file (PUPSAVE), pup_ro2 has PUPSFS file.
#the above are in unionfs at /.
dialog --yesno "Save session?" 0 0 >/dev/console
if [ $? -eq 0 ]; then
echo "Saving session to $SAVEFILE (${SAVEPART})..." >/dev/console
/usr/sbin/snapmergepuppy /initrd/pup_ro1 /initrd/pup_rw
fi
;;

User avatar
RSH
Posts: 2397
Joined: Mon 05 Sep 2011, 14:21
Location: Germany

#2 Post by RSH »

Yes, this should be sticky.

I have at least two or three times explained exactly this to someone on the forum. Can't find the thread.

8) 8) 8)

RSH

:D I've found one of these threads: ---> Here is the last thread of this :D
Last edited by RSH on Fri 16 Nov 2012, 19:31, edited 1 time in total.
[b][url=http://lazy-puppy.weebly.com]LazY Puppy[/url][/b]
[b][url=http://rshs-dna.weebly.com]RSH's DNA[/url][/b]
[url=http://murga-linux.com/puppy/viewtopic.php?t=91422][b]SARA B.[/b][/url]


User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#4 Post by greengeek »

Thanks all, nice summary. Just adding this to my list so I can find it again.

bill
Posts: 490
Joined: Wed 28 May 2008, 15:32

removing automatic pupsave file found

#5 Post by bill »

If you make the 3 edits below, these 3 changes happen:
1. Session changes can still be saved at any time by clicking on the "Save" bullseye icon.
2. Session changes will not automatically save at shutdown.
3. At startup, you will get a warning message which says "X seems to have exited uncleanly the last time you ran puppy..." but no harm is done, just the changes you did not deliberately save are lost.
- - Click on "Ignore" and you will be in Puppy as it was at shutdown.

The lines to edit:
1. Open the console and type "geany /etc/rc.d/rc.shutdown" without quotes.
- - This opens the shutdown code for editing
2. Type cntrl f to search for "/usr/sbin/snapmergepuppy" without quotes.
- - /usr/sbin/snapmergepuppy is in my unaltered installation 3 times,
- - at line 817, line 847, and line 853.
3. Comment out each line that has it by typing #myrem in front of that line. The # sign alone comments it out, but use #myrem so you can find it later if you need to. Smile

So for each line (3 of'em) that originally said
/usr/sbin/snapmergepuppy /initrd/pup_ro1 /initrd/pup_rw
you now have
#myrem /usr/sbin/snapmergepuppy /initrd/pup_ro1 /initrd/pup_rw

4. Save the file.

5. Added Feb 22 (should have been in this post from the start):
"Go to "Menu->System->Puppy Event Manager->save session->save Interval",
and set the value to zero [actually 0] minutes, and OK that."

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#6 Post by greengeek »

Also, here is an interesting historical post that may offer some extra ideas/links if the above doesn't cover whats needed:
http://www.murga-linux.com/puppy/viewtopic.php?t=39717

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

call me lazy

#7 Post by mcewanw »

I decided today that I didn't want automatic pupsaving, so I searched the forum and found this thread amongst others.

Anyway, I didn't really want to mess up any system scripts or use any PUPMODE tricks and so on. As an admittedly simplistic and crude alternative I simply stuck the following line in my /etc/rc.d/rc.local to disable pupsaving altogether (unless re-enabled as shown later):

Code: Select all

[ -e /usr/sbin/snapmergepuppy ] && mv /usr/sbin/snapmergepuppy /usr/sbin/snapmergepuppyBKUP
Then, when I want things to autosave normally again, I simply rename snapmergepuppyBKUP back to snapmergepuppy (or use a simple script to toggle between the two). Seems to work so posting this in case anyone else finds it useful.

Prevent saving to pupsave (pupsave_no script, which I have a shortcut to on my desktop):

Code: Select all

#!/bin/sh
[ -e /usr/sbin/snapmergepuppy ] && mv /usr/sbin/snapmergepuppy /usr/sbin/snapmergepuppyBKUP
Allow saving to pupsave (pupsave_yes script, which I have a shortcut to on my desktop):

Code: Select all

#!/bin/sh
[ -e /usr/sbin/snapmergepuppyBKUP ] && mv /usr/sbin/snapmergepuppyBKUP /usr/sbin/snapmergepuppy
EDIT: As well as the above method of preventing unwanted pupsaving I also install my .wine directory and .mozilla directory to /mnt/home and use relative symlinks back to /root to these. I am then able to use a very small pupsave (32M), which is simpler to backup, faster to boot with and much faster to shutdown. This is with Slacko 533 frugal installation on FAT32 formatted usb stick.
github mcewanw

backi
Posts: 1922
Joined: Sun 27 Feb 2011, 22:00
Location: GERMANY

#8 Post by backi »

Hi
For Puppy Precise And Raring !

Found another solution not to save to USB Flash without ruining PPmanager „ for Puppy Precise and UPUPS raring .

1.Download somewhere the script „nosaveshutdown „ make it executable .

2. Goto Puppy Event Manager > Save Session > Save interval (0=never )
Save to flash....Restart
Install petget20120418.pet from


Save to flash ..restart
Now you can install pets debs or downloads from PPmanager ..if you like to keep them
either use „save2flash „ during session wihout shutting down ,
or saving session at shutdown ..just shutdown asusual.

In case you dont want to save Changes /session ...just execute the script above „nosaveshutdown“ . Nothing will be saved to Flash .This works for me on Precise Puppy 5.6 . , Rarung .

Install petget20120418.pet from

http://shino.pos.to/linux/puppy/

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#9 Post by Flash »

Download somewhere? That's a big help :lol: You can't give us a URL?

backi
Posts: 1922
Joined: Sun 27 Feb 2011, 22:00
Location: GERMANY

#10 Post by backi »

Hi Flash !

Here is the script for " no save at shutdown " .

#!/bin/sh
# skips rc.shutdown and powers off computer without saving the session.
Xdialog --title "script $0" --yesno "\n\nAre you sure to power-off computer WITHOUT saving?\n\n" 0 0
[ $? -eq 0 ] && rm /initrd/pup_ro1/etc/.XLOADED && rm /etc/.XLOADED
exec /bin/busybox poweroff

Copy this text to geany or leafpad ----save it as for example in root as " Shut down without saving "--------- right click on this saved file ----goto Properties-----tick .....Exec.....refresh .
Now you can execute this script by clicking on it .. You could decorate with a nice icon too.
After you have done the steps i described before .
Last edited by backi on Sat 01 Jun 2013, 07:10, edited 1 time in total.

nancy reagan
Posts: 544
Joined: Thu 22 Jan 2009, 14:20

Shinobar's pup saveconfig ?

#11 Post by nancy reagan »

I use Shinobar's "pup saveconfig"-pet for ages in lupu. Not sure about precise and raring though.

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

backi
Posts: 1922
Joined: Sun 27 Feb 2011, 22:00
Location: GERMANY

#12 Post by backi »

Hi !

The script i mentioned above just shuts down without asking wether to save or not to save .
Faster ....

duh
Posts: 18
Joined: Sun 10 Dec 2006, 08:16

save or don't, renew with new changes

#13 Post by duh »

Hi,
I had the wish to construct a toggleSave/NOsave command what
succeeded in the loss of the 1st line of PUPSTATE (etc/rc.d/..)
Now savingcommand open the yellow offers of saving or nosaving.
(what means a brandnew savefile with evtl. changes or notsaving shutdown )

Now I tried this crazy idea with deleting the PUPSTATE file what
ended in the same result as said above.

So if I want to save the original savefile I change by hand
the PUPMODE=13 to PUPMODE=5 in pupstate's 1st line what activates
the original save procedures.

Following is often said before:
Before the first saveprocedure "Pup event manager" saveinterval should have been set to 0 (zero)
to prevent unwanted savings.
In the menu.lst PMEDIA=atahd or =usbhd I changed it to ataflash/usbflash
To avoid DESTOPlosses I make copy of /Choices/ROX-Filer/PuppyPin just before saving.
I practice this since nearly one year without noticed issues.

IF there is heavy protest to this ugly procedure do not answer here but send me a short PM
in plain english, so I have the chance to delete this post aslong it is unwanted.
greetings
duh

tlchost
Posts: 2057
Joined: Sun 05 Aug 2007, 23:26
Location: Baltimore, Maryland USA
Contact:

Re: Shinobar's pup saveconfig ?

#14 Post by tlchost »

nancy reagan wrote:I use Shinobar's "pup saveconfig"-pet for ages in lupu. Not sure about precise and raring though.

http://murga-linux.com/puppy/viewtopic.php?t=60678
Yep...works in both Precise and Raring....and the other advantage is that yoiu can save if you want to.

User avatar
Smithy
Posts: 1151
Joined: Mon 12 Dec 2011, 11:17

#15 Post by Smithy »

Code: Select all

#!/bin/sh
# skips rc.shutdown and powers off computer without saving the session.
Xdialog --title "script $0" --yesno "\n\nAre you sure to power-off computer WITHOUT saving?\n\n" 0 0
[ $? -eq 0 ] && rm /initrd/pup_ro1/etc/.XLOADED && rm /etc/.XLOADED
exec /bin/busybox poweroff 
Backi's script works good..bam, it shuts down. But the No bit could close the dialogue and not shut down?

Would it be a good idea to put Musher's code before it to close any drives open though?

Code: Select all

#PREPARATION - unmount devices already mountd during boot
sleep 2
# ~/my-applications/bin/umount-only-disks.sh
####Musher0 code to unmount only disks
df -H -T -x squashfs -x tmpfs -x rootfs -x aufs -P | grep "/mnt/s" | cut -f2 -d'm' > spc_dsq.txt
while read line
do
umount /m$line
done < spc_dsq.txt
rm -f spc_dsq.txt
sleep 2

User avatar
RSH
Posts: 2397
Joined: Mon 05 Sep 2011, 14:21
Location: Germany

#16 Post by RSH »

Smithy wrote:Would it be a good idea to put Musher's code before it to close any drives open though?
Yes, surely a good idea.

But something to think of:

- auto-unmount all ISO files in /mnt
- auto unmount all SFS and [2,3,4].fs files in /mnt
- Edit: not to forget to make a sync, to make sure cache is written to USB

Because you can not unmount a drive which contains an mounted ISO, SFS or save file. Do a sync first and then make sure to unmount SFS and save files first, because they could have been mounted from within a mounted ISO file.

I'm using/doing this automatically on every shut-down/reboot in my private LazY Puppy System/s.
[b][url=http://lazy-puppy.weebly.com]LazY Puppy[/url][/b]
[b][url=http://rshs-dna.weebly.com]RSH's DNA[/url][/b]
[url=http://murga-linux.com/puppy/viewtopic.php?t=91422][b]SARA B.[/b][/url]

User avatar
Smithy
Posts: 1151
Joined: Mon 12 Dec 2011, 11:17

#17 Post by Smithy »

Thanks for that info RSH.

Good ideas on those extra layers of mount, they confused me a few times in the past.

I know Lazy is a very slick modular system with various SFS available.

I have noticed that if I write something to a usb stick, and right click "unmount", puppy very graciously will not unmount the stick until it has finished the write that is in the cache. So that is handled very nicely.

My needs are simple.
After a big thread about shutdown, I have settled with a fast shutdown on the taskbar, and the "proper procedures" (save file etc) in the menu.

So far, the combination works a treat.

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#18 Post by mikeb »

Because you can not unmount a drive which contains an mounted ISO, SFS or save file. Do a sync first and then make sure to unmount SFS and save files first, because they could have been mounted from within a mounted ISO file.
yes I added sort -r to the end of the unmount loop in puppy so loop mounted files get removed first but I mount them to /mnt/filemnt/.....
so no '+' so a different trick might be needed.

mike

User avatar
casearis
Posts: 6
Joined: Thu 16 Feb 2012, 19:14

menu.lst

#19 Post by casearis »

Have been following instructions, event handler is set to 0. No autosave... however i am having trouble locating the menu.lst file.

I know there is a pet somewhere which has "shutdown no save" option, just can't seem to find it again.

am using macpup 550

`case

User avatar
casearis
Posts: 6
Joined: Thu 16 Feb 2012, 19:14

Link to pet

#20 Post by casearis »


Post Reply