Slacko 5.7.0: how to ask to save YES OR NO at shutdown?

Using applications, configuring, problems
Post Reply
Message
Author
puppylinuxuser
Posts: 16
Joined: Thu 09 Jan 2014, 18:59

Slacko 5.7.0: how to ask to save YES OR NO at shutdown?

#1 Post by puppylinuxuser »

Hi everyone. I downloaded the new 5.7 and really like it so far.

In 5.6 I added a few lines to rc.shutdown based on a thread here to give me the option YES OR NO to save the session or not.

I tried adding these same lines to the rc file in 5.7 but it doesn't work, it just shuts the computer down without asking and without saving.

I notice there is extra code in 5.7

anyone get this figured out?

thanks

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#2 Post by SFR »

Here you go - just replace the following block of code (starts at line #527):

Code: Select all

 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 /.
  echo "$(eval_gettext "Saving session to \${SAVEFILE} (\${SAVEPART})...")" >/dev/console
  #echo "Saving session to $SAVEFILE (${SAVEPART})..." >/dev/console
  /usr/sbin/snapmergepuppy /initrd/pup_ro1 /initrd/pup_rw
  ;;
with this one:

Code: Select all

 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 --timeout 60 --yes-label "SAVE" --no-label "NO SAVE" --yesno "Press ENTER key to save session...
Or, press TAB then ENTER to not save session...
Or, wait 60 seconds to shutdown without saving session..." 0 0 >/dev/console
  if [ $? -eq 0 ]; then 
    echo "$(eval_gettext "Saving session to \${SAVEFILE} (\${SAVEPART})...")" >/dev/console
    /usr/sbin/snapmergepuppy /initrd/pup_ro1 /initrd/pup_rw 
  fi 
  ;;
Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

puppylinuxuser
Posts: 16
Joined: Thu 09 Jan 2014, 18:59

#3 Post by puppylinuxuser »

hi and thank you for the help.

i replaced the blocks like you recommended but now the session is saved automatically at shutdown and there is still no choice.

I copied and pasted your block so i don't think there is any error

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#4 Post by SFR »

Did you reverse your previous modifications of rc.shutdown before applying the new ones?
If not, recover the pristine script using:

Code: Select all

cp /initrd/pup_ro2/etc/rc.d/rc.shutdown /etc/rc.d/rc.shutdown
and try again.

Also, to make sure that your installation is really running in PUPMODE=13, check if the output of:

Code: Select all

# cat /etc/rc.d/PUPSTATE | grep PUPMODE
PUPMODE=13
# 
is the same in your case..?

EDIT: Attached already modified rc.shutdown, which works for me.

Greetings!
Attachments
rc.shutdown.tar.gz
(10.55 KiB) Downloaded 232 times
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

puppylinuxuser
Posts: 16
Joined: Thu 09 Jan 2014, 18:59

#5 Post by puppylinuxuser »

hi thanks for seeing me through this. i didn't reset settings before applying. i used your pristine

pupstate says i'm in pupmode 7 so i'll have to change that

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#6 Post by SFR »

Ah, so you have frugal install on the entire partition, right?
I should have ask for this detail - the previous mod applies only for frugal install with a savefile.

In your case, this block should be replaced:

Code: Select all

 7) #PDEV1 and PUPSFS.
   echo "$(eval_gettext "Saving session to \${PDEV1}...")" >/dev/console
   #echo "Saving session to $PDEV1..." >/dev/console
   /usr/sbin/snapmergepuppy /initrd/pup_ro1 /initrd/pup_rw
  ;;
with:

Code: Select all

 7) #PDEV1 and PUPSFS and PUPSAVE 
  dialog --timeout 60 --yes-label "SAVE" --no-label "NO SAVE" --yesno "Press ENTER key to save session... 
Or, press TAB then ENTER to not save session... 
Or, wait 60 seconds to shutdown without saving session..." 0 0 >/dev/console 
  if [ $? -eq 0 ]; then 
   echo "$(eval_gettext "Saving session to \${PDEV1}...")" >/dev/console
   #echo "Saving session to $PDEV1..." >/dev/console
    /usr/sbin/snapmergepuppy /initrd/pup_ro1 /initrd/pup_rw 
  fi 
  ;;
Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

puppylinuxuser
Posts: 16
Joined: Thu 09 Jan 2014, 18:59

#7 Post by puppylinuxuser »

I should have listed more info.

I put slacko on a SD card using the universal installer (usb option i thought)

this laptop's harddrive died and I pulled it, so all there is is the SD card in the reader

on my other computer I have 5.6 on a SD card too, set up so it doesn't save at all unless I answer yes when I shutdown. I probably changed the pupmode there too but just don't remember doing it.

The only time I save the session is if I add software or make other changes I want saved. My day to day internet use I don't save for example.

