Hi everyone:
I´ve had a problem with the choose-mirror for preseeding an http mirror:
d-i mirror/country string manual
d-i mirror/http/countries select manual
d-i mirror/http/hostname string
192.168.2.201
d-i mirror/http/directory string /debian
d-i mirror/http/proxy string
d-i mirror/protocol select http
d-i mirror/suite select etch
The installer is debian testing, and the installed system is debian-etch.
The problem is that with the lenny standard choose-mirror (downloaded from the net the compiled one), the preseed of http mirror is not possible, since it's compiled by default with the USE_FTP_MANUAL flag activated, and in the source:
[choose-mirror.c ln 339]
#ifndef WITH_FTP_MANUAL
manual_entry = ! strcmp(debconf->value, MANUAL_ENTRY) ||
! strcmp(debconf->value, MANUAL_ENTRY_OLD);
#else
if (! strcasecmp(protocol,"ftp") == 0)
manual_entry = ! strcmp(debconf->value, MANUAL_ENTRY) ||
! strcmp(debconf->value, MANUAL_ENTRY_OLD);
else
manual_entry = 1;
#endif
if (! manual_entry) {
char *mir = add_protocol("mirror");
/* Prompt for mirror in selected country. */
list=debconf_list(mirrors_in(country));
debconf_subst(debconf, mir, "mirrors", list);
free(list);
debconf_input(debconf, "high", mir);
free(mir);
}
else {
char *host = add_protocol("hostname");
char *dir = add_protocol("directory");
/* Manual entry. */
debconf_input(debconf, "critical", host);
debconf_input(debconf, "critical", dir);
free(host);
free(dir);
}
As we can see, if we preseed the country/countries, and the http protocol, we will execute the next code since the WITH_FTP_MANUAL is activated by default in the lenny installer:
if (! strcasecmp(protocol,"ftp") == 0)
manual_entry = ! strcmp(debconf->value, MANUAL_ENTRY) ||
! strcmp(debconf->value, MANUAL_ENTRY_OLD);
else
manual_entry = 1;
and the manual_entry will be set to 1, when it sould be 0 (and later it will ask to select "NULL" mirrors (beacause the country is "manual"))
I've solved this recompiling the package with the WITH_FTP_MANUAL set to 0 and changing the executable in the initrd, but this is an emergency solution.
I don't know which results would have to set the WITH_FTP_MANUAL to 0 in the default compilation, IMHO this is not a very good behaviour, please study this case to solve it in the future.
Thanks!
Jon Ander Ortiz