Magellan Linux

Diff of /tags/grubby-8_21/grubby.c

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

revision 1940 by niro, Mon Oct 1 12:39:50 2012 UTC revision 2056 by niro, Wed Feb 20 14:04:28 2013 UTC
# Line 138  struct configFileInfo { Line 138  struct configFileInfo {
138      findConfigFunc findConfig;      findConfigFunc findConfig;
139      writeLineFunc writeLine;      writeLineFunc writeLine;
140      struct keywordTypes * keywords;      struct keywordTypes * keywords;
141        int caseInsensitive;
142      int defaultIsIndex;      int defaultIsIndex;
143      int defaultIsVariable;      int defaultIsVariable;
144      int defaultSupportSaved;      int defaultSupportSaved;
# Line 496  struct configFileInfo ziplConfigType = { Line 497  struct configFileInfo ziplConfigType = {
497  struct configFileInfo extlinuxConfigType = {  struct configFileInfo extlinuxConfigType = {
498      .defaultConfig = "/boot/extlinux/extlinux.conf",      .defaultConfig = "/boot/extlinux/extlinux.conf",
499      .keywords = extlinuxKeywords,      .keywords = extlinuxKeywords,
500        .caseInsensitive = 1,
501      .entryStart = LT_TITLE,      .entryStart = LT_TITLE,
502      .needsBootPrefix = 1,      .needsBootPrefix = 1,
503      .maxTitleLength = 255,      .maxTitleLength = 255,
# Line 632  static char * getuuidbydev(char *device) Line 634  static char * getuuidbydev(char *device)
634  static enum lineType_e getTypeByKeyword(char * keyword,  static enum lineType_e getTypeByKeyword(char * keyword,
635   struct configFileInfo * cfi) {   struct configFileInfo * cfi) {
636      for (struct keywordTypes *kw = cfi->keywords; kw->key; kw++) {      for (struct keywordTypes *kw = cfi->keywords; kw->key; kw++) {
637   if (!strcmp(keyword, kw->key))   if (cfi->caseInsensitive) {
638      return kw->type;      if (!strcasecmp(keyword, kw->key))
639                    return kw->type;
640     } else {
641        if (!strcmp(keyword, kw->key))
642            return kw->type;
643     }
644      }      }
645      return LT_UNKNOWN;      return LT_UNKNOWN;
646  }  }
# Line 1773  struct singleEntry * findEntryByPath(str Line 1780  struct singleEntry * findEntryByPath(str
1780    
1781      /* check all the lines matching checkType */      /* check all the lines matching checkType */
1782      for (line = entry->lines; line; line = line->next) {      for (line = entry->lines; line; line = line->next) {
1783   line = getLineByType(entry->multiboot && checkType == LT_KERNEL   enum lineType_e ct = checkType;
1784   ? LT_KERNEL|LT_KERNEL_EFI|LT_MBMODULE|LT_HYPER   if (entry->multiboot && checkType == LT_KERNEL)
1785   : checkType, line);      ct = LT_KERNEL|LT_KERNEL_EFI|LT_MBMODULE|LT_HYPER;
1786   if (!line) break;  /* not found in this entry */   else if (checkType & LT_KERNEL)
1787        ct = checkType | LT_KERNEL_EFI;
1788     line = getLineByType(ct, line);
1789     if (!line)
1790        break;  /* not found in this entry */
1791    
1792   if (line && line->type != LT_MENUENTRY &&   if (line && line->type != LT_MENUENTRY &&
1793   line->numElements >= 2) {   line->numElements >= 2) {

Legend:
Removed from v.1940  
changed lines
  Added in v.2056