config: Add boot_device member to config
[petitboot] / lib / pb-config / pb-config.c
index 35008cc8c823afdf095fb2ffc319c0b828979b63..2adc7b248d8b956569ff971464cf6e2bc74092e4 100644 (file)
@@ -62,8 +62,16 @@ struct config *config_copy(void *ctx, const struct config *src)
        dest->boot_priorities = talloc_array(dest, struct boot_priority,
                        src->n_boot_priorities);
 
        dest->boot_priorities = talloc_array(dest, struct boot_priority,
                        src->n_boot_priorities);
 
-       for (i = 0; i < src->n_boot_priorities; i++)
+       for (i = 0; i < src->n_boot_priorities; i++) {
+               dest->boot_priorities[i].priority =
+                                       src->boot_priorities[i].priority;
                dest->boot_priorities[i].type = src->boot_priorities[i].type;
                dest->boot_priorities[i].type = src->boot_priorities[i].type;
+       }
+
+       if (src->boot_device && strlen(src->boot_device))
+               dest->boot_device = talloc_strdup(dest, src->boot_device);
+       else
+               dest->boot_device = NULL;
 
        return dest;
 }
 
        return dest;
 }