rest: add conditional boot mode configuration for ogReLive

Add a different boot mode configuration for the legacy live and the
new live.

Remove outdated params for ogReLive.
master
Alejandro Sirgo Rica 2024-10-24 12:30:44 +02:00
parent 1d36d6c652
commit e960063a13
1 changed files with 27 additions and 17 deletions

View File

@ -1572,23 +1572,33 @@ static int og_get_client_mode_params(struct og_dbi *dbi, const char *mac, char *
goto err_out;
}
snprintf(params, params_size,
" LANG=%s ip=%s:%s:%s:%s:%s:%s:none group=%s ogrepo=%s oglive=%s oglog=%s ogshare=%s oglivedir=%s ogprof=%s server=%s"
"%s%s%s%s%s%s%s%s%s%s%s%s",
lang,
boot_params.ip, server_ip, boot_params.router, boot_params.netmask, boot_params.nombreordenador, boot_params.netiface,
boot_params.nombreaula,
repository_ip,
server_ip, server_ip, server_ip,
boot_params.oglivedir,
boot_params.is_prof ? "true" : "false",
server_ip,
boot_params.hardprofile[0] ? " hardprofile=" : "", boot_params.hardprofile[0] ? boot_params.hardprofile: "",
boot_params.ntp[0] ? " ogntp=" : "", boot_params.ntp[0] ? boot_params.ntp : "",
boot_params.dns[0] ? " ogdns=" : "", boot_params.dns[0] ? boot_params.dns : "",
boot_params.proxy[0] ? " ogproxy=" : "", boot_params.proxy[0] ? boot_params.proxy : "",
boot_params.has_unit ? " ogunit=" : "", boot_params.has_unit ? boot_params.directorio : "",
res_prefix, res_value);
if (!strncmp(boot_params.oglivedir, "ogReLive", strlen("ogReLive")))
snprintf(params, params_size,
" ip=%s:%s:%s:%s:%s:%s:none ogrepo=%s oglivedir=%s fetch=http://%s/%s/filesystem.squashfs",
boot_params.ip, server_ip, boot_params.router, boot_params.netmask, boot_params.nombreordenador, boot_params.netiface,
repository_ip,
boot_params.oglivedir,
repository_ip,
boot_params.oglivedir);
else
snprintf(params, params_size,
" LANG=%s ip=%s:%s:%s:%s:%s:%s:none group=%s ogrepo=%s oglive=%s oglog=%s ogshare=%s oglivedir=%s ogprof=%s server=%s"
"%s%s%s%s%s%s%s%s%s%s%s%s",
lang,
boot_params.ip, server_ip, boot_params.router, boot_params.netmask, boot_params.nombreordenador, boot_params.netiface,
boot_params.nombreaula,
repository_ip,
server_ip, server_ip, server_ip,
boot_params.oglivedir,
boot_params.is_prof ? "true" : "false",
server_ip,
boot_params.hardprofile[0] ? " hardprofile=" : "", boot_params.hardprofile[0] ? boot_params.hardprofile: "",
boot_params.ntp[0] ? " ogntp=" : "", boot_params.ntp[0] ? boot_params.ntp : "",
boot_params.dns[0] ? " ogdns=" : "", boot_params.dns[0] ? boot_params.dns : "",
boot_params.proxy[0] ? " ogproxy=" : "", boot_params.proxy[0] ? boot_params.proxy : "",
boot_params.has_unit ? " ogunit=" : "", boot_params.has_unit ? boot_params.directorio : "",
res_prefix, res_value);
err_out:
free((void *)boot_params.ip);
free((void *)boot_params.router);