Browse Source

apply patch from thomas poindessous to use libdebian-installer

r720
master
Tollef Fog Heen 20 years ago
parent
commit
d4146ec65e
  1. 6
      Makefile
  2. 2
      debian/changelog
  3. 2
      debian/control
  4. 13
      netcfg-dhcp.c
  5. 22
      netcfg-static.c
  6. 4
      netcfg.c

6
Makefile

@ -2,7 +2,7 @@ ifndef TARGETS
TARGETS=netcfg-dhcp netcfg-static
endif
LDOPTS=-ldebconf
LDOPTS=-ldebconf -ldebian-installer
PREFIX=$(DESTDIR)/usr/
CFLAGS=-Wall -Os
@ -18,8 +18,8 @@ STRIP = $(STRIPTOOL) --remove-section=.note --remove-section=.comment
all: $(TARGETS)
netcfg-dhcp netcfg-static: netcfg-dhcp.c utils.o netcfg.o
$(CC) $(CFLAGS) $@.c -o $@ $(INCS) $(LDOPTS) utils.o netcfg.o
netcfg-dhcp netcfg-static: netcfg-dhcp.c netcfg.o
$(CC) $(CFLAGS) $@.c -o $@ $(INCS) $(LDOPTS) netcfg.o
$(STRIP) $@
size $@

2
debian/changelog

@ -3,6 +3,8 @@ netcfg (0.13) unstable; urgency=low
* NOT YET RELEASED
* French templates thanks to laurb closes: #139918
* some build cleanup
* tfheen: Use libdebian-installer, thanks to thomas poindessous
* tfheen: Add libdebian-installer-dev to build-depends.
-- David Kimdon <dwhedon@debian.org> Tue, 7 May 2002 23:40:53 -0700

2
debian/control

@ -2,7 +2,7 @@ Source: netcfg
Section: debian-installer
Priority: standard
Maintainer: David Kimdon <dwhedon@debian.org>
Build-Depends: debhelper (>= 2.1.18), dpkg-dev (>= 1.9.0), cdebconf-dev
Build-Depends: debhelper (>= 2.1.18), dpkg-dev (>= 1.9.0), cdebconf-dev, libdebian-installer-dev
Standards-Version: 3.1.1
Package: netcfg-dhcp

13
netcfg-dhcp.c

@ -31,7 +31,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <cdebconf/debconfclient.h>
#include "utils.h"
#include <debian-installer.h>
#include "netcfg.h"
static char *interface = NULL;
@ -66,7 +66,10 @@ static void
netcfg_get_dhcp ()
{
if (dhcp_hostname)
{
free (dhcp_hostname);
dhcp_hostname = NULL;
}
client->command (client, "input", "high", "netcfg/dhcp_hostname", NULL);
client->command (client, "go", NULL);
@ -103,14 +106,14 @@ static void
netcfg_activate_dhcp ()
{
char buf[128];
execlog ("/sbin/ifconfig lo 127.0.0.1");
di_execlog ("/sbin/ifconfig lo 127.0.0.1");
switch (dhcp_client)
{
case PUMP:
snprintf (buf, sizeof (buf), "/sbin/pump -i %s", interface);
if (dhcp_hostname)
snprintfcat (buf, sizeof (buf), " -h %s", dhcp_hostname);
di_snprintfcat (buf, sizeof (buf), " -h %s", dhcp_hostname);
break;
case DHCLIENT:
@ -120,11 +123,11 @@ netcfg_activate_dhcp ()
case UDHCPC:
snprintf (buf, sizeof (buf), "/sbin/udhcpc -i %s -n", interface);
if (dhcp_hostname)
snprintfcat (buf, sizeof (buf), " -H %s", dhcp_hostname);
di_snprintfcat (buf, sizeof (buf), " -H %s", dhcp_hostname);
break;
}
if (execlog (buf))
if (di_execlog (buf))
netcfg_die (client);
}

22
netcfg-static.c

@ -30,7 +30,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <cdebconf/debconfclient.h>
#include "utils.h"
#include <debian-installer.h>
#include "netcfg.h"
@ -156,38 +156,38 @@ netcfg_activate_static ()
char buf[128];
#ifdef __GNU__
/* I had to do something like this ? */
/* execlog ("settrans /servers/socket/2 -fg"); */
execlog ("settrans /servers/socket/2 --goaway");
/* di_execlog ("settrans /servers/socket/2 -fg"); */
di_execlog ("settrans /servers/socket/2 --goaway");
snprintf (buf, sizeof (buf),
"settrans -fg /servers/socket/2 /hurd/pfinet --interface=%s --address=%s",
interface, num2dot (ipaddress));
snprintfcat (buf, sizeof (buf) " --netmask=%s", num2dot (netmask));
di_snprintfcat (buf, sizeof (buf) " --netmask=%s", num2dot (netmask));
buf[sizeof (buf) - 1] = '\0';
if (gateway)
snprintf (buf, sizeof (buf), " --gateway=%s", num2dot (gateway));
rv |= execlog (buf);
rv |= di_execlog (buf);
#else
execlog ("/sbin/ifconfig lo 127.0.0.1");
di_execlog ("/sbin/ifconfig lo 127.0.0.1");
snprintf (buf, sizeof (buf), "/sbin/ifconfig %s %s",
interface, num2dot (ipaddress));
snprintfcat (buf, sizeof (buf), " netmask %s", num2dot (netmask));
snprintfcat (buf, sizeof (buf), " broadcast %s", num2dot (broadcast));
di_snprintfcat (buf, sizeof (buf), " netmask %s", num2dot (netmask));
di_snprintfcat (buf, sizeof (buf), " broadcast %s", num2dot (broadcast));
buf[sizeof (buf) - 1] = '\0';
if (pointopoint)
snprintfcat (buf, sizeof (buf), " pointopoint %s", num2dot (pointopoint));
di_snprintfcat (buf, sizeof (buf), " pointopoint %s", num2dot (pointopoint));
rv |= execlog (buf);
rv |= di_execlog (buf);
if (gateway)
{
snprintf (buf, sizeof (buf), "/sbin/route add default gateway %s",
num2dot (gateway));
rv |= execlog (buf);
rv |= di_execlog (buf);
}
#endif

4
netcfg.c

@ -31,7 +31,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <cdebconf/debconfclient.h>
#include "utils.h"
#include <debian-installer.h>
#include "netcfg.h"
@ -306,7 +306,7 @@ netcfg_get_interface (struct debconfclient *client, char **interface)
len += newchars + 128;
}
snprintfcat (ptr, len, "%s: %s, ", inter, get_ifdsc (inter));
di_snprintfcat (ptr, len, "%s: %s, ", inter, get_ifdsc (inter));
num_interfaces++;
}
getif_end ();

Loading…
Cancel
Save