diff options
author | Alejandro Sirgo Rica <asirgo@soleta.eu> | 2024-10-24 12:30:44 +0200 |
---|---|---|
committer | Alejandro Sirgo Rica <asirgo@soleta.eu> | 2024-10-24 13:45:49 +0200 |
commit | e960063a137c8fe760a40a73ccd081e457b23952 (patch) | |
tree | 44fd5f2a034cbebd99468ac2ee47227c76a3dd18 /src | |
parent | 1d36d6c6520d41b3afe7dbebe3ef4846d54392af (diff) |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/rest.c | 44 |
1 files changed, 27 insertions, 17 deletions
@@ -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); |