[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Cleaning DHCP and Host Info for New LAN



On Feb 16, 2011, at 10:22 PM, Bob wrote:

> On 02/17/2011 06:38 AM, Hal Vaughan wrote:
>> I'm working with some embedded systems where the OS will be Squeeze on a CF card.  The idea is to have a basic setup that will be stored in a zip file and when it's time to create a new system, the files will be unzipped onto a new CF card, then the card will be put in a new system.
>> 
>> Of course to do this, I have to start with a base system or prototype and I don't want the info for my LAN or anything else like that to be passed on or left in the file system of the newer systems.  When the new CF card is put into each new system and it is turned on, there's a command that will make the new system automatically download a config program that will make all needed changes to the embedded computer.
>> 
>> That leads to the question, "What do I change?"  I'll be changing the host name, which is in /etc/hostname and /etc/hosts.  I also need to change the host name in /etc/exim4/update-exim4.conf.conf and in /etc/mailname.  The user names in passwd and so on don't need changing, since each system has the same user name.
>> 
>> I also know the domain is specified in /etc/resolv.conf.  But if I'm getting the info for a network connection through DHCP, won't they be overwritten once the info comes in from the DHCP?
>> 
>> Are there other files where I'd have to change the values so the new system doesn't contain references to the original LAN or host name or any other similar info?
>> 
>> I'm not worried about files that will be re-written on the first boot (like anything dhclient or any DHCP stuff will re-write once it's on a new LAN), but I'd like to know if I'm missing any info that I need to erase or change.
>> 
>> I'm not sure, but I think most of the info would be related to DNS or DHCP.
>> 
>> Thanks for any info on this.

This does help!  Some of these I'll be handling in specific ways.  If there seems to be a problem with something I'm doing, feel free to let me know.

> when I copy my install I
> edit /etc/hostname

That stays as is in the image so I can find it (and other files) with the host name and will be edited by my install program.

> rm -f /mnt/src/var/swap

This doesn't exist, but I'm using a partition and not a swap file.  It set that up by default and I don't think I need to change it.

> rm -f /mnt/src/etc/udev/rules.d/70-persistent-net.rules
> rm -f /mnt/src/etc/udev/rules.d/70-persistent-cd.rules

Thanks for this one -- I don't have the cd.rules, but do have the net.rules and that would cause problems because of the different MAC addresses.  Will the net.rules one be regenerated on boot if it doesn't exist?

> rm -f /mnt/src/var/lib/ntp/ntp.drift

Not even on this system.  I will be installing ntp, but at a later stage.

> rm /etc/ssh/ssh_host_*
> dpkg-reconfigure openssh-server

Almost all the ssh files will be re-configured, replaced, or deleted by the install program.  I had not thought of reconfiguring.  If the other files are deleted, what else does reconfiguring the ssh server do?  (I'm actually considering not installing ssh until the update phase, since that'll force a new config for each system.  But without ssh, if anything goes wrong, it's a pain to have to find the USB-serial adaptor and the cable and hook it all up to log in.)

> After that it's mainly hardware specific stuff.

Hardware isn't a real issue, other than MAC addresses, since I'm using a system where the board hasn't changed in a while and likely won't change for a good while, at least  it likely won't change as long as I'm involved with this.  So one system should look just like the rest hardware wise.

> 
> Also see my response in the thread "Installing Debian on USB sticks."

Been looking at that, too -- thanks for the heads up on that!

Thank you!



Hal

Reply to: