]> git.ozlabs.org Git - petitboot/blobdiff - discover/yaboot-parser.c
doc: Start writing some in-tree documentation
[petitboot] / discover / yaboot-parser.c
index b62f39db7a9466a3d2da2fdd8698568d6dabedff..d0a40b1b4fd14d16e628751b78db1e12c85b9598 100644 (file)
@@ -6,6 +6,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <ctype.h>
+#include <i18n/i18n.h>
 
 #include "log/log.h"
 #include "talloc/talloc.h"
@@ -171,6 +172,7 @@ static void yaboot_finish(struct conf_context *conf)
                state->opt->option->is_default = true;
 
        discover_context_add_boot_option(conf->dc, state->opt);
+       state->opt = NULL;
 }
 
 static void yaboot_process_pair(struct conf_context *conf, const char *name,
@@ -211,6 +213,8 @@ static void yaboot_process_pair(struct conf_context *conf, const char *name,
 
                /* Then start the new image. */
                opt = state_start_new_option(conf, state);
+               if (!opt)
+                       pb_debug_fn("new opt is NULL\n");
 
                state->boot_image = talloc_strdup(state, value);
 
@@ -233,6 +237,8 @@ static void yaboot_process_pair(struct conf_context *conf, const char *name,
 
                /* Then start the new image. */
                opt = state_start_new_option(conf, state);
+               if (!opt)
+                       pb_debug_fn("new opt is NULL\n");
 
                if (*value == '/') {
                        state->boot_image = talloc_strdup(state, value);
@@ -380,6 +386,9 @@ static int yaboot_parse(struct discover_context *dc)
                        continue;
 
                conf_parse_buf(conf, buf, len);
+               device_handler_status_dev_info(dc->handler, dc->device,
+                               _("Parsed yaboot configuration from %s"),
+                               *filename);
                talloc_free(buf);
        }