Browse Source

make it play better with dhcp-client-udeb

r482
master
David Whedon 22 years ago
parent
commit
180266b143
  1. 5
      TODO
  2. 7
      debian/changelog
  3. 2
      debian/rules
  4. 5
      netcfg-dhcp.c
  5. 16
      netcfg.c

5
TODO

@ -1,4 +1,7 @@
* put in checks so the user can't enter data that is clearly invalid (perhaps this will be done through debconf.
* do other sorts of network configurations (pcmcia, ppp)
* pppconfig would be a good starting point for the ppp udeb. There is also an example in there of how to use pppd to detect a modem.
* netkit-tiny's route is currently in /usr/bin/, it will probably get moved to /sbin, this package will have to be updated.
* netcfg-dhcp : when we use dhclient if we don't obtain a lease, dhclient goes
into the background and the installer thinks that it succeeded. This isn't
right.

7
debian/changelog

@ -1,3 +1,10 @@
netcfg (0.09) unstable; urgency=low
* make necessary dirs at build time rather than runtime
* call it dhclient rather than dhclient-2.2.x
-- David Whedon <dwhedon@debian.org> Tue, 6 Feb 2001 21:41:50 -0800
netcfg (0.08) unstable; urgency=low
* route is now in /sbin

2
debian/rules

@ -52,6 +52,8 @@ install: build
# if you ever decide to make the netcfg-common package, uncomment these to install it
# mkdir -p `pwd`/debian/netcfg-common/usr/lib/
# cp libnetcfg.so.0.1.0 `pwd`/debian/netcfg-common/usr/lib/
mkdir -p debian/netcfg-dhcp/etc/dhcp debian/netcfg-dhcp/var/dhcp
mkdir -p debian/netcfg-static/etc/network
# Build architecture-independent files here.
binary-indep: build install

5
netcfg-dhcp.c

@ -95,7 +95,6 @@ netcfg_write_dhcp ()
}
if (dhcp_client == DHCLIENT)
{
netcfg_mkdir (DHCLIENT_DIR);
if (dhcp_hostname)
if ((fp = file_open (DHCLIENT_FILE)))
@ -131,7 +130,7 @@ netcfg_activate_dhcp ()
snprintf (ptr, sizeof (buf) - (ptr - buf), " -h %s", dhcp_hostname);
}
else /* dhcp_client == DHCLIENT */
ptr += snprintf (buf, sizeof (buf), "/sbin/dhclient-2.2.x %s", interface);
ptr += snprintf (buf, sizeof (buf), "/sbin/dhclient %s", interface);
if (execlog (buf))
netcfg_die (client);
@ -149,7 +148,7 @@ main (int argc, char *argv[])
client->command (client, "title", "DHCP Network Configuration", NULL);
if (stat ("/sbin/dhclient-2.2.x", &buf) == 0)
if (stat ("/sbin/dhclient", &buf) == 0)
dhcp_client = DHCLIENT;
else if (stat ("/sbin/pump", &buf) == 0)
dhcp_client = PUMP;

16
netcfg.c

@ -46,18 +46,6 @@ debconf_input (struct debconfclient *client, char *priority, char *template)
}
int
netcfg_mkdir (char *path)
{
if (check_dir (path) == -1)
if (!mkdir (path, 0700))
{
perror ("mkdir");
return -1;
}
return 0;
}
int
is_interface_up (char *inter)
@ -433,10 +421,6 @@ netcfg_write_common (u_int32_t ipaddress, char *domain, char *hostname,
FILE *fp;
netcfg_mkdir (ETC_DIR);
netcfg_mkdir (NETWORK_DIR);
if ((fp = file_open (HOSTS_FILE)))
{
fprintf (fp, "127.0.0.1\tlocalhost\n");

Loading…
Cancel
Save