diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2013-09-19 22:18:04 +0800 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2013-09-19 22:21:38 +0800 |
commit | c12cebabba5c4647f558ef40f8cbc8c6a204593e (patch) | |
tree | b187d7ae3b60f3be2d280ac97595a1068189a651 /lib | |
parent | b324b03e2b603dafddfaac607e5f98d9cd9c0f04 (diff) | |
download | talos-petitboot-c12cebabba5c4647f558ef40f8cbc8c6a204593e.tar.gz talos-petitboot-c12cebabba5c4647f558ef40f8cbc8c6a204593e.zip |
discover: Implement device priorities
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pb-config/pb-config.c | 8 | ||||
-rw-r--r-- | lib/pb-config/pb-config.h | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/lib/pb-config/pb-config.c b/lib/pb-config/pb-config.c index aad3b9e..b6f26c7 100644 --- a/lib/pb-config/pb-config.c +++ b/lib/pb-config/pb-config.c @@ -1,5 +1,6 @@ #include <log/log.h> +#include <types/types.h> #include <talloc/talloc.h> #include "pb-config.h" @@ -18,6 +19,13 @@ static void config_set_defaults(struct config *config) config->network.n_interfaces = 0; config->network.dns_servers = NULL; config->network.n_dns_servers = 0; + + config->n_boot_priorities = 2; + config->boot_priorities = talloc_array(config, struct boot_priority, + config->n_boot_priorities); + config->boot_priorities[0].type = DEVICE_TYPE_NETWORK; + config->boot_priorities[1].type = DEVICE_TYPE_DISK; + } static void dump_config(struct config *config) diff --git a/lib/pb-config/pb-config.h b/lib/pb-config/pb-config.h index c74fa1b..523cada 100644 --- a/lib/pb-config/pb-config.h +++ b/lib/pb-config/pb-config.h @@ -4,6 +4,8 @@ #include <stdbool.h> #include <stdint.h> +#include <types/types.h> + #define HWADDR_SIZE 6 struct interface_config { @@ -30,10 +32,16 @@ struct network_config { int n_dns_servers; }; +struct boot_priority { + enum device_type type; +}; + struct config { bool autoboot_enabled; int autoboot_timeout_sec; struct network_config network; + struct boot_priority *boot_priorities; + int n_boot_priorities; }; |