]> git.ozlabs.org Git - petitboot/blobdiff - lib/types/types.c
discover: Track both configured and current autoboot settings
[petitboot] / lib / types / types.c
index 63045e1a29d2a933abd98bb8ed8826f2adea7a9c..d7f4ead791d2e7e312bdd531f834cbbee65ac67e 100644 (file)
@@ -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;
+}