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 01 Jul 2015, 23:44
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 Posts_count  
Author Message

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


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.

Back to top
Official Crustacean

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

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


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


Puppy WIKI
Back to top
View user's profile Send_private_message Visit_website 
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.

Back to top
View user's profile Send_private_message 

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


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

Back to top

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?

Back to top
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?

Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

You cannot attach files in this forum
You can download files in this forum

Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0595s ][ Queries: 12 (0.0081s) ][ GZIP on ]