summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/types/types.c12
-rw-r--r--lib/types/types.h2
2 files changed, 14 insertions, 0 deletions
diff --git a/lib/types/types.c b/lib/types/types.c
index 63045e1..d7f4ead 100644
--- a/lib/types/types.c
+++ b/lib/types/types.c
@@ -75,3 +75,15 @@ enum device_type find_device_type(const char *str)
return DEVICE_TYPE_UNKNOWN;
}
+
+bool config_autoboot_active(const struct config *config)
+{
+ enum ipmi_bootdev bootdev = config->ipmi_bootdev;
+
+ if (!config->autoboot_enabled)
+ return false;
+ if (bootdev == IPMI_BOOTDEV_SETUP || bootdev == IPMI_BOOTDEV_SAFE)
+ return false;
+
+ return true;
+}
diff --git a/lib/types/types.h b/lib/types/types.h
index 13ff7fc..7f4ae1f 100644
--- a/lib/types/types.h
+++ b/lib/types/types.h
@@ -183,4 +183,6 @@ struct config {
bool debug;
};
+bool config_autoboot_active(const struct config *config);
+
#endif /* _TYPES_H */
OpenPOWER on IntegriCloud