Magellan Linux

Diff of /trunk/grubby/grubby.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1713 by niro, Fri Feb 17 23:46:24 2012 UTC revision 1714 by niro, Sat Feb 18 00:32:14 2012 UTC
# Line 190  const char *grub2FindConfig(struct confi Line 190  const char *grub2FindConfig(struct confi
190   NULL   NULL
191      };      };
192      static int i = -1;      static int i = -1;
193        static const char *grub_cfg = "/boot/grub/grub.cfg";
194    
195      if (i == -1) {      if (i == -1) {
196   for (i = 0; configFiles[i] != NULL; i++) {   for (i = 0; configFiles[i] != NULL; i++) {
# Line 198  const char *grub2FindConfig(struct confi Line 199  const char *grub2FindConfig(struct confi
199   dbgPrintf("found\n");   dbgPrintf("found\n");
200   return configFiles[i];   return configFiles[i];
201      }      }
     dbgPrintf("not found\n");  
202   }   }
203      }      }
204    
205        /* Ubuntu renames grub2 to grub, so check for the grub.d directory
206         * that isn't in grub1, and if it exists, return the config file path
207         * that they use. */
208        if (configFiles[i] == NULL && !access("/etc/grub.d/", R_OK)) {
209     dbgPrintf("found\n");
210     return grub_cfg;
211        }
212    
213        dbgPrintf("not found\n");
214      return configFiles[i];      return configFiles[i];
215  }  }
216    
# Line 2584  int checkForLilo(struct grubConfig * con Line 2594  int checkForLilo(struct grubConfig * con
2594  }  }
2595    
2596  int checkForGrub2(struct grubConfig * config) {  int checkForGrub2(struct grubConfig * config) {
2597      if (!access("/boot/grub2", R_OK))      if (!access("/etc/grub.d/", R_OK))
2598   return 2;   return 2;
2599    
2600      return 1;      return 1;

Legend:
Removed from v.1713  
changed lines
  Added in v.1714