Remove automatic pupsave for frugal installs

How to do things, solutions, recipes, tutorials
Message
Author
User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#31 Post by rufwoof »

Anyone else noticed that when you ram boot with no save file, the bottom right 'free space' icon shows a similar/same amount of space whether you have puppy sfs more highly compressed or not.

It looks like puppy halves the amount of actual memory and allocates one half to front end and one half to back end - into which puppy sfs is copied. So provided half of total memory is more than the puppy sfs size it doesn't seem to matter whether that puppy sfs size is big or small, you stlll end up with around the same amount of 'front end 'free memory'

Mine typically shows 750MB free on this 1.5GB PC, even if puppy sfs is 100MB or 400MB.

Personnally I'm running with no swap partition and drop my core sfs's into puppy sfs (in a directory I created (/OFFICE) for that purpose. So the sfs's are already in memory after booting and ready to be loaded.

I have a script in my Startup folder that loads those sfs's quickly i.e.

Code: Select all

for i in audacity-1M.sfs LibreOffice-423-1M.sfs skype43-1M.sfs blender259-1M.sfs inkscape-1M.sfs openshot1.4-1M.sfs xvidcap1M.sfs; do
  f=`losetup -f`
  if [ ! -d /initrd/pup_$i ]; then
    mkdir -p /initrd/pup_$i
    losetup $f /initrd/pup_ro2/OFFICE/$i
    mount -r -t squashfs -o noatime $f /initrd/pup_$i
    busybox mount -t aufs -o remount,append:/initrd/pup_$i=ro unionfs /
  fi
done
nice fixmenus
# fire up libre tray icon (doesn't matter if restart as libre handles multi-calls ok
/opt/libreoffice4.2/program/soffice --quickstart &
nice jwm -restart
and another to unload the same (that's called before a remaster so that the sfs's aren't built into the new version

Code: Select all

#!/bin/bash
# Kill libre tray icon
kill `ps | grep quickstart | grep -v grep | awk '{print $1}'`
for i in audacity-1M.sfs LibreOffice-423-1M.sfs skype43-1M.sfs blender259-1M.sfs inkscape-1M.sfs openshot1.4-1M.sfs xvidcap1M.sfs; do
  LOOPDEV=`losetup | grep -w $i | cut -d: -f 1`
  if [ "$LOOPDEV" != "" ]; then
     busybox mount -t aufs -o remount,del:/initrd/pup_$i unionfs /
     busybox umount $LOOPDEV
     #  losetup -d $LOOPDEV
     rmdir /initrd/pup_$i
  fi
done
nice fixmenus
nice jwm -restart
More recently I've tended to keep copies of the extracted initrd and extracted puppy sfs on HDD, so I can copy in/delete that content as I see fit and remaster a new initrd (with puppy sfs contained within that)

On the Wary 5.5 I'm currently using for instance that looks like

Code: Select all

#!/bin/bash
cd MAIN
rm puppy_wary_5.5.sfs
mksquashfs ../EXTRACTEDPUP puppy_wary_5.5.sfs
find | cpio -o -H newc >../initrd
where <path>/MAIN folder contains the extracted initrd content and <path>/EXTRACTEDPUP contains the extracted puppy sfs content and <path> is where my grub4dos looks to find vmlinuz and initrd.

For instance I've just noticed that skype was set to auto-update, so I changed that setting in the running version, copied /root/.Skype i.e.configuration file to (replace the existing)<path>/EXTRACTEDPUP/root/.Skype ... and ran the above script so that a new initrd is created and ready for the next reboot.

Nice being able to remaster that way as once running you can carry on doing other stuff whilst its running without interfering with the remaster

I've highly compressed my sfs's (slow to form) as I'm loading entirely into ram, I'm also using a high compression of puppy sfs (mksquashfs) and in total the initrd produced is around 400MB. When booted that has 750MB of free space showing. If however I don't include the sfs's inside puppy sfs and the initrd is say 100MB, then I still have 750MB being shown as the amount of available free space.

User avatar
nic007
Posts: 3408
Joined: Sun 13 Nov 2011, 12:31
Location: Cradle of Humankind

#32 Post by nic007 »

My method is extremely simple and uncomplicated. Those SFS's that I want to be loaded automatically at startup, I use for example:

Code: Select all

cd /initrd/mnt/dev_ro2/ExtraSFS
sfs_load --cli --skip-fixmenus --quiet  Java4.sfs  Wine4.sfs  WineProgs4.sfs
If you want the menus to be fixed just leave out --skip-fixmenus. To unload make the same script and just add -u to the command-line.
To load and unload all SFS's in a specific location, the wildcard option also works with that base command-line.
To load/unload an SFS on the fly as needed, a script with the same basic command-line can be used for every SFS file.
To load my swapfile automatically I have the following script in my startup folder:

Code: Select all

exec swapon /initrd/mnt/dev_ro2/pupswap.swp
Easy peasy.

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

#33 Post by mikeb »

The sfs size only affects the size of the tmpfs when ram space is limited...above a certain point its a blanket calculation that you experience.


By the way do any of you actually use yer computers to do anything other than mess with operating systems.

Not having some form of save option would be a pain in the neck for general use....theres more to computing than browser and network settings :D Certainly the family would be having serious words if their computers forgot what they did every reboot whether they wanted it to or not.
They probably would not consider command line stuff to be easy peasy or convenient either...thought swapfile loading was automatic as long as the name was right.

Just curious

Mike

User avatar
nic007
Posts: 3408
Joined: Sun 13 Nov 2011, 12:31
Location: Cradle of Humankind

#34 Post by nic007 »

Windows XP is the workhorse, Puppy is an interesting plaything. Swapfile, only automatically picked up when you use a savefile in my experience (may be wrong though)... Unless you do some code editing somewhere 8)

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

#35 Post by mikeb »

Ah yes the save file requirement..i forgot that one...not unlike the inability to load sfs automatically that was introduced....hence your workarounds.

I did think a simple gui for creation of save files and they usage would be nice. Makes me wonder when noobies are advised to repartition windows to make swap...
Alternatively a daemon that creates swap files and uses them on demand..like was available for 2.4 kernels.

mike

User avatar
nic007
Posts: 3408
Joined: Sun 13 Nov 2011, 12:31
Location: Cradle of Humankind

#36 Post by nic007 »

I reckon more newbies (used to Windows) will try puppy if the frugal idea is spread more widely. I mean, you can run puppy on your harddrive without even doing anything to your current windows setup i.r.o creating additional partitions or whatever. I have a small FAT partition which hosts my puppies (my system also boots from this partition) and I have my Windows install on an NTFS partition. I like the idea that any partition can be accessed from any of the running operating systems. Linux partitions are unnecessary. I use a permanent "fake" savefile for editing, remaster and a swapfile instead of a swap partition. Least intrusive harddrive setup imho.

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

#37 Post by mikeb »

Initially used live cd ...it copied most to the hard drive (fat 32) , made a save at shutdown and automatically made and used a swap file...seemed a neat arrangement at the time and apart from multisession for a while on one machine used that with cd boot until i discovered how easy grub4dos was to set up manually. using windows boot system.. though half the work had already been done by the live cd.

Mike

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

#38 Post by rufwoof »

mikeb wrote:By the way do any of you actually use yer computers to do anything other than mess with operating systems.

Not having some form of save option would be a pain in the neck for general use....theres more to computing than browser and network settings :D Certainly the family would be having serious words if their computers forgot what they did every reboot whether they wanted it to or not.

...

Just curious

Mike
Hi Mike

No savefile for puppy doesn't mean no saving for other stuff. If core puppy is set up/configured as you want then there's no need for a savefile providing all email, docs, etc are stored outside of puppy space (on HDD).

I use spreadsheets and Libre - a lot, but its rare that I reconfigure Libre (config), rather just fire it up, use it and save docs/spreadshhets to wherever (outside of puppy space).

Personally I use a online email account. For general browsing I use portable firefox (on HDD), but for private stuff I ram boot and download the latest firefox directly from Mozillan into ram and use that. Doc's, spreadsheets etc are in a tree on the HDD (outside of puppy space).

If I do want to reconfigure puppy then I just remaster. Depending upon choice of compression level that can be quick (like 15 seconds), or slow (go and make some tea/coffee).

What I like about a rigid/fixed core is that once configured to work and preserved, its much less likely to stop working due to conflicts/changes. Skype, Libre with refinements for printing and individual page styles (landscape/portrait etc) all tweaked to as I desire. Or if a change is deemed needed then remaster that in. Lots of remastering at first....progressively less with time. Ever closer to a unchanging tool that meets your needs. The ideal being that it only becomes (perhaps) necessary to change the software whenever hardware is changed - which for me tends to be relatively infrequent (like years apart).

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

#39 Post by mikeb »

So you have a system that is akin to a save folder then but outside of the union...well that at least avoids dirty shutdowns though not something the family would be setting up.

mike

Keisha
Posts: 469
Joined: Tue 18 Nov 2014, 05:43

#40 Post by Keisha »

mikeb wrote:By the way do any of you actually use yer computers to do anything other than mess with operating systems...
:lol: No... well, not quite true. But closer to the truth than not. When I want to watch Netflix it's Quirky Unicorn 6.21 (bcuz it supports Google Chrome 40) and when I want to listen to talk radio it's upup-3.9.9.1 (bcuz a decent version of vlc). Until recently it was also upup-3.9.9.1 when I wanted to compose a letter, because infinality fonting looks great on it, but now that I have succeeded in compiling infinality fonting on DebianDog I've started using that.
Last edited by Keisha on Sat 21 Feb 2015, 15:04, edited 1 time in total.

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

#41 Post by mikeb »

Laughing No...
nothing like an honest answer :)

