X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=discover%2Fplatform-powerpc.c;h=b5ad682eae3b9e7136de412602648a8ee72b8510;hb=refs%2Ftags%2Fv1.4.2;hp=247b4e6d9389956916e63a27fc709d6bb7aa85f7;hpb=3daa33e027e327e75835ed5570bab150cb5e7a10;p=petitboot diff --git a/discover/platform-powerpc.c b/discover/platform-powerpc.c index 247b4e6..b5ad682 100644 --- a/discover/platform-powerpc.c +++ b/discover/platform-powerpc.c @@ -410,11 +410,9 @@ static int read_bootdev(void *ctx, char **pos, struct autoboot_option *opt) if (!strncmp(*pos, "uuid:", strlen("uuid:"))) { prefix = strlen("uuid:"); opt->boot_type = BOOT_DEVICE_UUID; - rc = 0; } else if (!strncmp(*pos, "mac:", strlen("mac:"))) { prefix = strlen("mac:"); opt->boot_type = BOOT_DEVICE_UUID; - rc = 0; } else { type = find_device_type(*pos); if (type != DEVICE_TYPE_UNKNOWN) { @@ -428,9 +426,12 @@ static int read_bootdev(void *ctx, char **pos, struct autoboot_option *opt) if (delim) len = (int)(delim - *pos) - prefix; else - len = strlen(*pos); + len = strlen(*pos) - prefix; - opt->uuid = talloc_strndup(ctx, *pos + prefix, len); + if (len) { + opt->uuid = talloc_strndup(ctx, *pos + prefix, len); + rc = 0; + } } /* Always advance pointer to next option or end */ @@ -754,21 +755,8 @@ static void set_ipmi_bootdev(struct config *config, enum ipmi_bootdev bootdev, config->ipmi_bootdev = bootdev; config->ipmi_bootdev_persistent = persistent; - switch (bootdev) { - case IPMI_BOOTDEV_NONE: - case IPMI_BOOTDEV_DISK: - case IPMI_BOOTDEV_NETWORK: - case IPMI_BOOTDEV_CDROM: - default: - break; - case IPMI_BOOTDEV_SETUP: - config->autoboot_enabled = false; - break; - case IPMI_BOOTDEV_SAFE: - config->autoboot_enabled = false; + if (bootdev == IPMI_BOOTDEV_SAFE) config->safe_mode = true; - break; - } } static int read_bootdev_sysparam(const char *name, uint8_t *val)