X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=discover%2Fplatform-powerpc.c;h=5abc4d7059daa24babceed82de8115ccf49763d3;hb=90cd56cb816e7045b41542c119f64b9ee349a6bc;hp=2480b8d29129fd27da866dc02e869c248c00b8b2;hpb=df751aad6736c25a3f3088ad626bd28d2ced1991;p=petitboot diff --git a/discover/platform-powerpc.c b/discover/platform-powerpc.c index 2480b8d..5abc4d7 100644 --- a/discover/platform-powerpc.c +++ b/discover/platform-powerpc.c @@ -310,7 +310,7 @@ static int parse_one_interface_config(struct config *config, } else if (!strcmp(tok, "static")) { ifconf->method = CONFIG_METHOD_STATIC; - /* ip/mask, [optional] gateway */ + /* ip/mask, [optional] gateway, [optional] url */ tok = strtok_r(NULL, ",", &saveptr); if (!tok) goto out_err; @@ -323,6 +323,12 @@ static int parse_one_interface_config(struct config *config, talloc_strdup(ifconf, tok); } + tok = strtok_r(NULL, ",", &saveptr); + if (tok) { + ifconf->static_config.url = + talloc_strdup(ifconf, tok); + } + } else { pb_log("Unknown network configuration method %s\n", tok); goto out_err; @@ -438,7 +444,6 @@ static void populate_bootdev_config(struct platform_powerpc *platform, { struct autoboot_option *opt, *new = NULL; char *pos, *end, *old_dev = NULL; - const char delim = ' '; unsigned int n_new = 0; const char *val; bool conflict; @@ -469,11 +474,9 @@ static void populate_bootdev_config(struct platform_powerpc *platform, if (read_bootdev(config, &pos, opt)) { pb_log("bootdev config is in an unknown format " - "(expected uuid:... or mac:...)"); + "(expected uuid:... or mac:...)\n"); talloc_free(opt); - if (strchr(pos, delim)) - continue; - return; + continue; } new = talloc_realloc(config, new, struct autoboot_option, @@ -578,10 +581,12 @@ static char *iface_config_str(void *ctx, struct interface_config *config) str = talloc_asprintf_append(str, "dhcp"); } else if (config->method == CONFIG_METHOD_STATIC) { - str = talloc_asprintf_append(str, "static,%s%s%s", + str = talloc_asprintf_append(str, "static,%s%s%s%s%s", config->static_config.address, config->static_config.gateway ? "," : "", - config->static_config.gateway ?: ""); + config->static_config.gateway ?: "", + config->static_config.url ? "," : "", + config->static_config.url ?: ""); } return str; }