Hello,

Here an update of the patch.

* split "filename" and "identify" in separate files.
The two new files replace debian/patches/05_ipconfig_d-i.patch
This split matches how upstream responded to the patch

* optimized for the d-i post install file
debian-installer/packages/preseed/debian/network-preseed.postinst
it has this code
          FN="$(sed -n -e '/filename/s/.*"\(.*\)"./\1/p' $file)"
          if echo "$FN" | grep -q "://" ; then
                  preseed_location "$FN"
          fi
so it searches for _lowercase_ string 'filename'
and takes what between double qoutes is.
something like:
 -  print("FILENAME=%s\n",fn);
 +  print("filename=\"%s\"\n",fn);


Cheers
Geert Stappers
# for Debian bugreport #374982, the filename part
# patch is also sended to upstream
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/main.c b/usr/kinit/ipconfig/main.c
index 4f2d0e0..48b01a5 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)
@@ -116,6 +117,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..99c433a 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 DHCP  RFC 2131 */
 
 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  */
 };
 
garbage or end of file, patch doesn't care about
# for Debian bugreport #374982, identify part
# upstream didn't accept the hardcoded string
# (and asked for a commandline configurable version, which is work in progress)
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,
 };
 
# last line

Reply via email to