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

Re: net kickstarts using HW address



I currently do this, and it works quite well. I have a machine boot up, grab an IP via DHCP, and pass the 'ks=http://some/url' string to the kernel (using the PXE stuff). This URL, however is a cgi, that consults a database and spews out the appropriate kickstart file based upon the REMOTE_ADDR environment variable set by Apache. In your case, however, as mentioned by Mr. Edgecombe, you would need to arp that IP address to obtain the MAC. This would require that the host being installed sits on the same network segment as the server serving up the web request.

One bug I have run into is that anaconda (at least for RH7.2), when you pass it the ks=http:// parameter offers the web server an HTTP/1.1 request, but can't grok some HTTP/1.1 responses, such as Transfer-encoding: chunked (See RedHat bugzilla bug# 56790)

Two possibilities (and maybe others) exist to remedy this:

1. Hack the code, and change the request to HTTP/1.0 instead of HTTP/1.1.
The code in question is (for RedHat 7.2) in anaconda-7.2/loader/ftp.c, and requires a one-byte change (HTTP/1.1 to HTTP/1.0).

2. Open your favorite hex editor and change the string in the binary. I haven't tried this myself, but since it's a change of a single byte, I imagine it would work. The binary in question resides in the initrd.img used for the kickstart install. To inspect/modify the contents of the initrd, gunzip the initrd, then mount the resulting file as a loopback filesystem. In that filesystem you'll want to change sbin/loader (s#HTTP/1.1#HTTP/1.0#).

Hope that helps,

Dan Hanks

On Tue, 5 Feb 2002, Jason Edgecombe wrote:

> hmmm,
>
>    here is an idea.
>
> (This assumes that both the kickstarting client and server are on the
> same ethernet segment.)
>
> put your kickstart file on a web server and pull the file from the web
> server. the kickstart file is actually a dymanic web page (PHP, Perl,
> whatever) that checks the client ip and matches it to a MAC address
> using the arp command listing and then sends the correct kickstart file
> accordingly.
>
> Any other ideas anyone?
>
> Sincerely,
> Jason Edgecombe
>
> Andy Grimm wrote:
>
> > (This is really a question for a C guru, but it pertains to kickstart, and I
> > know there are people who haev wanted to do this sort of thing before...)
> >
> > I would like to do kickstarts on several machines, and I have no problem
> > booting via PXE (downloading the bootstrap image, the kernel, and the initrd
> > via mtftp).  The problem is that I do not control the DHCP server in this
> > environment, so I cannot predict what IP address these machines will get for
> > the install process.  Unfortunately, the loader's default behavior is to
> > download a kickstart config file based on the machine's IP address, and I'd
> > like to use the HW address instead.  I've looked at the code and found
> > where all this is done, and here's my question:
> >
> > Is there any reasonable way to get my HW address at this point?  I've asked
> > a couple of friends, and so far the best answer I've gotten required opening
> > up a socket, and it just seems like there should be an easier way (like an
> > arp-related function call).
> >
> > --Andy
> >
> >
> >
> > _______________________________________________
> > Kickstart-list mailing list
> > Kickstart-list redhat com
> > https://listman.redhat.com/mailman/listinfo/kickstart-list
> >
> >
>
>
>
>
>
> _______________________________________________
> Kickstart-list mailing list
> Kickstart-list redhat com
> https://listman.redhat.com/mailman/listinfo/kickstart-list
>

-- 
========================================================================
   Daniel Hanks - Systems/Database Administrator
   About Inc., Web Services Division
========================================================================





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