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 Thu 27 Nov 2014, 10:36
All times are UTC - 4
 Forum index » Advanced Topics » Cutting edge
How to save settings with a diskless client?
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [22 Posts]   Goto page: 1, 2 Next
Author Message
Benno_fra_DK

Joined: 13 Aug 2013
Posts: 8

PostPosted: Tue 13 Aug 2013, 15:53    Post subject:  How to save settings with a diskless client?
Subject description: Keeping settings when booting over PXE
 

I have successfully booted the Puppy-derivative "Browserlinux" over PXE on a diskless client following the guide found here:

http://sirlagz.net/2011/06/13/how-to-boot-puppy-5-2-5-over-pxe/

But on each boot, I am presented with the settings option, and on each shutdown, the system tells me, that settings were not saved. (Naturally, since the client is diskless)

My workaround has been setting up a browserlinux and copying the pup save.2sf file from there, but with no success.

My first try was copying the file into the newinitrd.gz-file as was done with the pupXXX.sfs-file in the tutorial above, but this shows up nowhere in the system.

My second try was unsquashing the pupXXX.sfs-file, putting the pupsave.2fs-file in /mnt/home and resquashing the file system, but this left me with a kernel error.

Any suggestions?
Back to top
View user's profile Send private message 
Benno_fra_DK

Joined: 13 Aug 2013
Posts: 8

PostPosted: Tue 13 Aug 2013, 16:44    Post subject:  

BTW - I only want to save settings once. I just want to boot up the same session on every startup.
Back to top
View user's profile Send private message 
sunburnt


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

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

Hi Benno_fra_DK; The Save file does need to be inside the initrd.gz file with the SFS file.

This makes for a large initrd.gz file, maybe 200 MB with a 256 MB Save file.
If the browser is setup to not cache anything, then the Save can be smaller.

Puppy`s boot code needs to be modded, a few folks here know how to do it.
Puppy only searches for the Save file on partitions, not in the init-ramdrive.
.

Last edited by sunburnt on Thu 15 Aug 2013, 12:01; edited 1 time in total
Back to top
View user's profile Send private message 
Benno_fra_DK

Joined: 13 Aug 2013
Posts: 8

PostPosted: Thu 15 Aug 2013, 04:18    Post subject:  

Hi and thanx for the reply.

Since I am booting browserlinux and I only need the savefile to store the basic setup(internationalization and standard homepage) once, my pupsave-file can be relatively small(around 32 mb).

In /etc/rd.d/ there is a file called "PUPSTATE", that seems to define where to look for the savefile.

I need to be able to put my pupsave.2sf file somewhere puppy can find after boot, and I also need to edit this PUPSTATE-file.

I think maybe the kernel panic comes from my resquashing the filesystem.
What are the correct parameters to do that?
Back to top
View user's profile Send private message 
Flash
Official Dog Handler


Joined: 04 May 2005
Posts: 11164
Location: Arizona USA

PostPosted: Thu 15 Aug 2013, 09:07    Post subject:  

Once you figure out the Save file (I can't help you there,) you need to tell your web browser to put its cache in /tmp so the browser's cache doesn't fill up the Save file. In SeaMonkey, that's done in Edit -> Preferences -> Advanced -> Cache.
Back to top
View user's profile Send private message 
sunburnt


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

PostPosted: Thu 15 Aug 2013, 12:30    Post subject:  

Good tip Flash; That was my repeat warning too.

Benno_fra_DK; The PUPSTATE file is written after the Save file`s mounted.

This is way it can be difficult to modify Puppy`s boot code.
It uses variables all through the boot scrips, if you mod. the scripts,
then the variables must be filled or corrected, or Puppy won`t boot.

In Puppy-5.2.8 initrd.gz file, the Save file mount command is at line 1120.
And the PUPSAVE variable is set at lines 624, 771, 786, 886.

And in Puppy-racy-5.5 it`s at line 1199.
And it`s PUPSAVE variable is set at lines 344, 833, 848, 948.

As you can see, modding Puppy`s boot code is fraught with peril.

Best idea is to do it right and include the init-ramdrive as part of the search.
This would be even more work of course, but it wouldn`t be code hacking.

# Let me get this straight, you want to load the Save file in ram,
so that you can configure and copy of it, so to use the copy for booting?
Back to top
View user's profile Send private message 
Benno_fra_DK

Joined: 13 Aug 2013
Posts: 8

PostPosted: Thu 15 Aug 2013, 14:23    Post subject:  

This stuff keeps getting more hairy/scary...

What I really want is to boot the same setup every time I start browserlinux from pxe.

Maybe this can be done with this hack(then scr*w the savefile):
http://murga-linux.com/puppy/viewtopic.php?search_id=10026045&t=81943
Back to top
View user's profile Send private message 
sunburnt


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

PostPosted: Thu 15 Aug 2013, 16:14    Post subject:  

Yes, Puppy`s Save file and main SFS file are unioned into one file system.

So if you boot your Puppy, then set it up how you want it..
Then make and run this script it`ll join the Save and SFS files in a new SFS file.
The nice part is, it won`t mess with the original SFS file.
So you can experiment and make many SFS files until it`s right.

Keep a copy of the original main SFS file, rename it: (filename).sfs_ORG
Then rename the new file by taking the "_NEW" off the end of the file name.
Then put it where the original SFS file was and boot it.
# NOTE: You`ll need to do the file renaming and moving while booted to a different Puppy.

