From e960063a137c8fe760a40a73ccd081e457b23952 Mon Sep 17 00:00:00 2001 From: Alejandro Sirgo Rica Date: Thu, 24 Oct 2024 12:30:44 +0200 Subject: 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. --- src/rest.c | 44 +++++++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/rest.c b/src/rest.c index 022ec71..f727322 100644 --- a/src/rest.c +++ b/src/rest.c @@ -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); -- cgit v1.2.3-18-g5258