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 Wed 23 Apr 2014, 17:15
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
Multi machine access with USB version
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [6 Posts]  
Author Message
MwPhoto
Guest


PostPosted: Wed 18 May 2005, 14:28    Post subject:  Multi machine access with USB version  

Hi,

I have multiple machines I use Puppy on and they have a variety of configurations (different monitor, mouse, network types etc). What I want to do is identify the machine and then use the appropriate settings.

I'm pretty sure I can do it with the following process:

1) Get the MAC address of the ethernet card to uniquely identify the PC - not perfect but good enough

2) I use the MAC address as a directory to copy config files ie,
cp /root/localconfig/**MACADDRESS**/dhcpinfo/* /etc/dhcpc/*
cp /root/localconfig/**MACADDRESS**/videomode /etc/videomode

If the MAC hsan't been seen before these files will be deleted so the normal boot process will allow you to configure (for videmode for example)

then at the end of the session I use a similar script to copy them back again.

I can write all the scripts necessary, however I'm not sure how to get them into the startup/shutdown process. Clearly the copying needs to happen very early on so the various devices pick up the right files.

Can anyone help me by identifying where in the rc scripts I can call my stuff?

With this in place it should mean I can take my USB drive and use any machine I like and not worry about the resolutions etc.

I'm happy to feed these back to the main development stream if this is thought to be a useful feature.

Malcolm
Back to top
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15117
Location: Paradox Realm

PostPosted: Wed 18 May 2005, 20:33    Post subject: Pup in boots  

/etc/rc.d/rc.local

Place your script on the end of this list of files you wish to call

Look forward to seeing what you come up with

Good Luck - I like it already - Good plan

Smile

_________________
Puppy WIKI
Back to top
View user's profile Send private message Visit poster's website 
nduanetesh
Ultra Super-stud

Joined: 05 May 2005
Posts: 168

PostPosted: Wed 18 May 2005, 20:41    Post subject:  

Hi Malcolm!

I think you and I are working toward the same goal. See my thread, here. But I think your method is far more elegant than my idea. I know that it's late in the boot process, but usually when you want to make certain hardware settings permanent, you add lines to /etc/rc.d/rc.local. Do you think it's too late in the boot process? At least it is called before X starts.

ND
Back to top
View user's profile Send private message 
MwPhoto
Guest


PostPosted: Thu 19 May 2005, 05:06    Post subject: Long post about multi-machine start with some scripts  

Ok,

I've started some scripting that's partly useful, but it has some irritations. Firstly what it does:

1) on startup it checks for the existence of the directory /etc/rc.d/localconfig - if it isn't there it does nothing. This way it the user doesn't want it the script has no effect.

2) second it asks for the machine you are using (I was initially going to use a MAC address to identify the machine but I wasn't sure how far in the boot process we would be so I didn't know if it would work.)

3) it copies /etc/videomode, /etc/mousedevice and /etc/eth0mode for this machine. Any help on other files it would be useful to preserve would be good!

Startup script is currently written in rc.local as far as I can tell this is before xwin starts so we're ok for windows stuff. For the ethernet I down and up the device to make the new settings work.

for the shutdown script it should do the reverse but it will have remembered the machine name.

Now for the irritations

I can't find a suitable place to put the shutdown script, rc.reboot seems to get overwritten - any ideas? At the moment I'm simply running it manually before shutdown, but I would like to automate it.

Anyway for what it's worth i've attached the VERY ALPHA scripts so you can take a look.

To have a go

copy the rc.local script to /etc/rc.d

create a directory /etc/rc.d/localconfig.

For first time 'sanity' I'd also create /etc/currentlocalsetting as a text file with a single word which is the name of your computer (no whitespace) and run rc.localconfigreboot. This will preserve your current settings

At this stage I'd probably recommend just taking a look to see what I'm doing Smile

Malcolm
Back to top
MwPhoto
Guest


PostPosted: Thu 19 May 2005, 07:08    Post subject: Further issues  

One other irritation,

at the moment if it's a new computer then the script deletes the mousedevice etc. I was hoping that this would then revert to default behaviour, however I now realise that rc.local is too late in the boot up process so I am simply deleting files and there will be no defaults left Sad

So the start script will have to be earlier in rc.sysinit

How can I change these files so they stay changed while I'm in the development process?

Malcolm
Back to top
nduanetesh
Ultra Super-stud

Joined: 05 May 2005
Posts: 168

PostPosted: Thu 19 May 2005, 23:50    Post subject:  

HI Malcolm,

The readme.txt file found in /etc/rc.d/ says that rc.sysinit, rc.modules, and rc.update are all loaded from image.gz upon boot, though there are copies in /etc/rc.d/ So, you'd have to edit them inside image.gz, or somehow get puppy to load them from somewhere other than image.gz. The readme file goes on to say:

"Those marked as "pristine" [the three listed above] are run from the image.gz file, although you will find copies of them in /etc/rc.d/. The rest are editable, and are actually located at
/root/.etc/, as /etc is just a symlink to there.
What happens at bootup is firstly image.gz is loaded into
the ramdisk, and rc.sysinit will execute.
A partition is mounted on /root, and /etc is then relinked
to point to /root/.etc -- hence by the time rc.local0
executes, it is from the mounted partition."

So, from the sounds of that, it's going to be tricky to edit rc.sysinit and make your changes stick...

Any of the really smart people have any ideas?

ND
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [6 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Users ( For the regulars )
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.0467s ][ Queries: 11 (0.0032s) ][ GZIP on ]