diff options
author | jkh <jkh@FreeBSD.org> | 1997-08-11 13:08:29 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1997-08-11 13:08:29 +0000 |
commit | a6a2ca12c2ed98f5f638b0863a615ed44b6e7844 (patch) | |
tree | fa66bee42847b4e038a79c7e7d990c493370d746 /usr.sbin/sysinstall/media.c | |
parent | ba6340d33073b774ebb6897ce35dfb411e0d005b (diff) | |
download | FreeBSD-src-a6a2ca12c2ed98f5f638b0863a615ed44b6e7844.zip FreeBSD-src-a6a2ca12c2ed98f5f638b0863a615ed44b6e7844.tar.gz |
Make some changes to the way the label editor reads script variables
so you don't need to re-enter it for each and every filesystem. Heads up!
This change is incompatible with the previous scripting format,
so those folks (all 2 of you) using config files should take a look
at the changes to the sample install.cfg file for the diskLabelEditor's
new calling syntax.
Finally write a man page for this thing, documenting all of the above
and more. I can't drive a stake through this thing's heart without
properly documenting it first, so please consider this step #1 in that
process (to be honest, sysinstall will also live on for some time in
the 2.2. branch since it's unlikely that the new install tools will ever
make it over there - they're strictly 3.0 material).
Diffstat (limited to 'usr.sbin/sysinstall/media.c')
-rw-r--r-- | usr.sbin/sysinstall/media.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/usr.sbin/sysinstall/media.c b/usr.sbin/sysinstall/media.c index 32650af..8154be6 100644 --- a/usr.sbin/sysinstall/media.c +++ b/usr.sbin/sysinstall/media.c @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * - * $Id: media.c,v 1.84 1997/06/05 09:47:59 jkh Exp $ + * $Id: media.c,v 1.86 1997/08/01 04:41:38 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -46,6 +46,7 @@ #include <sys/wait.h> #include <netinet/in.h> #include <arpa/inet.h> +#include <resolv.h> static Boolean got_intr = FALSE; @@ -84,6 +85,28 @@ cdromHook(dialogMenuItem *self) return genericHook(self, DEVICE_TYPE_CDROM); } +static void +kickstart_dns(void) +{ + static Boolean initted = FALSE; + int time; + char *cp; + + cp = variable_get(VAR_MEDIA_TIMEOUT); + if (!cp) + time = MEDIA_TIMEOUT; + else + time = atoi(cp); + if (!time) + time = 100; + if (!initted) { + res_init(); + _res.retry = 2; /* 2 times seems a reasonable number to me */ + _res.retrans = time / 2; /* so spend half our alloted time on each try */ + initted = TRUE; + } +} + char * cpioVerbosity() { @@ -362,6 +385,7 @@ mediaSetFTP(dialogMenuItem *self) msgDebug("port # = `%d'\n", FtpPort); } if (variable_get(VAR_NAMESERVER)) { + kickstart_dns(); if ((inet_addr(hostname) == INADDR_NONE) && (gethostbyname(hostname) == NULL)) { msgConfirm("Cannot resolve hostname `%s'! Are you sure that your\n" "name server, gateway and network interface are correctly configured?", hostname); @@ -456,6 +480,7 @@ mediaSetNFS(dialogMenuItem *self) msgDebug("mediaSetNFS: Net device init failed\n"); } if (variable_get(VAR_NAMESERVER)) { + kickstart_dns(); if ((inet_addr(hostname) == INADDR_NONE) && (gethostbyname(hostname) == NULL)) { msgConfirm("Cannot resolve hostname `%s'! Are you sure that your\n" "name server, gateway and network interface are correctly configured?", hostname); |