Try this script and let me know how it works. Be sure the script has exec. properties.
Code:
#!/bin/sh
#########Join Puppy`s Save and main SFS files in a new SFS file.

#####   Terry Becker   SunBurnt   Aug. 15  2013


#####   First setup the running Puppy how you want it, then run this script.

#####   It will make a new Puppy main SFS file in /tmp with "_NEW" at the end.



echo -e '\n###  Joining Save and SFS files into new SFS file. Please wait...\n'


sfsFN=`losetup /dev/loop2 |sed 's#^.*/##'`

squashfs /initrd/pup_rw /initrd/pup_ro2 /tmp/$sfsFN'_NEW'


echo -e '\n###  Done joining Save and SFS files into:  /tmp/$sfsFN'_NEW'\n'

Last edited by sunburnt on Thu 15 Aug 2013, 16:47; edited 1 time in total
Back to top
View user's profile Send private message 
Flash
Official Dog Handler


Joined: 04 May 2005
Posts: 11164
Location: Arizona USA

PostPosted: Thu 15 Aug 2013, 16:24    Post subject:  

This seems like another way to remaster Puppy. Or maybe a poor man's remaster? But it won't solve the problem of Save files if more than one person boots the same iso from the network, will it? Or do I completely misunderstand what you're doing?
Back to top
View user's profile Send private message 
sunburnt


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

PostPosted: Thu 15 Aug 2013, 16:43    Post subject:  

No Save file needed at all. The setup boot makes a Save file to be arranged.
Then the script makes a new SFS file from both the Save and main SFS files.
After that the PXE boot loads Puppy and it`s configured modded SFS file.

As more configuration changes are made, just make a new SFS file.

# Realized a full remaster script may be a better choice here.
Puppy has a flag file for Xwin failure at boot, there may be others too.
This will show the [ Ignore ] [ Ram Boot ] options at each boot.
.

Last edited by sunburnt on Thu 15 Aug 2013, 23:09; edited 2 times in total
Back to top
View user's profile Send private message 
Jasper


Joined: 25 Apr 2010
Posts: 1168
Location: England

PostPosted: Thu 15 Aug 2013, 17:39    Post subject:  

Hi sunburnt,

Seems a simple, yet ingenious, idea - and especially (for my needs) if it might be adapted to merge multi-session-CD/DVD date files with the main sfs - since it would probably reduce my boot time by some 30 seconds.

My regards

PS Am I right to think that Frugal users could easily remove built-in packages (e.g. a browser they don't want) before making the new sfs?
Back to top
View user's profile Send private message 
greengeek

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

PostPosted: Thu 15 Aug 2013, 18:30    Post subject:  

Great idea sunburnt. I'm keen to give it a try. Just a question though - presumably there is a risk of including critical or personal info by doing this method - such as wireless router passwords, or browser history, that sort of thing?? Do you have any tips to ensure the user can include / exclude exactly what they want?
Back to top
View user's profile Send private message 
sunburnt


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

PostPosted: Thu 15 Aug 2013, 23:24    Post subject:  

greengeek; First boot, do a shutdown and make Save file ( as always ).
Second boot configure settings and apps. and run script.
For a new "clean" SFS file, boot to ram, configure, new Save file at shutdown.

Most of what needs to be in the SFS file is in /root, passwords are in /etc.
Apps can have config. file anywhere, so it`s a real task to track them all.
Tracking each item is a thankless job I wouldn`t wish on anyone.

# Realized a full remaster script may be a better choice here.
Puppy has a flag file for Xwin failure at boot, there may be others too.
This will show the [ Ignore ] [ Ram Boot ] options at each boot.
Full remaster scripts must "patch" all of Puppy`s checks. Yep a can of worms.

# Many remaster scripts have been written over the years, start your search.
Try the Puppy menu remaster. Menu > Setup > Remaster Puppy Live CD.
There`s other scripts folks have made too, look for them, try them out...


Jasper; In removing apps. it`s hard to get all of each one, so many files.
.

Last edited by sunburnt on Fri 16 Aug 2013, 04:33; edited 2 times in total
Back to top
View user's profile Send private message 
Benno_fra_DK

Joined: 13 Aug 2013
Posts: 8

PostPosted: Fri 16 Aug 2013, 03:12    Post subject:  

I might be a poor man, but this is exactly what I need.
I run a school network with older PC only for working online. This makes browserlinux(and puppy) the perfect companion.
Having every user boot the same setup every time fits my needs perfectly.

Only problem is, that I might have to work overtime today because I can't wait to try it out. Very Happy
Back to top
View user's profile Send private message 
Benno_fra_DK

Joined: 13 Aug 2013
Posts: 8

PostPosted: Fri 16 Aug 2013, 06:28    Post subject:  

Tried out the script... doesn't work

Did you mean "mksquashfs" instead of "squashes"?

The losetup part errors out, because /dev/loop2 is not found, but this is only to find the name op the pup.sfs-file?

Tried to do
mksquashfs /initrd/pup_rw /initrd/pup_ro2 /tmp/foo.sfs

This keeps stating, that filesystem has changes until it crashes everything, probably because it is trying to squash the output-file??

Then tried to copy the /initrd/pup_rw file with the -P option, squashed that and /initrd/pup_ro2 to a file - copyed that over, put it in the inited and booted over PXE.

Result:
Performing a 'switch_root' to the layered filesystem...Kernel Panic - not syncing: Attempted to kill init!

Crying or Very sad
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 2 [22 Posts]   Goto page: 1, 2 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.0843s ][ Queries: 12 (0.0046s) ][ GZIP on ]