On 14.08.2012 14:57, Paulo Flabiano Smorigo/Brazil/IBM wrote: > > Hi all, > > This patch implements a search for a specific configuration (based on > MAC or IP) when the config file is on the tftp server. He uses the > following order: > > 1) By MAC address (in lower case hexadecimal with dash separators); > 2) By IP (in upper case hexadecimal). It removes one hex digit from > the end and try again; > 3) The original grub.cfg file. >
This seems more like something that should be done in grub.cfg. Something more along the lines: if [ -s "$prefix/grub.cfg.$mac" ]; then source "$prefix/grub.cfg.$mac" exit_file fi for i in 8 7 6 5 4 3 2 1; do if [ -s "$prefix/grub.cfg.${ip:1:$i}" ]; then source "$prefix/grub.cfg.${ip:1:$i}" exit_file fi It seems like this would be more productive than just handling this specific case manually in C. -- Regards Vladimir 'φ-coder/phcoder' Serbinenko
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel