How to Build a Locked-Down Installation of Puppy

How to do things, solutions, recipes, tutorials
Message
Author
Indy'spup
Posts: 50
Joined: Wed 11 May 2011, 15:32
Location: SoCal

#21 Post by Indy'spup »

Sorry was just coming back to that..

this data directory?

mount /dev/sda1 /mnt/data
cp /mnt/data/puppy431/pup_save.bak /mnt/data/puppy431/pup_save.2fs
umount /mnt/data
User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

#22 Post by sc0ttman »

rcrsn51 I like your approach.. Looks nice.. I think I have another method, any thoughts or ideas are welcome... It is not yet made, or tested, although I see no problems in making this a reality.

Anyway... Here's the method:

I plan to make a 'kiosk' (locked down) mode for puppy, by editing the initrd.gz and adding a new pfix option ('pfix=kiosk', of course)... Booting with 'pfix=kiosk' will add an entry into /etc/PUPSTATE (as I believe this is already done from the init script), that says KIOSK=true.

If KIOSK=true, the save interval in the Puppy Event Manager wil be forced to zero (no scheduled saves).. Also, rc.shutdown will be updated, so that it checks for kiosk mode in PUPSTATE and skips saving to the save file at shutdown.

I also have made a 'delaysave' pfix option, which simply forces PUPMODE 13 into PUPMODE 12 - which disables real-time saving to the save file. Kiosk mode, which must also force the 'delaysave' option, would create a locked-down puppy, that can be enabled and disabled at boot, regardless of which save file is being used.

This is much more complicated than your method, but I think it's really quite flexible, and I will give it a go! Just thought I'd share the approach that I was thinking of using, take it or leave it! ;)

Hope I'm not invading the thread!
Last edited by sc0ttman on Sun 22 May 2011, 22:21, edited 2 times in total.
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]
Indy'spup
Posts: 50
Joined: Wed 11 May 2011, 15:32
Location: SoCal

#23 Post by Indy'spup »

The reason is that a /mnt/data directory doesn't exist in my fugal install. so I created one, ie: a data directory along with the nested directory puppy520, inside this I copied the file macpup_save.bak and edited the initrd entry accordingly.

only thing is (I know you guessed it!) the darn sav.bak file is never read or copied at boot time..

Must be related to it's location, which is why I wondered about the significance of the data directory.

:)


I need to go back to square one I think.. and RTFM
User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#24 Post by rcrsn51 »

Indy'spup wrote:this data directory?

mount /dev/sda1 /mnt/data
cp /mnt/data/puppy431/pup_save.bak /mnt/data/puppy431/pup_save.2fs
umount /mnt/data
Windows users are used to copying files from locations like C: to D:.

