[syslinux] [PATCH] Add support for DHCP-Options

Ferenc Wagner wferi at niif.hu
Tue Apr 10 12:45:13 PDT 2007


Ferenc Wagner <wferi at niif.hu> writes:

> Maurice Massar <massar at unix-ag.uni-kl.de> writes:
>
>> I've written a start of an c32-module to do basic substition:
>
> Intesting :) I've just finished patching the linux.c32 module for much
> the same purpose.  dhcp.h is stolen from the ISC DHCP implementation.
> I'd really like to see something like this included in syslinux.  I'm
> not quite sure how to handle the unknown options, especially with
> backward compatibility in mind.

Whoops, usage examples were left off.  Here we go:

  kernel dhcp.c32
  append vmlinuz initrd=initrd.img root=/dev/mapper/$HOST$-root

or

  kernel dhcp.c32
  append -dump vmlinuz initrd=initrd.img root=/dev/mapper/$HOST$-root

or even

  kernel dhcp.c32
  append -dhcpinfo vmlinuz initrd=$SNAME$.img

Basically, known DHCP data is rendered as appropriate, unknown options
are sort of URL encoded, which isn't really usable, but at least shows
them in the dump.  $ can be produced as $$.  Currently implemented
options:

DHCP_SERVER_IDENTIFIER  --->   SERVER
DHCP_LEASE_TIME         --->   LEASE
SUBNET_MASK             --->   MASK
TIME_OFFSET             --->   TIME_OFFSET
ROUTERS                 --->   ROUTERS
DOMAIN_NAME_SERVERS     --->   DNS
HOST_NAME               --->   HOST
DOMAIN_NAME             --->   DOMAIN

CIADDR, YIADDR, SIADDR, GIADDR, SNAME and FILENAME stand for
themselves.  The matching is case insensitive.

-dump prints the parsed data, -dhcpinfo adds the packet to the initrd
(original linux.c function)
-- 
Regards,
Feri.




More information about the Syslinux mailing list