FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 05-10-2010, 02:34 PM
Hans de Goede
 
Default Use iBFT if present and user didn't asked for anything else. (#581428)

Ack.

On 05/10/2010 04:07 PM, Martin Sivak wrote:

---
loader/net.c | 63 +++++++++++++++++++++++++++++++++------------------------
1 files changed, 36 insertions(+), 27 deletions(-)

diff --git a/loader/net.c b/loader/net.c
index 24f4cf3..dd27916 100644
--- a/loader/net.c
+++ b/loader/net.c
@@ -248,6 +248,7 @@ void setupIfaceStruct(iface_t * iface, struct loaderData_s * loaderData) {
iface->ipv4method = IPV4_DHCP_METHOD;
logMessage(INFO, "iBFT is not present");
}
+
/* MAC address doesn't match */
else if(strcasecmp(ibft_iface_mac(), devmacaddr)){
iface->ipv4method = IPV4_DHCP_METHOD;
@@ -1739,28 +1740,19 @@ int chooseNetworkInterface(struct loaderData_s * loaderData) {
return LOADER_ERROR;
}

- /* JKFIXME: if we only have one interface and it doesn't have link,
- * do we go ahead? */
- if (deviceNums == 1) {
- logMessage(INFO, "only have one network device: %s", devices[0]);
- loaderData->netDev = devices[0];
- return LOADER_NOOP;
- }
-
- while ((loaderData->netDev&& (loaderData->netDev_set == 1))&&
- !strcmp(loaderData->netDev, "ibft")) {
+ /* If there is iBFT table and ksdevice doesn't say otherwise, use it */
+ while (!loaderData->netDev_set || !strcmp(loaderData->netDev, "ibft")) {
char *devmacaddr = NULL;
char *ibftmacaddr = "";

/* get MAC from the iBFT table */
if (!(ibftmacaddr = ibft_iface_mac())) { /* iBFT not present or error */
- lookForLink = 0;
+ logMessage(ERROR, "iBFT doesn't couldn't provide valid NIC MAC address");
break;
}

logMessage(INFO, "looking for iBFT configured device %s with link",
ibftmacaddr);
- lookForLink = 0;

for (i = 0; devs[i]; i++) {
if (!devs[i]->device)
@@ -1771,27 +1763,35 @@ int chooseNetworkInterface(struct loaderData_s * loaderData) {
if(!strcasecmp(devmacaddr, ibftmacaddr)){
logMessage(INFO,
"%s has the right MAC (%s), checking for link",
- devmacaddr, devices[i]);
+ devs[i]->device, devmacaddr);
free(devmacaddr);

- if (get_link_status(devices[i]) == 1) {
- lookForLink = 0;
- loaderData->netDev = devices[i];
- logMessage(INFO, "%s has link, using it", devices[i]);
+ /* wait for the link (max 5s) */
+ for (rc = 0; rc< 5; rc++) {
+ if (get_link_status(devs[i]->device) == 0) {
+ logMessage(INFO, "%s still has no link, waiting", devs[i]->device);
+ sleep(1);
+ } else {
+ lookForLink = 0;
+ loaderData->netDev = devs[i]->device;
+ loaderData->netDev_set = 1;
+ logMessage(INFO, "%s has link, using it", devs[i]->device);
+
+ /* set the IP method to ibft if not requested differently */
+ if (loaderData->ipv4 == NULL) {
+ loaderData->ipv4 = strdup("ibft");
+ loaderData->ipinfo_set = 1;
+ logMessage(INFO,
+ "%s will be configured using iBFT values",
+ devices[i]);
+ }

- /* set the IP method to ibft if not requested differently */
- if (loaderData->ipv4 == NULL) {
- loaderData->ipv4 = strdup("ibft");
- logMessage(INFO,
- "%s will be configured using iBFT values",
- devices[i]);
+ return LOADER_NOOP;
}
-
- return LOADER_NOOP;
- } else {
- logMessage(INFO, "%s has no link, skipping it", devices[i]);
}

+ logMessage(INFO, "%s has no link, skipping it", devices[i]);
+
break;
} else {
free(devmacaddr);
@@ -1825,6 +1825,15 @@ int chooseNetworkInterface(struct loaderData_s * loaderData) {
"wanted netdev with link, but none present. prompting");
}

+ /* JKFIXME: if we only have one interface and it doesn't have link,
+ * do we go ahead? */
+ if (deviceNums == 1) {
+ logMessage(INFO, "only have one network device: %s", devices[0]);
+ loaderData->netDev = devices[0];
+ loaderData->netDev_set = 1;
+ return LOADER_NOOP;
+ }
+
if (FL_CMDLINE(flags)) {
fprintf(stderr, "No way to determine which NIC to use, and cannot "
"prompt in cmdline
mode. Halting.
");


_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 05-10-2010, 03:00 PM
Peter Jones
 
Default Use iBFT if present and user didn't asked for anything else. (#581428)

On 05/10/2010 10:07 AM, Martin Sivak wrote:
> /* get MAC from the iBFT table */
> if (!(ibftmacaddr = ibft_iface_mac())) { /* iBFT not present or error */
> - lookForLink = 0;
> + logMessage(ERROR, "iBFT doesn't couldn't provide valid NIC MAC address");

This error message isn't really comprehensible. Maybe "iBFT
header doesn't include valid MAC address" instead?

--
Peter

I was born not knowing and have had only a little time to
change that here and there.
-- Feynman

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 10:43 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org