diff -ru anaconda-9.0.95/docs/command-line.txt anaconda-9.0.95-new/docs/command-line.txt --- anaconda-9.0.95/docs/command-line.txt 2003-08-20 18:54:51.000000000 -0500 +++ anaconda-9.0.95-new/docs/command-line.txt 2003-10-10 11:40:45.000000000 -0500 @@ -102,6 +102,10 @@ HTTP_X_RHN_PROVISIONING_0, HTTP_X_RHN_PROVISIONING_1, etc, for all nics. +ksclass= Sends a custom DHCP vendor class identifier. ISC's dhcpcd can + inspect this value using "option vendor-class-identifier". See + https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=78843 + upgradeany Don't require an /etc/redhat-release that matches the expected syntax to upgrade. diff -ru anaconda-9.0.95/installclass.py anaconda-9.0.95-new/installclass.py --- anaconda-9.0.95/installclass.py 2003-09-30 15:12:52.000000000 -0500 +++ anaconda-9.0.95-new/installclass.py 2003-10-10 11:40:45.000000000 -0500 @@ -291,7 +291,7 @@ id.auth.enableCache = enableCache - def setNetwork(self, id, bootProto, ip, netmask, ethtool, device = None, onboot = 1): + def setNetwork(self, id, bootProto, ip, netmask, ethtool, device = None, onboot = 1, dhcpclass = None): if bootProto: devices = id.network.available () if (devices and bootProto): @@ -301,6 +301,7 @@ device = list[0] dev = devices[device] dev.set (("bootproto", bootProto)) + dev.set (("dhcpclass", dhcpclass)) if onboot: dev.set (("onboot", "yes")) else: diff -ru anaconda-9.0.95/isys/isys.c anaconda-9.0.95-new/isys/isys.c --- anaconda-9.0.95/isys/isys.c 2003-09-19 22:31:30.000000000 -0500 +++ anaconda-9.0.95-new/isys/isys.c 2003-10-10 12:02:41.000000000 -0500 @@ -656,14 +656,15 @@ static PyObject * doPumpNetDevice(PyObject * s, PyObject * args) { char * device; + char * class; char * chptr; struct pumpNetIntf cfg; PyObject * rc; - if (!PyArg_ParseTuple(args, "s", &device)) + if (!PyArg_ParseTuple(args, "sz", &device, &class)) return NULL; - chptr = pumpDhcpRun(device, 0, 0, NULL, &cfg, NULL); + chptr = pumpDhcpClassRun(device, 0, 0, NULL, class, &cfg, NULL); if (chptr) { Py_INCREF(Py_None); return Py_None; diff -ru anaconda-9.0.95/kickstart.py anaconda-9.0.95-new/kickstart.py --- anaconda-9.0.95/kickstart.py 2003-10-02 15:09:56.000000000 -0500 +++ anaconda-9.0.95-new/kickstart.py 2003-10-10 11:40:45.000000000 -0500 @@ -422,7 +422,8 @@ # nodns is only used by the loader (args, extra) = isys.getopt(args, '', [ 'bootproto=', 'ip=', 'netmask=', 'gateway=', 'nameserver=', - 'nodns', 'device=', 'hostname=', 'ethtool=', 'onboot=']) + 'nodns', 'device=', 'hostname=', 'ethtool=', 'onboot=', + 'class=']) bootProto = "dhcp" ip = None netmask = "" @@ -432,6 +433,7 @@ ethtool = "" onboot = 1 device = None + dhcpclass = None for n in args: (str, arg) = n if str == "--bootproto": @@ -455,8 +457,10 @@ onboot = 0 else: onboot = 1 + elif str == "--class": + dhcpclass = arg - self.setNetwork(id, bootProto, ip, netmask, ethtool, device=device, onboot=onboot) + self.setNetwork(id, bootProto, ip, netmask, ethtool, device=device, onboot=onboot, dhcpclass=dhcpclass) if hostname != "": self.setHostname(id, hostname) if nameserver != "": diff -ru anaconda-9.0.95/loader2/loader.c anaconda-9.0.95-new/loader2/loader.c --- anaconda-9.0.95/loader2/loader.c 2003-10-02 15:45:45.000000000 -0500 +++ anaconda-9.0.95-new/loader2/loader.c 2003-10-10 11:40:45.000000000 -0500 @@ -500,6 +500,9 @@ else if (!strncasecmp(argv[i], "ksdevice=", 9)) { loaderData->netDev = strdup(argv[i] + 9); loaderData->netDev_set = 1; + } else if (!strncasecmp(argv[i], "ksclass=", 8)) { + loaderData->netCls = strdup(argv[i] + 8); + loaderData->netCls_set = 1; } else if (!strcasecmp(argv[i], "ks") || !strncasecmp(argv[i], "ks=", 3)) loaderData->ksFile = strdup(argv[i]); diff -ru anaconda-9.0.95/loader2/loader.h anaconda-9.0.95-new/loader2/loader.h --- anaconda-9.0.95/loader2/loader.h 2003-07-07 22:00:54.000000000 -0500 +++ anaconda-9.0.95-new/loader2/loader.h 2003-10-10 11:40:45.000000000 -0500 @@ -79,6 +79,8 @@ int kbd_set; char * netDev; int netDev_set; + char * netCls; + int netCls_set; char * ip, * netmask, *gateway, *dns, *hostname, *ptpaddr, *ethtool; int mtu; int noDns; diff -ru anaconda-9.0.95/loader2/net.c anaconda-9.0.95-new/loader2/net.c --- anaconda-9.0.95/loader2/net.c 2003-09-19 22:31:30.000000000 -0500 +++ anaconda-9.0.95-new/loader2/net.c 2003-10-10 12:03:13.000000000 -0500 @@ -198,6 +198,8 @@ logMessage("loaderData->noDns = %d", loaderData->noDns); logMessage("loaderData->netDev_set = %d", loaderData->netDev_set); logMessage("loaderData->netDev = %s", loaderData->netDev); + logMessage("loaderData->netCls_set = %d", loaderData->netCls_set); + logMessage("loaderData->netCls = %s", loaderData->netCls); } /* given loader data from kickstart, populate network configuration struct */ @@ -233,7 +235,7 @@ if (!FL_TESTING(flags)) { waitForLink(loaderData->netDev); - chptr = pumpDhcpRun(loaderData->netDev, 0, 0, NULL, &cfg->dev, NULL); + chptr = pumpDhcpClassRun(loaderData->netDev, 0, 0, NULL, loaderData->netCls, &cfg->dev, NULL); } else { chptr = NULL; } @@ -484,7 +486,7 @@ _("Sending request for IP information for %s..."), device, 0); waitForLink(device); - chptr = pumpDhcpRun(device, 0, 0, NULL, &newCfg.dev, NULL); + chptr = pumpDhcpClassRun(device, 0, 0, NULL, NULL, &newCfg.dev, NULL); newtPopWindow(); } else { chptr = NULL; @@ -675,13 +677,14 @@ void setKickstartNetwork(struct knownDevices * kd, struct loaderData_s * loaderData, int argc, char ** argv, int * flagsPtr) { - char * arg, * bootProto = NULL, * device = NULL, *ethtool = NULL; + char * arg, * bootProto = NULL, * device = NULL, *ethtool = NULL, * class = NULL; int noDns = 0, rc; poptContext optCon; struct poptOption ksOptions[] = { { "bootproto", '\0', POPT_ARG_STRING, &bootProto, 0 }, { "device", '\0', POPT_ARG_STRING, &device, 0 }, + { "class", '\0', POPT_ARG_STRING, &class, 0 }, { "gateway", '\0', POPT_ARG_STRING, NULL, 'g' }, { "ip", '\0', POPT_ARG_STRING, NULL, 'i' }, { "nameserver", '\0', POPT_ARG_STRING, NULL, 'n' }, @@ -752,6 +755,11 @@ loaderData->netDev_set = 1; } + if (class) { + loaderData->netCls = strdup(class); + loaderData->netCls_set = 1; + } + if (ethtool) { if (loaderData->ethtool) free(loaderData->ethtool); diff -ru anaconda-9.0.95/network.py anaconda-9.0.95-new/network.py --- anaconda-9.0.95/network.py 2003-09-29 18:33:33.000000000 -0500 +++ anaconda-9.0.95-new/network.py 2003-10-10 11:40:45.000000000 -0500 @@ -282,7 +282,7 @@ for dev in self.netdevices.values(): if (dev.get('bootproto') == "dhcp" and dev.get('onboot') == "yes"): - ret = isys.pumpNetDevice(dev.get('device')) + ret = isys.pumpNetDevice(dev.get('device'), dev.get('dhcpclass')) if ret is None: continue myns = ret @@ -344,6 +344,8 @@ f.write(" --onboot no") if dev.get('bootproto') == 'dhcp': f.write(" --bootproto dhcp") + if dev.get('dhcpclass'): + f.write(" --class %s" % dev.get('dhcpclass')) if self.overrideDHCPhostname: if (self.hostname and self.hostname != "localhost.localdomain"): @@ -385,6 +387,8 @@ if (dev.get('bootproto') == 'dhcp' and self.hostname and self.overrideDHCPhostname): f.write("DHCP_HOSTNAME=%s\n" %(self.hostname,)) + if dev.get('dhcpclass'): + f.write("DHCP_CLASSID=%s\n" % dev.get('dhcpclass')) f.close()