petitboot: Implement ordered boot options
[petitboot] / utils / pb-config.c
index 3bd670c6d002e98de30813da46665d46de9aa2bb..009bec742330223ba966f811e680b94e19ea5c7c 100644 (file)
@@ -61,7 +61,16 @@ static void print_one_config(void *ctx, const char *req, const char *name,
 
 static void print_config(void *ctx, struct config *config, const char *var)
 {
-       print_one_config(ctx, var, "bootdev", "%s", config->boot_device);
+       unsigned int i;
+
+       for (i = 0; i < config->n_autoboot_opts; i++) {
+               if (config->autoboot_opts[i].boot_type == BOOT_DEVICE_TYPE)
+                       print_one_config(ctx, var, "bootdev", "%s",
+                        device_type_name(config->autoboot_opts[i].type));
+               else
+                       print_one_config(ctx, var, "bootdev", "%s",
+                                        config->autoboot_opts[i].uuid);
+       }
        print_one_config(ctx, var, "autoboot", "%s",
                        config->autoboot_enabled ? "enabled" : "disabled");
        print_one_config(ctx, var, "timeout", "%d",