thanks

User avatar
8-bit
Posts: 3406
Joined: Wed 04 Apr 2007, 03:37
Location: Oregon

#8 Post by 8-bit »

Sorry to jump in here, but you have my interest.
So other than replacing rc.shutdown with the one you supplied, how do I change my pupmode on Slacko 5.5 from 12 (showing) to 13?

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#9 Post by rufwoof »

Don't forget to set MENU, SYSTEM, PUP EVENT MANAGER save session tab - save interval to zero

Otherwise your savefile will be updated every 30 mins (or whatever).

Personally I use pupsavehotbackup to make periodic backups of my savefile and if at the end of a session I want to ditch any changes I just copy the more recent backup to something like slackosave_ok.4fs That way at the next reboot puppy will find two savefiles and prompt for which one you want to load - pick the copied (ok) version, startup and delete the undesired savefile image.

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#10 Post by rufwoof »

8-bit wrote:Sorry to jump in here, but you have my interest.
So other than replacing rc.shutdown with the one you supplied, how do I change my pupmode on Slacko 5.5 from 12 (showing) to 13?
Isn't it something like a startup boot parameter of

puppy pmedia=ataflash

I guess if you remaster you could enter that as part of the remaster process (near the end when it gives you the option to make changes to boot parameters), such that that would be the default. Otherwise you'd have to enter it every time you booted.

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#11 Post by SFR »

rufwoof wrote:
8-bit wrote:Sorry to jump in here, but you have my interest.
So other than replacing rc.shutdown with the one you supplied, how do I change my pupmode on Slacko 5.5 from 12 (showing) to 13?
Isn't it something like a startup boot parameter of

puppy pmedia=ataflash

I guess if you remaster you could enter that as part of the remaster process (near the end when it gives you the option to make changes to boot parameters), such that that would be the default. Otherwise you'd have to enter it every time you booted.
You can also add this to your syslinux or grub config file. Mine (grub) looks like this:
title Puppy Linux 5.7.0
find --set-root --ignore-floppies /Puppy_Slacko_5.7.0/initrd.gz
kernel /Puppy_Slacko_5.7.0/vmlinuz psubdir="Puppy_Slacko_5.7.0" pfix=fsck pmedia=ataflash
initrd /Puppy_Slacko_5.7.0/initrd.gz
boot
puppylinuxuser wrote:on my other computer I have 5.6 on a SD card too, set up so it doesn't save at all unless I answer yes when I shutdown. I probably changed the pupmode there too but just don't remember doing it.
Probably this time, during creating a savefile, you have selected "SAVE TO sdXY" instead of "SAVE TO FILE" (see screenshot) option, that's why you ended up in PUPMODE=7.
http://bkhome.org/blog/?viewDetailed=00225 wrote:PUPMODEs 6 and 7 are cases that I have recently mentioned. Frugal installation but using the entire partition to save, instead of a "pup_save" file.
BTW, I have never used that type of install (7), but I doubt that one could easily change it to 13 - probably only a new, fresh savefile would do the job..
OTOH the second mod should work well with 7, did you try it yet..?

Greetings!
Attachments
Screenshot.jpg
(66.41 KiB) Downloaded 802 times
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

puppylinuxuser
Posts: 16
Joined: Thu 09 Jan 2014, 18:59

#12 Post by puppylinuxuser »

rufwoof wrote:Don't forget to set MENU, SYSTEM, PUP EVENT MANAGER save session tab - save interval to zero

Otherwise your savefile will be updated every 30 mins (or whatever).

Personally I use pupsavehotbackup to make periodic backups of my savefile and if at the end of a session I want to ditch any changes I just copy the more recent backup to something like slackosave_ok.4fs That way at the next reboot puppy will find two savefiles and prompt for which one you want to load - pick the copied (ok) version, startup and delete the undesired savefile image.
yup I changed this already;

thanks SFR, yes I think I might just start from scratch and try again using your advice.

thank you everyone

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#13 Post by rufwoof »

I don't touch my home directory other than whatever configuration changes make to files in that directory tree.

All work files - docs, music...etc are kept on the HD (outside of puppy savefile space).

I've also set firefox to download there also so my savefile tends to be small (currently 120MB with 83MB free (I'm using portable-firefox).

For the trash, I deleted /root/.Trash and created a .Trash outside of savefile space and used ROX to drag and drop that into /root and opted for a absolute link. i.e. trash is also outside of savefile space.

I don't tend to load PET's, just SFS's. There are tools around to convert PET to SFS and even combine multiple PETS/SFS's into a single SFS. So predominately I have a lean core operating system (DVD) with a small save file (I dont use GRUB just have the PC set to have DVD as the first checked boot device), all docs/music on the HD and additional programs load/unload'able via SFS's. Back up those SFS's and docs/music to the cloud somewhere.

