]> git.ozlabs.org Git - yaboot.git/commitdiff
use of cfg_set_default_by_mac() function in yaboot.c
authorPaul Nasrat <pnasrat@redhat.com>
Tue, 15 May 2007 13:28:02 +0000 (14:28 +0100)
committerPaul Nasrat <pauln@enki.eridu>
Tue, 15 May 2007 13:28:02 +0000 (14:28 +0100)
This last part calls the cfg_set_default_by_mac() function in yaboot.c
by load_config_file() function.

Signed-off-by: Paulo Ricardo Paz Vital <vital@br.ibm.com>
second/yaboot.c

index 30abbd6b181ab6a79c9d317e9d6159ae2bb7767a..6eef8d69ccc94a170694106f0dcbe70b40421b8f 100644 (file)
@@ -368,6 +368,22 @@ load_config_file(struct boot_fspec_t *fspec)
          goto bail;
      }
 
+     /* 
+      * set the default cf_option to label that has the same MAC addr 
+      * it only works if there is a label with the MAC addr on yaboot.conf
+      */
+     if (prom_get_devtype(fspec->dev) == FILE_DEVICE_NET) {
+         /* change the variable bellow to get the MAC dinamicaly */
+         char * macaddr = NULL;
+         int default_mac = 0;
+
+         macaddr = prom_get_mac(prom_get_netinfo());
+         default_mac = cfg_set_default_by_mac(macaddr);
+         if (default_mac >= 1) {
+            prom_printf("Default label was changed to macaddr label.\n");
+         }
+     }
+
      DEBUG_F("Config file successfully parsed, %d bytes\n", sz);
 
      /* Now, we do the initialisations stored in the config file */