configure: Use AC_GNU_SOURCE Rather than #defining _GNU_SOURCE in our .c files, we can define this from config.h instead. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
logging: Clean up debug logs We have quite a few pb_logs which should be pb_debug. This change moves developer-specific info to pb_debug. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
discover: log cleanup Remove some of the more noisy log messages, and add some information pertinent to device resolution events. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
discover: Don't access bytes before the start of empty strings Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
parsers: change parser.parse to accept a buffer Rather than having each of the parsers do their own open(), read(), etc, use the registered filenames array to find & open parser conf files. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
discover: Separate temporary and permanent device data At present, we keep both permanent (eg links/n_links) and temporary (event) data in struct discover_context. This change makes discover_context a temporary structure, just used during actual device discovery. Once discovery is complete, the permanent data (discover_device) is "committed" to the device handler. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Add new member get_pair to conf parser context To allow parsers more control over finding paramerter pairs add a new member get_pair to the parser struct conf_context. Initialize get_pair=conf_get_pair_equal for existing parsers. Signed-off-by: Geoff Levand <geoff@infradead.org>
Refactor parser routine conf_get_param_pair() Refactor conf_get_param_pair() and rename to conf_get_pair(). Add two new wrapper routines conf_get_pair_equal() and conf_get_pair_space(). Signed-off-by: Geoff Levand <geoff@infradead.org>
Add parser routine conf_replace_char() Signed-off-by: Geoff Levand <geoff@infradead.org>
Zero parser globals before use Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Remove unneeded conf strip conf_get_param_pair() already runs conf_strip_str() on value, so remove a redundent conf_strip_str() call. Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Split common routines from kboot parser Pull out the common .conf file parsing logic from kboot-parser.c and into two new files parser-conf.h and parser-conf.c, and rework the kboot parser to use those common routines. The new common routines are based on a .conf file parser context struct conf_context. The specific parsers setup the context then call the main parsing entry routine conf_parse(). conf_parse() uses the context info to open and read .conf files and call parser specific callbacks to process name:value pairs and to add boot_option instances to the discover server. Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>