summaryrefslogtreecommitdiffstats
path: root/mdk-stage1
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2005-03-07 13:11:37 +0000
committerOlivier Blin <oblin@mandriva.org>2005-03-07 13:11:37 +0000
commit322521e4b9a312fb8a8457b9df75b7f805ebad7c (patch)
treee229cd7a377d6406656912c1c4aaf04e68f0844d /mdk-stage1
parente1a365372367872f3ba9921cbd72d2388a4561e3 (diff)
downloaddrakx-322521e4b9a312fb8a8457b9df75b7f805ebad7c.tar
drakx-322521e4b9a312fb8a8457b9df75b7f805ebad7c.tar.gz
drakx-322521e4b9a312fb8a8457b9df75b7f805ebad7c.tar.bz2
drakx-322521e4b9a312fb8a8457b9df75b7f805ebad7c.tar.xz
drakx-322521e4b9a312fb8a8457b9df75b7f805ebad7c.zip
try to reuse hostname and domain information from dhcp step (#14285)
Diffstat (limited to 'mdk-stage1')
-rw-r--r--mdk-stage1/network.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/mdk-stage1/network.c b/mdk-stage1/network.c
index 9683264ec..95990501d 100644
--- a/mdk-stage1/network.c
+++ b/mdk-stage1/network.c
@@ -526,13 +526,21 @@ static enum return_type configure_network(struct interface_info * intf)
char * questions_auto[] = { "hostname", "domain" };
static char ** answers = NULL;
char * boulet;
-
- results = ask_from_entries_auto("I could not guess hostname and domain name; please fill in this information. "
- "Valid answers are for example: `mybox' for hostname and `mynetwork.com' for "
- "domain name, for a machine called `mybox.mynetwork.com' on the Internet.",
- questions, &answers, 32, questions_auto, NULL);
- if (results != RETURN_OK)
+
+ if (dhcp_hostname || dhcp_domain) {
+ answers = (char **) malloc(sizeof(questions));
+ answers[0] = strdup(dhcp_hostname);
+ answers[1] = strdup(dhcp_domain);
+ }
+
+ if (!dhcp_hostname || !dhcp_hostname) {
+ results = ask_from_entries_auto("I could not guess hostname and domain name; please fill in this information. "
+ "Valid answers are for example: `mybox' for hostname and `mynetwork.com' for "
+ "domain name, for a machine called `mybox.mynetwork.com' on the Internet.",
+ questions, &answers, 32, questions_auto, NULL);
+ if (results != RETURN_OK)
return results;
+ }
hostname = answers[0];
if ((boulet = strchr(hostname, '.')) != NULL)
@@ -540,6 +548,9 @@ static enum return_type configure_network(struct interface_info * intf)
domain = answers[1];
}
+ log_message("using hostname %s", hostname);
+ log_message("using daomin %s", domain);
+
return RETURN_OK;
}