maximilian attems
2006-Jun-22 19:24 UTC
[klibc] [patch] ipconfig add dhcp file preseeding support
From: Geert Stappers <stappers at debian.org> To make klibc-ipconfig transmit the DHCP vendor class "d-i" and get the DHCP preseeding filename in a text file, it needs the attached patch. belows patch allows ipconfig to be used in Debian installer once the hostname is sent too, see http://blog.andrew.net.au/2006/05/17#d-i_dhcp_hacking Signed-off-by: maximilian attems <maks at sternwelten.at> diff --git a/usr/kinit/ipconfig/bootp_proto.c b/usr/kinit/ipconfig/bootp_proto.c index 137847c..59b03b4 100644 --- a/usr/kinit/ipconfig/bootp_proto.c +++ b/usr/kinit/ipconfig/bootp_proto.c @@ -74,6 +74,7 @@ int bootp_parse(struct netdev *dev, stru dev->hostname[0] = '\0'; dev->nisdomainname[0] = '\0'; dev->bootpath[0] = '\0'; + memcpy(&dev->filename, &hdr->boot_file, FNLEN); if (extlen >= 4 && exts[0] == 99 && exts[1] == 130 && exts[2] == 83 && exts[3] == 99) { diff --git a/usr/kinit/ipconfig/dhcp_proto.c b/usr/kinit/ipconfig/dhcp_proto.c index 9a30660..e86bbb2 100644 --- a/usr/kinit/ipconfig/dhcp_proto.c +++ b/usr/kinit/ipconfig/dhcp_proto.c @@ -46,6 +46,7 @@ #define REQ_IP_OFF 15 }; static uint8_t dhcp_end[] = { + 60, 3, 100, 45, 105, /* Vendor class "d-i" */ 255, }; diff --git a/usr/kinit/ipconfig/main.c b/usr/kinit/ipconfig/main.c index c9d3b0e..a54329f 100644 --- a/usr/kinit/ipconfig/main.c +++ b/usr/kinit/ipconfig/main.c @@ -71,6 +71,7 @@ static void print_device_config(struct n printf(" nisdomain: %-64s\n", dev->nisdomainname); printf(" rootserver: %s ", my_inet_ntoa(dev->ip_server)); printf("rootpath: %s\n", dev->bootpath); + printf(" filename : %s\n", dev->filename); } static void configure_device(struct netdev *dev) @@ -112,6 +113,7 @@ static void dump_device_config(struct ne fprintf(f, "NISDOMAIN=%s\n", dev->nisdomainname); fprintf(f, "ROOTSERVER=%s\n", my_inet_ntoa(dev->ip_server)); fprintf(f, "ROOTPATH=%s\n", dev->bootpath); + fprintf(f, "FILENAME=%s\n", dev->filename); fclose(f); } } diff --git a/usr/kinit/ipconfig/netdev.h b/usr/kinit/ipconfig/netdev.h index ac8c8be..5b16247 100644 --- a/usr/kinit/ipconfig/netdev.h +++ b/usr/kinit/ipconfig/netdev.h @@ -9,6 +9,7 @@ #include <sys/utsname.h> #include <net/if.h> #define BPLEN 40 +#define FNLEN 128 /* from RFC 2131, DHCP */ struct netdev { const char *name; /* Device name */ @@ -42,6 +43,7 @@ struct netdev { char dnsdomainname[SYS_NMLN]; /* dns domain name */ char nisdomainname[SYS_NMLN]; /* nis domain name */ char bootpath[BPLEN]; /* boot path */ + char filename[FNLEN]; /* filename */ struct netdev *next; /* next configured i/f */ };
Bryan O'Sullivan
2006-Jun-22 21:34 UTC
[klibc] [patch] ipconfig add dhcp file preseeding support
On Thu, 2006-06-22 at 21:24 +0200, maximilian attems wrote:> From: Geert Stappers <stappers at debian.org> > > To make klibc-ipconfig transmit the DHCP vendor class "d-i" > and get the DHCP preseeding filename in a text file, it needs the > attached patch.Why would we want to have "d-i" there? Putting a Debian-specific string in doesn't make any sense. <b
Geert Stappers
2006-Jul-08 13:06 UTC
[klibc] [patch] ipconfig add dhcp file preseeding support
On Fri, Jul 07, 2006 at 09:18:25AM -0700, H. Peter Anvin wrote:> > Hi Geert, > > This patch came through HTML-botched... > >@@ -74,6 +74,7 @@ int bootp_parse(struct netdev *dev, stru > > dev->hostname[0] = '\0'; > ^^^^attached a non-HTML-botched one GSt -------------- next part -------------- diff -ru klibc-1.3.35-as-found/usr/kinit/ipconfig/bootp_proto.c klibc-1.3.35/usr/kinit/ipconfig/bootp_proto.c --- klibc-1.3.35-as-found/usr/kinit/ipconfig/bootp_proto.c 2006-06-08 17:47:18.000000000 +0200 +++ klibc-1.3.35/usr/kinit/ipconfig/bootp_proto.c 2006-07-08 14:36:18.000000000 +0200 @@ -74,6 +74,7 @@ dev->hostname[0] = '\0'; dev->nisdomainname[0] = '\0'; dev->bootpath[0] = '\0'; + memcpy(&dev->filename, &hdr->boot_file, FNLEN); if (extlen >= 4 && exts[0] == 99 && exts[1] == 130 && exts[2] == 83 && exts[3] == 99) { diff -ru klibc-1.3.35-as-found/usr/kinit/ipconfig/main.c klibc-1.3.35/usr/kinit/ipconfig/main.c --- klibc-1.3.35-as-found/usr/kinit/ipconfig/main.c 2006-06-08 17:47:18.000000000 +0200 +++ klibc-1.3.35/usr/kinit/ipconfig/main.c 2006-07-08 14:29:08.000000000 +0200 @@ -71,6 +71,7 @@ printf(" nisdomain: %-64s\n", dev->nisdomainname); printf(" rootserver: %s ", my_inet_ntoa(dev->ip_server)); printf("rootpath: %s\n", dev->bootpath); + printf(" filename : %s\n", dev->filename); } static void configure_device(struct netdev *dev) @@ -112,6 +113,7 @@ fprintf(f, "NISDOMAIN=%s\n", dev->nisdomainname); fprintf(f, "ROOTSERVER=%s\n", my_inet_ntoa(dev->ip_server)); fprintf(f, "ROOTPATH=%s\n", dev->bootpath); + fprintf(f, "FILENAME=%s\n", dev->filename); fclose(f); } } diff -ru klibc-1.3.35-as-found/usr/kinit/ipconfig/netdev.h klibc-1.3.35/usr/kinit/ipconfig/netdev.h --- klibc-1.3.35-as-found/usr/kinit/ipconfig/netdev.h 2006-06-08 17:47:18.000000000 +0200 +++ klibc-1.3.35/usr/kinit/ipconfig/netdev.h 2006-07-08 14:33:24.000000000 +0200 @@ -9,6 +9,7 @@ #include <net/if.h> #define BPLEN 40 +#define FNLEN 128 /* from RFC 2131, DHCP */ struct netdev { const char *name; /* Device name */ @@ -42,6 +43,7 @@ char dnsdomainname[SYS_NMLN]; /* dns domain name */ char nisdomainname[SYS_NMLN]; /* nis domain name */ char bootpath[BPLEN]; /* boot path */ + char filename[FNLEN]; /* filename */ struct netdev *next; /* next configured i/f */ };
Apparently Analagous Threads
- [PATCH] Escape DHCP options written to /tmp/net-$DEVCICE.conf
- [klibc:master] ipconfig: Write $DOMAINSEARCH as domain-search
- [PATCH] Implement classless static routes
- [PATCH v2] Implement classless static routes
- [klibc:master] ipconfig: Implement classless static routes