summaryrefslogtreecommitdiffstats
path: root/lib/pb-config
diff options
context:
space:
mode:
authorSamuel Mendoza-Jonas <sam.mj@au1.ibm.com>2015-01-21 16:12:14 +1100
committerSamuel Mendoza-Jonas <sam.mj@au1.ibm.com>2015-05-05 15:03:46 +1000
commita3e3b66fbcb18174fc54ffd771ef3a38c9f8defd (patch)
tree50b135545e3c6972b8bf9a9c49634165fc92cc52 /lib/pb-config
parentec12bbd7bbfb3dd31dbd987ecff463542d54542f (diff)
downloadtalos-petitboot-a3e3b66fbcb18174fc54ffd771ef3a38c9f8defd.tar.gz
talos-petitboot-a3e3b66fbcb18174fc54ffd771ef3a38c9f8defd.zip
petitboot: Implement ordered boot options
Move petitboot to a more familiar 'boot-order' based autoboot system. The discover server now reads multiple values from the petitboot,bootdev parameter and adds them in order to config->autoboot_opts. Boot priority is determined by the options' position in the list. On the client, nc-config now recognises the new boot order, and allows the user to add, remove, and reorder the devices in the list. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
Diffstat (limited to 'lib/pb-config')
-rw-r--r--lib/pb-config/pb-config.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/lib/pb-config/pb-config.c b/lib/pb-config/pb-config.c
index a2272f4..98a6078 100644
--- a/lib/pb-config/pb-config.c
+++ b/lib/pb-config/pb-config.c
@@ -59,21 +59,21 @@ struct config *config_copy(void *ctx, const struct config *src)
dest->network.dns_servers[i] = talloc_strdup(dest,
src->network.dns_servers[i]);
- dest->n_boot_priorities = 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++) {
- dest->boot_priorities[i].priority =
- src->boot_priorities[i].priority;
- dest->boot_priorities[i].type = src->boot_priorities[i].type;
+ dest->n_autoboot_opts = src->n_autoboot_opts;
+ dest->autoboot_opts = talloc_array(dest, struct autoboot_option,
+ dest->n_autoboot_opts);
+
+ for (i = 0; i < src->n_autoboot_opts; i++) {
+ dest->autoboot_opts[i].boot_type =
+ src->autoboot_opts[i].boot_type;
+ if (src->autoboot_opts[i].boot_type == BOOT_DEVICE_TYPE)
+ dest->autoboot_opts[i].type =
+ src->autoboot_opts[i].type;
+ else
+ dest->autoboot_opts[i].uuid =
+ talloc_strdup(dest, src->autoboot_opts[i].uuid);
}
- if (src->boot_device && strlen(src->boot_device))
- dest->boot_device = talloc_strdup(dest, src->boot_device);
- else
- dest->boot_device = NULL;
-
dest->ipmi_bootdev = src->ipmi_bootdev;
dest->ipmi_bootdev_persistent = src->ipmi_bootdev_persistent;
OpenPOWER on IntegriCloud