]> git.ozlabs.org Git - yaboot.git/blobdiff - second/yaboot.c
Add missing includes
[yaboot.git] / second / yaboot.c
index 30abbd6b181ab6a79c9d317e9d6159ae2bb7767a..6b31cb0af0797fa7ef0c2b373da040b58b851c6b 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 */
@@ -473,9 +489,10 @@ static int load_my_config_file(struct boot_fspec_t *orig_fspec)
      if (!fspec.file)
          goto out;
 
+     strcpy(fspec.file, "/etc/");
      strcat(fspec.file, prom_get_ip(packet));
 
-     while (strlen(fspec.file)) {
+     while (strlen(strrchr(fspec.file, '/')+1)) {
          rc = load_config_file(&fspec);
          if (rc)
               goto out;