diff options
author | Samuel Mendoza-Jonas <sam.mj@au1.ibm.com> | 2015-01-21 16:12:14 +1100 |
---|---|---|
committer | Samuel Mendoza-Jonas <sam.mj@au1.ibm.com> | 2015-05-05 15:03:46 +1000 |
commit | a3e3b66fbcb18174fc54ffd771ef3a38c9f8defd (patch) | |
tree | 50b135545e3c6972b8bf9a9c49634165fc92cc52 /utils | |
parent | ec12bbd7bbfb3dd31dbd987ecff463542d54542f (diff) | |
download | petitboot-a3e3b66fbcb18174fc54ffd771ef3a38c9f8defd.zip petitboot-a3e3b66fbcb18174fc54ffd771ef3a38c9f8defd.tar.gz |
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 'utils')
-rw-r--r-- | utils/pb-config.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/utils/pb-config.c b/utils/pb-config.c index 3bd670c..009bec7 100644 --- a/utils/pb-config.c +++ b/utils/pb-config.c @@ -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", |