I keep a users point of view as otherwise they would batter me with a sharp cucumber.....

User avatar
nic007
Posts: 3408
Joined: Sun 13 Nov 2011, 12:31
Location: Cradle of Humankind

#42 Post by nic007 »

mikeb wrote:So you have a system that is akin to a save folder then but outside of the union...well that at least avoids dirty shutdowns though not something the family would be setting up.

mike
Just avoid the shutdown process by renaming rc.shutdown...or switch off the computer's power-button. :)
Last edited by nic007 on Sat 21 Feb 2015, 15:10, edited 1 time in total.

User avatar
nic007
Posts: 3408
Joined: Sun 13 Nov 2011, 12:31
Location: Cradle of Humankind

#43 Post by nic007 »

mikeb wrote:So you have a system that is akin to a save folder then but outside of the union...well that at least avoids dirty shutdowns though not something the family would be setting up.

mike

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

#44 Post by mikeb »

Actually that answer was @ rufwoof ..sorry for thee confusion...you may batter me with whatever vegetable you have to hand...

mike

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

#45 Post by rufwoof »

So you have a system that is akin to a save folder then but outside of the union
Outside of Puppy space. I wouldn't want one part of a web of spreadsheets to be contained within the savefile of one Puppy, but rather accessible by other systems/Pup's according to whatever might be being used at the time.

