X-Git-Url: http://git.ozlabs.org/?p=petitboot;a=blobdiff_plain;f=lib%2Ftypes%2Ftypes.c;h=d7f4ead791d2e7e312bdd531f834cbbee65ac67e;hp=95a3a48cb4fca9571fa9a6eac54449b9c2378c2e;hb=d0602ed25e3bff8298c19bece8cd8b3f80d86624;hpb=b9af039e99527159aad905c3395fa974b9621f8e diff --git a/lib/types/types.c b/lib/types/types.c index 95a3a48..d7f4ead 100644 --- a/lib/types/types.c +++ b/lib/types/types.c @@ -27,8 +27,10 @@ const char *device_type_display_name(enum device_type type) switch (type) { case DEVICE_TYPE_DISK: return _("Disk"); + case DEVICE_TYPE_USB: + return _("USB"); case DEVICE_TYPE_OPTICAL: - return _("Optical"); + return _("CD/DVD"); case DEVICE_TYPE_NETWORK: return _("Network"); case DEVICE_TYPE_ANY: @@ -44,6 +46,8 @@ const char *device_type_name(enum device_type type) switch (type) { case DEVICE_TYPE_DISK: return "disk"; + case DEVICE_TYPE_USB: + return "usb"; case DEVICE_TYPE_OPTICAL: return "optical"; case DEVICE_TYPE_NETWORK: @@ -60,6 +64,8 @@ enum device_type find_device_type(const char *str) { if (!strncmp(str, "disk", strlen("disk"))) return DEVICE_TYPE_DISK; + if (!strncmp(str, "usb", strlen("usb"))) + return DEVICE_TYPE_USB; if (!strncmp(str, "optical", strlen("optical"))) return DEVICE_TYPE_OPTICAL; if (!strncmp(str, "network", strlen("network"))) @@ -69,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; +}