Re: Cleaning DHCP and Host Info for New LAN

2011-02-17 Thread Alan Chandler

On 16/02/11 22:38, 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.



Hal




Two small questions.

1) Why do you need exim?  you could consider ssmtp although you still 
need to make sure /etc/ssmtp/ssmtp.conf has the correct stuff in for 
your needs (it needs to know the mail hub to send mail to and it needs 
to know the domain name mail needs to seem to come from)


2) Your /var files will have loads of evidence of where the device has 
been.  What are doing about that.  I'm thinking about /var/log stuff but 
also thinks like previous dhcp leases which are stored there.




--
Alan Chandler
http://www.chandlerfamily.org.uk


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/4d5cd8f4.20...@chandlerfamily.org.uk



Re: Cleaning DHCP and Host Info for New LAN

2011-02-17 Thread Bob

On 02/17/2011 12:24 PM, Hal Vaughan wrote:

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

On 02/17/2011 06:38 AM, Hal Vaughan wrote:


8 snip system image pushed onto a CF card


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?


Yes.

If you want a portable system where the LAN is always eth0 then you want 
to stop those files being generated,

chmod -c 644 /lib/udev/write_*
will do that but I get the impression with your project once the image 
is flashed onto a card it won't be moved that much.



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


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


With my system images I try to configure as much as possible before I 
take the image  as I have an NTP server on my firewall I like all my 
internal machines to sync off that which requires editing /etc/ntp.conf 
so I do it before and have the big block of commands I'm pasting onto a 
shell prompt sort it out for me.  A lot of it's over kill, only some of 
my system images have swap file installed but it doesn't hurt to try  
delete a non-existent file  this way the text file from which I paste 
the commands is more general.


I can role out a nicely configured functional desktop image onto a 
harddrive, flash card, or USB stck in under 10 minutes which is very 
handy, after that all the system needs is updating (I have an apt-proxy 
so that's bloody quick)  my friends old tired pox ridden winblows box 
is a sprightly Squeeze workstation.



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.)


I do it to generate new keys it may not be the most elegant way but it 
works.



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.


That helps a lot, the 10 minutes quoted above doesn't take into account 
bullying ALSA to play nice and use the USB webcam mic by default etc..



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



--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/4d5d093d.9090...@homeurl.co.uk



Re: Cleaning DHCP and Host Info for New LAN

2011-02-17 Thread Hal Vaughan

On Feb 17, 2011, at 6:40 AM, Bob wrote:

 On 02/17/2011 12:24 PM, Hal Vaughan wrote:
 On Feb 16, 2011, at 10:22 PM, Bob wrote:
 On 02/17/2011 06:38 AM, Hal Vaughan wrote:
 
 8 snip system image pushed onto a CF card
 
 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?
 
 Yes.
 
 If you want a portable system where the LAN is always eth0 then you want to 
 stop those files being generated,
 chmod -c 644 /lib/udev/write_*
 will do that but I get the impression with your project once the image is 
 flashed onto a card it won't be moved that much.

No, it won't be.

In short, I'm working with a Soekris net5501, 512MB, 512Mhz with a slot for CF 
cards, a USB port, and an IDE port and PCI slot, but I'm not using IDE or PCI.  
I'm using the one I have now to develop the system and in the long run, I'll 
have several of these, each one going into a different office, which means 
different LANs.  Once I get the image the way I want it on this CF card, I'll 
copy it and use it for other CF cards.  When it's time to make a new unit, I'll 
copy the OS image onto a CF card, put that in the box, then put a USB RAM drive 
in.  It'll find the file update.tgz, unpack it, and run a file within it.  That 
file will use apt to first update the system, then add on more packages, and 
finally install the software I'm writing.

So once I have a new CF card, it'll stay in one system and won't move at all, 
but the system will be put on a different LAN.

 rm -f /mnt/src/var/lib/ntp/ntp.drift
 
 Not even on this system.  I will be installing ntp, but at a later stage.
 
 With my system images I try to configure as much as possible before I take 
 the image  as I have an NTP server on my firewall I like all my internal 
 machines to sync off that which requires editing /etc/ntp.conf so I do it 
 before and have the big block of commands I'm pasting onto a shell prompt 
 sort it out for me.  A lot of it's over kill, only some of my system images 
 have swap file installed but it doesn't hurt to try  delete a non-existent 
 file  this way the text file from which I paste the commands is more general.

I'm using a minimal image on the CF card because I don't want to be changing 
the along the way, I want it stable and static.  The install program in 
update.tgz will be where all the other configuration happens, since it'll be 
easier to make changes there and just re-tarball that image when I need to.

