]> git.ozlabs.org Git - petitboot/blobdiff - devices/kboot-parser.c
Fix another bogon in log()
[petitboot] / devices / kboot-parser.c
index 4b997e7bca7098646c86b376b262fb3689f1fbe8..448575929abc1fa9e7e3cefbe13ab4a64dbc9f59 100644 (file)
@@ -10,7 +10,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 
-#include "udev-helper.h"
+#include "parser.h"
 #include "params.h"
 
 #define buf_size 1024
@@ -106,6 +106,7 @@ static int parse_option(struct boot_option *opt, char *config)
        opt->boot_image_file = join_paths(mountpoint, config);
 
        cmdline = malloc(buf_size);
+       *cmdline = 0;
 
        for (pos++; pos;) {
                pos = get_param_pair(pos, &name, &value, ' ');
@@ -147,7 +148,7 @@ static int parse_option(struct boot_option *opt, char *config)
                cmdline = tmp;
        }
 
-       printf("kboot cmdline: %s", cmdline);
+       pb_log("kboot cmdline: %s", cmdline);
        opt->boot_args = cmdline;
 
        asprintf(&opt->description, "%s %s", config, cmdline);
@@ -165,11 +166,14 @@ static void parse_buf(struct device *dev, char *buf)
 
                pos = get_param_pair(pos, &name, &value, '\n');
 
-               printf("kboot param: '%s' = '%s'\n", name, value);
+               pb_log("kboot param: '%s' = '%s'\n", name, value);
 
                if (name == NULL || param_is_ignored(name))
                        continue;
 
+               if (*name == '#')
+                       continue;
+
                memset(&opt, 0, sizeof(opt));
                opt.name = strdup(name);