summaryrefslogtreecommitdiffstats
path: root/lib/types/types.h
diff options
context:
space:
mode:
authorSamuel Mendoza-Jonas <sam.mj@au1.ibm.com>2014-12-15 14:57:35 +1100
committerSamuel Mendoza-Jonas <sam.mj@au1.ibm.com>2015-05-05 15:02:43 +1000
commit366ff957d2900eae6d26ad2f002b735302e7eb41 (patch)
treed47ece2860a00a0d462c1a9fc667edc2949a01f0 /lib/types/types.h
parent11996807cd4e79e35742aa4c4e19c6500141dfcc (diff)
downloadtalos-petitboot-366ff957d2900eae6d26ad2f002b735302e7eb41.tar.gz
talos-petitboot-366ff957d2900eae6d26ad2f002b735302e7eb41.zip
lib: Define autoboot_options, device_type helpers
Add the new autoboot_option struct, and helper functions for working with device_type enums. device_type_name() returns exact strings as used by platform code to read/write nvram params, so device_type_display_name() is added for use in user-visible strings. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
Diffstat (limited to 'lib/types/types.h')
-rw-r--r--lib/types/types.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/types/types.h b/lib/types/types.h
index f543b7f..e22dbc3 100644
--- a/lib/types/types.h
+++ b/lib/types/types.h
@@ -13,6 +13,10 @@ enum device_type {
DEVICE_TYPE_UNKNOWN,
};
+const char *device_type_display_name(enum device_type type);
+const char *device_type_name(enum device_type type);
+enum device_type find_device_type(const char *str);
+
struct device {
char *id;
enum device_type type;
@@ -118,6 +122,17 @@ struct boot_priority {
enum device_type type;
};
+struct autoboot_option {
+ enum {
+ BOOT_DEVICE_TYPE,
+ BOOT_DEVICE_UUID
+ } boot_type;
+ union {
+ enum device_type type;
+ char *uuid;
+ };
+};
+
struct config {
bool autoboot_enabled;
unsigned int autoboot_timeout_sec;
OpenPOWER on IntegriCloud