]> git.ozlabs.org Git - petitboot/blobdiff - discover/grub2-parser.c
discover: Send options to client in order
[petitboot] / discover / grub2-parser.c
index a2308ee687d9ed99ba9190f6d4f80b527c6f43a8..38941d88e71c21e0f1cfc71d1d90af2c3a3c8c9a 100644 (file)
@@ -141,8 +141,6 @@ static void grub2_process_pair(struct conf_context *conf, const char *name,
                return;
 
        if (streq(name, "menuentry")) {
-               char *sep;
-
                /* complete any existing option... */
                if (state->opt)
                        grub2_finish(conf);
@@ -151,10 +149,7 @@ static void grub2_process_pair(struct conf_context *conf, const char *name,
                opt = discover_boot_option_create(conf->dc, conf->dc->device);
                opt->option->boot_args = talloc_strdup(opt->option, "");
 
-               sep = strchr(value, '\'');
-
-               if (sep)
-                       *sep = 0;
+               value = strtok(value, "\'{\"");
 
                opt->option->id = talloc_asprintf(opt->option,
                                        "%s#%s", dev->id, value);
@@ -166,7 +161,7 @@ static void grub2_process_pair(struct conf_context *conf, const char *name,
                return;
        }
 
-       if (streq(name, "linux")) {
+       if (streq(name, "linux") || streq(name, "linux16")) {
                char *sep;
 
                sep = strchr(value, ' ');
@@ -210,7 +205,6 @@ static void grub2_process_pair(struct conf_context *conf, const char *name,
                        return;
 
                uuid++;
-               pb_log("%s: uuid %s\n", __func__, uuid);
 
                if (state->root)
                        talloc_unlink(state, state->root);
@@ -245,6 +239,7 @@ static const char *const grub2_conf_files[] = {
 static const char *grub2_known_names[] = {
        "menuentry",
        "linux",
+       "linux16",
        "initrd",
        "search",
        NULL