boot: set hostname in grub configuration

add missing hostname= to grub configuration.
master
OpenGnSys Support Team 2025-01-30 14:07:09 +01:00
parent d8b271f503
commit 4db69ad054
3 changed files with 5 additions and 2 deletions

View File

@ -20,6 +20,7 @@
#define OGRELIVE_TEMPLATE \
"# Autogenerated by ogserver on %s - do not edit this file!\n" \
"set oghostname=%s\n" \
"set ogserver=%s\n" \
"set ogrepo=%s\n" \
"set ogreliveversion=%s\n" \
@ -45,7 +46,7 @@
" insmod http\n" \
" insmod net\n" \
" net_bootp\n" \
" linux (http,$ogrepo)/$ogrelivedir/vmlinuz ro boot=live quiet splash oglivedir=$ogrelivedir ip=$ogserver ogrepo=$ogrepo username=$username passwd=$passwd fetch=http://$ogrepo/$ogrelivedir/filesystem.squashfs\n" \
" linux (http,$ogrepo)/$ogrelivedir/vmlinuz ro boot=live quiet splash oglivedir=$ogrelivedir hostname=$oghostname ip=$ogserver ogrepo=$ogrepo username=$username passwd=$passwd fetch=http://$ogrepo/$ogrelivedir/filesystem.squashfs\n" \
" initrd (http,$ogrepo)/$ogrelivedir/initrd.img\n" \
" boot\n" \
"}\n"
@ -92,7 +93,7 @@ int ogrelive_generate_grub2_file(const struct og_boot_cfg *cfg, const char *mac)
}
fprintf(fp, OGRELIVE_TEMPLATE, date,
cfg->ogserver, cfg->ogrepo, cfg->ogrelivedir, cfg->username, cfg->passwd);
cfg->hostname, cfg->ogserver, cfg->ogrepo, cfg->ogrelivedir, cfg->username, cfg->passwd);
fclose(fp);

View File

@ -2,6 +2,7 @@
#define _OG_BOOT_H_
struct og_boot_cfg {
const char *hostname;
const char *ogserver;
const char *ogrepo;
const char *ogrelivedir;

View File

@ -1721,6 +1721,7 @@ static int og_set_client_mode(struct og_dbi *dbi, const char *client_ip,
return -1;
}
boot_cfg.hostname = boot_params.nombreordenador;
boot_cfg.ogserver = boot_params.server_ip;
boot_cfg.ogrepo = boot_params.repo_ip;
boot_cfg.ogrelivedir = boot_params.oglivedir;