diff options
author | Bill Nottingham <notting@redhat.com> | 2003-07-03 04:41:30 +0000 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2003-07-03 04:41:30 +0000 |
commit | ad4b0bfcf3ad8e25c3c509464e07c002f43b6dd5 (patch) | |
tree | 20a54d6f338914635490de768950d72dc8121b51 | |
parent | a2e7edb16db50a54b0d7937fd07ab78cc4da94fa (diff) | |
download | anaconda-ad4b0bfcf3ad8e25c3c509464e07c002f43b6dd5.tar.gz anaconda-ad4b0bfcf3ad8e25c3c509464e07c002f43b6dd5.tar.xz anaconda-ad4b0bfcf3ad8e25c3c509464e07c002f43b6dd5.zip |
fill in model info of net devices with their description
use this in choose-your-own-netdevice screen
requires kudzu-1.1.9 or higher.
-rw-r--r-- | isys/probe.c | 11 | ||||
-rw-r--r-- | loader2/net.c | 15 |
2 files changed, 22 insertions, 4 deletions
diff --git a/isys/probe.c b/isys/probe.c index 8da11c9b5..5ad013d13 100644 --- a/isys/probe.c +++ b/isys/probe.c @@ -102,11 +102,14 @@ void kdFree(struct knownDevices * devices) { } int kdFindNetList(struct knownDevices * devices, int code) { - int fd; + int fd, i; char *buf; char * start, * end; + struct device **kdevs; struct kddevice newDevice; int s; + + kdevs = probeDevices(CLASS_NETWORK, BUS_UNSPEC, PROBE_ALL); if ((fd = open("/proc/net/dev", O_RDONLY)) < 0) { fprintf(stderr, "failed to open /proc/net/dev!\n"); @@ -139,6 +142,12 @@ int kdFindNetList(struct knownDevices * devices, int code) { if (!deviceKnown(devices, start)) { newDevice.name = strdup(start); newDevice.model = NULL; + if (kdevs) { + for (i = 0; kdevs[i]; i++) + if (kdevs[i]->device && !strcmp(kdevs[i]->device, newDevice.name)) + newDevice.model = strdup(kdevs[i]->desc); + + } newDevice.class = CLASS_NETWORK; newDevice.code = code; addDevice(devices, newDevice); diff --git a/loader2/net.c b/loader2/net.c index 799580a38..e54deeaed 100644 --- a/loader2/net.c +++ b/loader2/net.c @@ -702,7 +702,7 @@ void setKickstartNetwork(struct loaderData_s * loaderData, int argc, int chooseNetworkInterface(struct knownDevices * kd, struct loaderData_s * loaderData, int flags) { - int i, rc; + int i, rc, max = 40; int deviceNums = 0; int deviceNum; char ** devices; @@ -714,7 +714,16 @@ int chooseNetworkInterface(struct knownDevices * kd, if (kd->known[i].class != CLASS_NETWORK) continue; - devices[deviceNums++] = kd->known[i].name; + if (kd->known[i].model) { + devices[deviceNums++] = alloca(strlen(kd->known[i].name) + + strlen(kd->known[i].model) + 4); + sprintf(devices[deviceNums-1],"%s - %s", + kd->known[i].name, kd->known[i].model); + if (strlen(devices[deviceNums-1]) > max) + max = strlen(devices[deviceNums-1]); + } else { + devices[deviceNums++] = kd->known[i].name; + } /* make sure that this device is disabled */ pumpDisableInterface(kd->known[i].name); @@ -749,7 +758,7 @@ int chooseNetworkInterface(struct knownDevices * kd, deviceNum = 0; rc = newtWinMenu(_("Networking Device"), _("You have multiple network devices on this system. " - "Which would you like to install through?"), 40, 10, 10, + "Which would you like to install through?"), max, 10, 10, deviceNums < 6 ? deviceNums : 6, devices, &deviceNum, _("OK"), _("Back"), NULL); if (rc == 2) |