diff --git a/src/boot.c b/src/boot.c index c58f332..7532c90 100644 --- a/src/boot.c +++ b/src/boot.c @@ -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); diff --git a/src/boot.h b/src/boot.h index 4e3ff45..910545c 100644 --- a/src/boot.h +++ b/src/boot.h @@ -2,6 +2,7 @@ #define _OG_BOOT_H_ struct og_boot_cfg { + const char *hostname; const char *ogserver; const char *ogrepo; const char *ogrelivedir; diff --git a/src/rest.c b/src/rest.c index 0b589f6..20c6780 100644 --- a/src/rest.c +++ b/src/rest.c @@ -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;