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

Re: Cleaning DHCP and Host Info for New LAN





On Wed, Feb 16, 2011 at 5:38 PM, Hal Vaughan <hal@halblog.com> 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.

i'd get the resolvconf package to automate resolv.conf file. if this is on dhcp, you should be set. even most instances of the hostname could be configured through dhcp (i think exim is one such exception).

i'm not sure what your 'config program' does, so you might be set. if you don't use dhcp, you might write a script to go through and edit your files.

if you aren't using the same hardware with each system, you may have module issues (things to be added or removed from ailases). you'll obviously need to write the mbr to that flash card and toggle your bootable flag.

past this, it should be pretty cut and dry. you'll want to test it. you'll probably want to run commands like:
find /etc -type f -print0 | xargs -0 -i{} grep -H <hostname> {}
and see what pops up. you'll probably want to do the same thing for your ip, nameserver, network card - eth0, iw0, en0, whatever. if you use lvm and you assign a uuid name to your flash card, this will change and break things. if you use different hardware and your flash card shows up as sd vs hd, this will break. if you use an interface for iptables rules and that changes, it'll break the rule.

Reply to: