Magellan Linux

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

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

revision 2688 by niro, Wed Jul 16 10:42:34 2014 UTC revision 2692 by niro, Wed Jul 16 10:45:12 2014 UTC
# Line 161  struct configFileInfo { Line 161  struct configFileInfo {
161      int defaultIsVariable;      int defaultIsVariable;
162      int defaultSupportSaved;      int defaultSupportSaved;
163      int defaultIsSaved;      int defaultIsSaved;
164        int defaultIsUnquoted;
165      enum lineType_e entryStart;      enum lineType_e entryStart;
166      enum lineType_e entryEnd;      enum lineType_e entryEnd;
167      int needsBootPrefix;      int needsBootPrefix;
# Line 636  struct configFileInfo extlinuxConfigType Line 637  struct configFileInfo extlinuxConfigType
637      .needsBootPrefix = 1,      .needsBootPrefix = 1,
638      .maxTitleLength = 255,      .maxTitleLength = 255,
639      .mbAllowExtraInitRds = 1,      .mbAllowExtraInitRds = 1,
640        .defaultIsUnquoted = 1,
641  };  };
642    
643  struct grubConfig {  struct grubConfig {
# Line 1191  static struct grubConfig * readConfig(co Line 1193  static struct grubConfig * readConfig(co
1193   cfg->flags &= ~GRUB_CONFIG_NO_DEFAULT;   cfg->flags &= ~GRUB_CONFIG_NO_DEFAULT;
1194   defaultLine = line;   defaultLine = line;
1195      }      }
  } else if (line->type == LT_DEFAULT && line->numElements == 2) {  
     cfg->flags &= ~GRUB_CONFIG_NO_DEFAULT;  
     defaultLine = line;  
1196    
1197          } else if (iskernel(line->type)) {          } else if (iskernel(line->type)) {
1198      /* if by some freak chance this is multiboot and the "module"      /* if by some freak chance this is multiboot and the "module"
# Line 1226  static struct grubConfig * readConfig(co Line 1225  static struct grubConfig * readConfig(co
1225      cfg->fallbackImage = strtol(line->elements[1].item, &end, 10);      cfg->fallbackImage = strtol(line->elements[1].item, &end, 10);
1226      if (*end) cfg->fallbackImage = -1;      if (*end) cfg->fallbackImage = -1;
1227    
1228   } else if (line->type == LT_TITLE && line->numElements > 1) {   } else if ((line->type == LT_DEFAULT && cfi->defaultIsUnquoted) ||
1229      /* make the title a single argument (undoing our parsing) */                  (line->type == LT_TITLE && line->numElements > 1)) {
1230        /* make the title/default a single argument (undoing our parsing) */
1231      len = 0;      len = 0;
1232      for (int i = 1; i < line->numElements; i++) {      for (int i = 1; i < line->numElements; i++) {
1233   len += strlen(line->elements[i].item);   len += strlen(line->elements[i].item);
# Line 1334  static struct grubConfig * readConfig(co Line 1334  static struct grubConfig * readConfig(co
1334      }      }
1335   }   }
1336    
1337     if (line->type == LT_DEFAULT && line->numElements == 2) {
1338        cfg->flags &= ~GRUB_CONFIG_NO_DEFAULT;
1339        defaultLine = line;
1340     }
1341    
1342   /* If we find a generic config option which should live at the   /* If we find a generic config option which should live at the
1343     top of the file, move it there. Old versions of grubby were     top of the file, move it there. Old versions of grubby were
1344     probably responsible for putting new images in the wrong     probably responsible for putting new images in the wrong

Legend:
Removed from v.2688  
changed lines
  Added in v.2692