For me Pup is a small kernel (vmlinuz) that boots a larger Linux (initrd) that comprises markup language based system to provide a desktop/menu that enables programs to be activated/run. Those programs enable you to do stuff. I'm happy for the enabler to be compartmentalised, whilst I want the stuff to be openly accessible. Once the enabler is enabling as desired then it can be cast in stone - a fixed tool.

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

#46 Post by mikeb »

Hmm save folder might be up your street it seems...as using it everything contained is easily accessible as they are just files on a normal file system. It just becomes part of the union when running for convenience. As you realise...keeping the system core as a read only archive is a very robust approach. Just having a solid save method finishes the picture.

That was @rufwoof... funny how we end up with multiple conversations.

mike

User avatar
nic007
Posts: 3408
Joined: Sun 13 Nov 2011, 12:31
Location: Cradle of Humankind

#47 Post by nic007 »

mikeb wrote:Actually that answer was @ rufwoof ..sorry for thee confusion...you may batter me with whatever vegetable you have to hand...

mike
I know, was just chipping in. No confusion at all. Can we change the subject - how do you boot a "savefile" in the form of an SFS file as top layer? :D

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

#48 Post by mikeb »

Ok ... boot resembles PUPMODE=5

tmpfs made for pup_rw as is for mode 5

save sfs is mounted and contents copied to /pup_rw

unmount and carry on in normal fashion

thats it..so runs like mode 5 but top layer is populated from last session so effectively a save.

I did use .tar but tar in initrd ..embutils version..was flaky..probably improved or build a tiny libc version. uncompressed sfs does the same job apart from whiteout files need specifically handling when copying.

Shutdown just makes sfs of /tmpfs minus unneeded folders...easy to not make so giving a 'no save' option ..also easy to keep a backup of the previous session by renaming before creation.

Only caveats really is a suitable amount of ram + swap and saving during session could be done as otherwise say a power loss makes for an error free boot but only from the previous session. Never seems to need that as anything i want to keep in that way i save to a hard drive, memory stick or internet anyway...

mike

User avatar
nic007
Posts: 3408
Joined: Sun 13 Nov 2011, 12:31
Location: Cradle of Humankind

#49 Post by nic007 »

mikeb wrote:Ok ... boot resembles PUPMODE=5

tmpfs made for pup_rw as is for mode 5

save sfs is mounted and contents copied to /pup_rw

unmount and carry on in normal fashion

thats it..so runs like mode 5 but top layer is populated from last session so effectively a save.

I did use .tar but tar in initrd ..embutils version..was flaky..probably improved or build a tiny libc version. uncompressed sfs does the same job apart from whiteout files need specifically handling when copying.

Shutdown just makes sfs of /tmpfs minus unneeded folders...easy to not make so giving a 'no save' option ..also easy to keep a backup of the previous session by renaming before creation.

Only caveats really is a suitable amount of ram + swap and saving during session could be done as otherwise say a power loss makes for an error free boot but only from the previous session. Never seems to need that as anything i want to keep in that way i save to a hard drive, memory stick or internet anyway...

mike
I tried this at some stage but it didn't work for me. Can recall that the sfs created from the previous "saved session" didn't change icons (I changed the icons set during the previous session as a test) when the contents were copied to pup_rw ... Also, it was difficult to get rid of something that was saved somewhere in / instead of in root....but I'll play with it again.

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

#50 Post by mikeb »

was it done during the initrd phase? The pinboard is rewitten around the time x it launched.

whiteout handling is needed for sfs....would affect deletion of existing files but not added ones.

mike

Post Reply