[ipxe-devel] Patch: Add ${mac/hexnone} settings type

Levente LEVAI levail at aviatronic.hu
Wed Sep 26 17:48:22 UTC 2012


Hi

Just a thought: I think it is more useful to add some text manipulation to
the setting expansion code. I have implemented the following syntax:
${*<setting name>} expands to url_encode(<setting name>)
${-<list of chars to delete><last char repeated><setting name>} remove
   any character in <list of chars to delete> from setting when expanded

E.g. ${-::net0/mac} returns the thing you need.

My code is probably a bit longer than yours but not that much (I download
my ipxe through tftp so size is not a concern for me).
If interested I can submit a patch.

I also have thought about some bash-like syntax, but the above minimalistic
approach have served my purpose.

Best regards,
Levente Levai

On 2012-09-26 13:00, ipxe-devel-request at lists.ipxe.org wrote:
> Subject:
> [ipxe-devel] Patch: Add ${mac/hexnone} settings type
> From:
> Jeppe Toustrup <ipxe at tenzer.dk>
> Date:
> 2012-09-25 16:16
>
> To:
> ipxe-devel at lists.ipxe.org
>
>
> Hi
>
> I am working on using iPXE for a PXE boot setup, where we would like
> to generate iPXE configurations dynamically based on the MAC address
> of the machine which is booting. Since our existing system uses MAC
> addresses without delimiters, it would be easier for us if iPXE had
> that in a parameter, but currently it only has the option of the MAC
> address with either a colon (':') or hyphen ('-') as delimiter. I
> could of course just strip one of those in our systems, but since
> there already are two options, I thought it couldn't be that hard to
> add a third one, which may be handy for other people as well. So I
> have made a patch which adds ${mac/hexnone} which contains the MAC
> address without any delimiters:
> http://files.tenzer.dk/misc/hexnone.patch
>
> I have basically searched the source code for 'hexhyp' and duplicated
> the work done to implement that, only without a delimiter.
> Is this something that could be added to the iPXE source tree?
> Do you possibly want another name for the setting type than 'hexnone'?
>
>
> --
> Venlig hilsen / Kind regards
> Jeppe Toustrup
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ipxe.org/pipermail/ipxe-devel/attachments/20120926/0bf7b2a9/attachment.htm>


More information about the ipxe-devel mailing list