Normally I'd agree with you and want the image to be as complete as possible.  
In this case, I think you could say I'm working with two images, the first is 
the one that goes onto the CF card and the other is the one including the 
update program and that's the one that will be complete when it's done.

 I can role out a nicely configured functional desktop image onto a harddrive, 
 flash card, or USB stck in under 10 minutes which is very handy, after that 
 all the system needs is updating (I have an apt-proxy so that's bloody quick) 
  my friends old tired pox ridden winblows box is a sprightly Squeeze 
 workstation.

I can see how that would be quite useful, but other than these small embedded 
systems, I am not doing much in terms of installing or creating new systems.  I 
use an iMac for my desktop now and my servers are on Linux.  I also have a 
number of VMs under Parallels for work and on the last one, which was Squeeze, 
I just told Parallels where the iso was and it did the rest automatically.  But 
VMs do have a lot of advantages over building something on new hardware.

 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.)
 
 I do it to generate new keys it may not be the most elegant way but it works.

Quick and simple, though.  I like that because it eliminates work.

 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.
 
 That helps a lot, the 10 minutes quoted above doesn't take into account 
 bullying ALSA to play nice and use the USB webcam mic by default etc..

Don't 

Re: Cleaning DHCP and Host Info for New LAN

2011-02-17 Thread Bob

On 02/18/2011 02:23 AM, Hal Vaughan wrote:

On Feb 17, 2011, at 6:40 AM, Bob wrote:

On 02/17/2011 12:24 PM, Hal Vaughan wrote:

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

On 02/17/2011 06:38 AM, Hal Vaughan wrote:


8  snip system image pushed onto a CF card, sounds like a firewall, VPN 
or asterisk box but once configured fairly static, also a discussion on 
the advantages of keeping your system image minimal  a post install 
script maximal vs a mainly configured sys image along with my boasting 
about the number  awesomeness of my sys images.
In fact snip everything before my inappropriate thread jack on the 
subject of ALSA



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.


That helps a lot, the 10 minutes quoted above doesn't take into account 
bullying ALSA to play nice and use the USB webcam mic by default etc..


Don't get me started on ALSA.  That's one reason my desktop isn't Linux.  (But 
I did use a Linux desktop for close to 10 years -- had to change for several 
reasons, including a need to be able to do video editing without spending hours 
fiddling with importing camcorder file formats.  Also, sound was ALWAYS an 
issue, in ALSA and otherwise.)


I haven't tried Video editing on Linux yet but it's on the todo list, 
however I've had a bit of a breakthrough with ALSA recently, I always 
used to disable on-board sound  use cheap Creative Labs SB Live value 
cards or similar (which can be had second hand for a pittance) because 
they have a hardware mixer and thus enabled trouble free playing from 
multiple sound sources without having to muck about with all those 
tedious sound servers, esd, Pulse, Jack  there's a gnome one, I can't 
be bothered.


However Alsa in Squeeze is *much* better I have a /etc/asound.conf file 
that looks like this  it seems to work for everything.


 pcm.!default {
 type asym
 playback.pcm {
 type plug
 slave.pcm hw:0,0
 }
 capture.pcm {
 type plug
 slave.pcm usbmic
 }
 }

pcm.usbmic
{
type hw
card U0x46d0x8ce
}
ctl.usb {
  type hw
  card U0x46d0x8ce
}

I can't have Simultaneous AC3/DTS passthrough  nicely downmixed stereo 
analog output like that provided by mplayers hrtf audio filter which 
I've wanted for a while

http://lists.debian.org/debian-user/2007/10/msg00686.html
but I'm slowly chipping away at it.

I'll be posting to ask about video editing soon I'm sure.

more power to your coding fingers.


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/4d5de2e5.4050...@homeurl.co.uk



Cleaning DHCP and Host Info for New LAN

2011-02-16 Thread Hal Vaughan
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.



Hal

--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/9e7efdbe-90af-467a-b24c-95c1ec816...@halblog.com



Re: Cleaning DHCP and Host Info for New LAN

2011-02-16 Thread shawn wilson
On Wed, Feb 16, 2011 at 5:38 PM, Hal Vaughan h...@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.


Re: Cleaning DHCP and Host Info for New LAN

2011-02-16 Thread Bob

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.


when I copy my install I
edit /etc/hostname

 rm -f /mnt/src/var/swap
 rm -f /mnt/src/etc/udev/rules.d/70-persistent-net.rules
 rm -f /mnt/src/etc/udev/rules.d/70-persistent-cd.rules
 rm -f /mnt/src/var/lib/ntp/ntp.drift
 rm /etc/ssh/ssh_host_*
 dpkg-reconfigure openssh-server

After that it's mainly hardware specific stuff.

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

Good luck,


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/4d5c9466.5080...@homeurl.co.uk



Re: Cleaning DHCP and Host Info for New LAN

2011-02-16 Thread Hal Vaughan

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

--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/04915edc-3445-4932-bfe3-98c38ac3c...@halblog.com