As a example see http://www.murga-linux.com/puppy/viewtopic.php?t=92616 in which I've linked to a SFS that I merged containing Openshot, xvidcap, Audacity and Blender i.e. multi-media. I also have a copy of a Libre (office) SFS and Firefox is via a portable version (that auto updates to the latest versions). Mostly those three serve my needs. I do however play around with other things, but more often drop saving those sessions in the manner I described earlier.

puppylinuxuser
Posts: 16
Joined: Thu 09 Jan 2014, 18:59

#14 Post by puppylinuxuser »

rufwoof

thank you for posting your setup. Puppy is pretty amazing in how flexible it is. rufwoof do you have puppy auto save then?

The way i use puppy, I prefer to only have it save to the savefile when I choose yes at shutdown. anything data wise that I need saved, I copy it to the SD card memory before shutting down.

this method means that none of your internet history etc is saved but you could import your bookmarks and then save on shutdown and they will be available every time you boot up.

I really appreciate puppy's flexibility.

It's great that I can take a laptop with no harddrive and have such functionality with a distro loading off the SD card into RAM.

I've been playing dvds, listening to mp3s, using gimp, and have 5 tabs open in chrome. the laptop is attached to a LCD and I setup puppy to turn on laptop screen.

and it doesn't skip a beat.

edit here is a description of my setup from my other thread, except with the 5.7 laptop there is no harddrive in it (went bad) :

my setup currently is slacko loaded onto an SD card that I simply pop out when i need to use windows. traditionally I would make a partition for linux on the harddrive but for this laptop i decided to leave the harddrive alone.

I changed the settings around so puppy doesn't save anything to the save file unless i tell it to on shut down with a prompt.

that way i start with a fresh slate each time or I can save my build if I add programs etc.

It works great, just the way I want

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#15 Post by rufwoof »

Normal mode, but with Puppy Event Manager save interval set to zero, so it only saves at shutdown.

As I run a portable-firefox web browser, cache, history etc changes/additions remain intact from one session to the next, puppy savefile saved or not. http://www.murga-linux.com/puppy/viewtopic.php?t=91945

Most of the core operating system and programs are relatively fixed, so the savefile doesn't change that much. All inputs and outputs (open and save) are from the hardisk outside of puppy savefile space. They're backed up via other means (zip and upload to the cloud).

A casual look around my /initrd/pup_rw/ directory tree (indicator of what's different to the DVD's content) indicates relatively little changed. A good idea to have a look through that tree periodically IMO just to make sure there's nothing unsual that's replacing existing executables (bin directories). I think of the savefile as just being another directory tree that replicates the core/fixed tree, where that savefile space tree is first in the PATH (search order) such that any changes there are used/applied first (or the core version used if nothing in the savefile space). Not quite as simple as that however in practice as it also has to record if deletions had occurred etc.

puppylinuxuser
Posts: 16
Joined: Thu 09 Jan 2014, 18:59

#16 Post by puppylinuxuser »

SFR wrote:Ah, so you have frugal install on the entire partition, right?
I should have ask for this detail - the previous mod applies only for frugal install with a savefile.

In your case, this block should be replaced:

Code: Select all

 7) #PDEV1 and PUPSFS.
   echo "$(eval_gettext "Saving session to \${PDEV1}...")" >/dev/console
   #echo "Saving session to $PDEV1..." >/dev/console
   /usr/sbin/snapmergepuppy /initrd/pup_ro1 /initrd/pup_rw
  ;;
with:

Code: Select all

 7) #PDEV1 and PUPSFS and PUPSAVE 
  dialog --timeout 60 --yes-label "SAVE" --no-label "NO SAVE" --yesno "Press ENTER key to save session... 
Or, press TAB then ENTER to not save session... 
Or, wait 60 seconds to shutdown without saving session..." 0 0 >/dev/console 
  if [ $? -eq 0 ]; then 
   echo "$(eval_gettext "Saving session to \${PDEV1}...")" >/dev/console
   #echo "Saving session to $PDEV1..." >/dev/console
    /usr/sbin/snapmergepuppy /initrd/pup_ro1 /initrd/pup_rw 
  fi 
  ;;
Greetings!
i know this is an older thread but I did have a chance to try this for pupmode 7 and can confirm that it works.

pupmode 7 doesn't work for my use though since I can't save files to the SD card through the file explorer.

the only way to save things to the SD card that I can see in this mode is to save the session at the end.

so i'm restarting this build with a different pupmode.

thanks

puppylinuxuser
Posts: 16
Joined: Thu 09 Jan 2014, 18:59

#17 Post by puppylinuxuser »

the first set of instructions sfr posted works for my new build using pupmode13

thanks again.

Post Reply