But in Linux, you have to mount a partition before you can work with the files in it. You can think of a mount point as being a door that gives you access to the files in a partition. (Have you seen the children's movie Monsters Inc.?)

Since all Puppies have a predefined mount point named /mnt/data, the script uses it to copy the file pup_save.bak to pup_save.2fs.

There is nothing special about /mnt/data. You can use any directory as a mount point.
User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#25 Post by rcrsn51 »

Indy'spup wrote:The reason is that a /mnt/data directory doesn't exist in my fugal install.
???

I just checked my frugal install of Macpup520 and /mnt/data was definitely there. Of course, it's empty until you mount something onto it.
Indy'spup
Posts: 50
Joined: Wed 11 May 2011, 15:32
Location: SoCal

#26 Post by Indy'spup »

lol ok I understand I'm not looking in the correct places 90% of the time

sorry for hijacking the thread, maybe a moderator can move my posts back to my original thread..?


Meanwhile, is this a valid entry?

#######END MODULE LOADING TO ACCESS DRIVES##########

mount /mnt/sda1/puppy520
cp /mnt/sda1/puppy520/macpup_save.bak /mnt/sda1/puppy520/macpup_save.2fs
umount /mnt/sda1/puppy520


#########FINDING PUPPY FILES#############
User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#27 Post by rcrsn51 »

This is correct.

Code: Select all

mount /dev/sda1 /mnt/data
cp /mnt/data/puppy520/macpup_save.bak /mnt/data/puppy520/macpup_save.2fs 
umount /mnt/data
Indy'spup
Posts: 50
Joined: Wed 11 May 2011, 15:32
Location: SoCal

#28 Post by Indy'spup »

OK thanks I'm going to give this a whirl now :)
Indy'spup
Posts: 50
Joined: Wed 11 May 2011, 15:32
Location: SoCal

#29 Post by Indy'spup »

Oh Brother....!! :roll: :? :?

I must be missing something.. back to the manual!

lol
Indy'spup
Posts: 50
Joined: Wed 11 May 2011, 15:32
Location: SoCal

#30 Post by Indy'spup »

I've been under the impression that puppy will load any save file which ends in .2fs now I'm not so sure of that criteria..

Am also not so sure it was wise to configure the puppy installation saved to the puppy save file prior to editing the initrd script..

Since I've not been successful in keeping the save file after a reboot I've commented out the changes in the initrd script until I can get puppy to load the save file previously created..
:(

brb
Indy'spup
Posts: 50
Joined: Wed 11 May 2011, 15:32
Location: SoCal

#31 Post by Indy'spup »

Oh My!! I just realized what the problem is, incorrect save extension; should be 3fs
:roll:
Indy'spup
Posts: 50
Joined: Wed 11 May 2011, 15:32
Location: SoCal

#32 Post by Indy'spup »

Ok all back to normal :) frugal install loading previously configured save file at boot and initrd edited and corrected as per earlier post.

moving along to the next phase; I noticed the "Data" directory is infact available at boot now so does the renamed save.bak file need to be moved to this location (data directory)?

Ok Disregard that!! I think the Data directory is a pointer to the home directory because without moving save files the whole deal is working as published
YAY!!

just took forever getting there for a noob!! Thanks rcrsn51 for your patience
:D
Last edited by Indy'spup on Sun 22 May 2011, 23:56, edited 2 times in total.
User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#33 Post by rcrsn51 »

Indy'spup wrote:moving along to the next phase; I noticed the "Data" directory is infact available at boot now so does the renamed save.bak file need to be moved to this location (data directory)?
????

It sounds like you made a "Data" directory either in /mnt/sda1 or in /mnt/home. This is incorrect. The mount point /mnt/data already exists in your Puppy filesystem.

You don't need to change anything else. What is the "next phase" to which you want to move?
Indy'spup
Posts: 50
Joined: Wed 11 May 2011, 15:32
Location: SoCal

#34 Post by Indy'spup »

Oh man you're too quick!!

Just edited my last post :D
Indy'spup
Posts: 50
Joined: Wed 11 May 2011, 15:32
Location: SoCal

#35 Post by Indy'spup »

Just so I understand what the heck just happened..

the mount point already exists, ok I understand that.

but the mount point is empty? yet the script copies the *save.bak file to the same empty location and renamed it *save.3fs

during boot up puppy loaded the newly created *save.3fs into memory and the file is found in the home directory. I think there is some hard linking going on??
Indy'spup
Posts: 50
Joined: Wed 11 May 2011, 15:32
Location: SoCal

#36 Post by Indy'spup »

the next phase was where do I place the *save.bak file but I have since accidentally found that out for myself lol

Thanks again rcrsn51 for being so patient with the dumb questions
Indy'spup
Posts: 50
Joined: Wed 11 May 2011, 15:32
Location: SoCal

#37 Post by Indy'spup »

Ok how about this one.

in the /mnt/home/puppy520 directory i have two files (but others also) namely a *save.bak & *save.3fs

Q1 at every reboot puppy will overwrite the *save.3fs with the contents of *save.bak But what if the contents did not change? is the file overwritten regardless? What about a "What if" statement to compare if a change has been made then skip overwrite if they're the same?

Q2 if I need to make a change to the system AFAIK I need to delete the *save.bak file - make the changes and reboot saving to the *save.3fs file - On reboot to the live cd I only need to rename the *save.3fs file to *save.bak then reboot without saving changes (with respect to the live cd) correct??

Q3 Is puppy aware of save file name changes? eg is puppy expecting a specific save file as previously saved or if perhaps the name was changed via a live cd, will puppy load the *save file so long as it has a *.3fs or *.2fs file extension??

Q4 Are the 2fs or 3fs save file extensions reflective of the file system used within the save file??
User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#38 Post by rcrsn51 »

Indy'spup wrote:Q1 at every reboot puppy will overwrite the *save.3fs with the contents of *save.bak But what if the contents did not change? is the file overwritten regardless?
Yes. The lines of code you added to the initrd don't check to see if the save file changed in the previous session. But it only takes a few seconds to overwrite the file.
Q2 if I need to make a change to the system AFAIK I need to delete the *save.bak file - make the changes and reboot saving to the *save.3fs file - On reboot to the live cd I only need to rename the *save.3fs file to *save.bak then reboot without saving changes (with respect to the live cd) correct??
That sounds too complicated. When you make a change to the system, that change is immediately stored in the save.3fs. To "lock in" that change, boot off the Live CD, mount the Puppy partition and copy the current save.3fs over top of the save.bak file. Then reboot.
Q3 Is puppy aware of save file name changes? eg is puppy expecting a specific save file as previously saved or if perhaps the name was changed via a live cd, will puppy load the *save file so long as it has a *.3fs or *.2fs file extension??
Each Puppy version is coded to look for a savefile with a particular name. In your case it's either macpup_save.2fs or .3fs. If it finds other files that it thinks might also be savefiles, it gives you a menu.
Indy'spup
Posts: 50
Joined: Wed 11 May 2011, 15:32
Location: SoCal

#39 Post by Indy'spup »

rcrsn51 wrote:
Indy'spup wrote:Q1 at every reboot puppy will overwrite the *save.3fs with the contents of *save.bak But what if the contents did not change? is the file overwritten regardless?
Yes. The lines of code you added to the initrd don't check to see if the save file changed in the previous session. But it only takes a few seconds to overwrite the file.
I guess that depends on the size of the save file and how slow the equipment.. for me this took a minute approximately - a small price to pay but am thinking a changed save file is more rare than it is a daily occurrence is all..
Q2 if I need to make a change to the system AFAIK I need to delete the *save.bak file - make the changes and reboot saving to the *save.3fs file - On reboot to the live cd I only need to rename the *save.3fs file to *save.bak then reboot without saving changes (with respect to the live cd) correct??
That sounds too complicated. When you make a change to the system, that change is immediately stored in the save.3fs. To "lock in" that change, boot off the Live CD, mount the Puppy partition and copy the current save.3fs over top of the save.bak file. Then reboot.
I agree, less steps are better :)
Q3 Is puppy aware of save file name changes? eg is puppy expecting a specific save file as previously saved or if perhaps the name was changed via a live cd, will puppy load the *save file so long as it has a *.3fs or *.2fs file extension??
Each Puppy version is coded to look for a savefile with a particular name. In your case it's either macpup_save.2fs or .3fs. If it finds other files that it thinks might also be savefiles, it gives you a menu.
Interesting, thanks..

sorry i kept returning to add more to each question, but what of Q4 ??
User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#40 Post by rcrsn51 »

Q4 Are the 2fs or 3fs save file extensions reflective of the file system used within the save file??
Yes.
Post Reply