You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to have a dynamic grub.cfg file, where I can pass mac addresses via this variable.
The problem that I see is that grub is storing macs in "aa:bb:cc:dd:ee:ff" format - so if I create a param as: bfmac=$net_default_mac:$net_default_ip:255.255.255.255
it would confuse the script due to too many ":" delimiters.
I was thinking about how to improve it and keep it backward compatible - came up with 3 ideas:
Change the way of paring each param:
treat first 17 chars as MAC - change "-" to ":" no matter what is there
Get param as second to last after ":"
Get param as last after ":"
I believe option 1 above is a better candidate to address backward compatibility and also handle grub format. This is efficient because the mac is required to be in the same format as grub stores is it, for finding the interface name.
Hi,
Currently "bfmac" param used in bfpxe is expecting to get:
bfmac=<mac>:<ip>:<netmask>
where MAC is in "aa-bb-cc-dd-ee-ff" format.
https://github.com/Mellanox/bfscripts/blob/master/bfpxe#L64C1-L67C43
I'm trying to have a dynamic grub.cfg file, where I can pass mac addresses via this variable.
The problem that I see is that grub is storing macs in "aa:bb:cc:dd:ee:ff" format - so if I create a param as:
bfmac=$net_default_mac:$net_default_ip:255.255.255.255
it would confuse the script due to too many ":" delimiters.
I was thinking about how to improve it and keep it backward compatible - came up with 3 ideas:
treat first 17 chars as MAC - change "-" to ":" no matter what is there
Get param as second to last after ":"
Get param as last after ":"
Code snippet for this:
Something like below + append rest of input
Number 1 seems to be most elegant for me, while number 2 keeps the readability of the code - but calls /tr/ back and forth.
What's your opinion about those approaches? I could create a PR with fix once we agree on the options.
The text was updated successfully, but these errors were encountered: