[Infrastructures] Installation using PXEboot but not booting system with DHCP
Ivan Popov
pin@konvalo.org
Wed, 29 Jun 2005 23:15:11 +0200
Hi David,
On Mon, Jun 27, 2005 at 03:12:58PM -0700, David A. Ulevitch wrote:
> How do people install with PXEboot but then boot off the hard drive
> in subsequent reboots. Different network? Special BIOS tricks?
1. Set up BIOS to always boot from the net.
2. Set up a default pxelinux config file that always boots from the local disk.
3. Set up a trivial inetd-based service which unlink()s a file
in /tftpboot/pxelinux.cfg/XXXXXXXX
where XXXXXXXX is the hexadecimal representation of the ip number
which connects to the service, like
-----------------------------
#define PREFIX "/tftpboot/pxelinux.cfg/"
...
getpeername(0, (struct sockaddr *) &addr, &len)
...
snprintf(name+sizeof(PREFIX)-1, 9, "%08X", ntohl(*(uint32_t *)(&(addr.sin_addr))))
...
if (lstat(name,&statbuf) == -1) ... /* sanity check */
if ( ! S_ISLNK(statbuf.st_mode) ) ... /* sanity check */
unlink(name)
-----------------------------
I think the code (about 700 bytes) could be freely distributed but formally
I have no permission yet, so you have to write it from scratch or wait
until I ask the colleagues and the boss :)
When you want to reinstall a host, you create a symlink with a name like above,
pointing to the configuration of your choice (RedHat kickstart in our case)
then reboot the machine in question by any means.
At the end of kickstart there is a line in the script like
telnet <tftpboot-host> <port-of-the-link-removal-service>
That's all.
Hope that may serve you as well.
Regards,
--
Ivan