Magellan Linux

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

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

revision 1692 by niro, Fri Feb 17 23:14:54 2012 UTC revision 1693 by niro, Fri Feb 17 23:21:08 2012 UTC
# Line 115  struct configFileInfo { Line 115  struct configFileInfo {
115      struct keywordTypes * keywords;      struct keywordTypes * keywords;
116      int defaultIsIndex;      int defaultIsIndex;
117      int defaultSupportSaved;      int defaultSupportSaved;
118      enum lineType_e entrySeparator;      enum lineType_e entryStart;
119      int needsBootPrefix;      int needsBootPrefix;
120      int argsInQuotes;      int argsInQuotes;
121      int maxTitleLength;      int maxTitleLength;
# Line 143  struct configFileInfo grubConfigType = { Line 143  struct configFileInfo grubConfigType = {
143      .keywords = grubKeywords,      .keywords = grubKeywords,
144      .defaultIsIndex = 1,      .defaultIsIndex = 1,
145      .defaultSupportSaved = 1,      .defaultSupportSaved = 1,
146      .entrySeparator = LT_TITLE,      .entryStart = LT_TITLE,
147      .needsBootPrefix = 1,      .needsBootPrefix = 1,
148      .mbHyperFirst = 1,      .mbHyperFirst = 1,
149      .mbInitRdIsModule = 1,      .mbInitRdIsModule = 1,
# Line 247  int useextlinuxmenu; Line 247  int useextlinuxmenu;
247  struct configFileInfo eliloConfigType = {  struct configFileInfo eliloConfigType = {
248      .defaultConfig = "/boot/efi/EFI/redhat/elilo.conf",      .defaultConfig = "/boot/efi/EFI/redhat/elilo.conf",
249      .keywords = eliloKeywords,      .keywords = eliloKeywords,
250      .entrySeparator = LT_KERNEL,      .entryStart = LT_KERNEL,
251      .needsBootPrefix = 1,      .needsBootPrefix = 1,
252      .argsInQuotes = 1,      .argsInQuotes = 1,
253      .mbConcatArgs = 1,      .mbConcatArgs = 1,
# Line 256  struct configFileInfo eliloConfigType = Line 256  struct configFileInfo eliloConfigType =
256  struct configFileInfo liloConfigType = {  struct configFileInfo liloConfigType = {
257      .defaultConfig = "/etc/lilo.conf",      .defaultConfig = "/etc/lilo.conf",
258      .keywords = liloKeywords,      .keywords = liloKeywords,
259      .entrySeparator = LT_KERNEL,      .entryStart = LT_KERNEL,
260      .argsInQuotes = 1,      .argsInQuotes = 1,
261      .maxTitleLength = 15,      .maxTitleLength = 15,
262  };  };
# Line 264  struct configFileInfo liloConfigType = { Line 264  struct configFileInfo liloConfigType = {
264  struct configFileInfo yabootConfigType = {  struct configFileInfo yabootConfigType = {
265      .defaultConfig = "/etc/yaboot.conf",      .defaultConfig = "/etc/yaboot.conf",
266      .keywords = yabootKeywords,      .keywords = yabootKeywords,
267      .entrySeparator = LT_KERNEL,      .entryStart = LT_KERNEL,
268      .needsBootPrefix = 1,      .needsBootPrefix = 1,
269      .argsInQuotes = 1,      .argsInQuotes = 1,
270      .maxTitleLength = 15,      .maxTitleLength = 15,
# Line 274  struct configFileInfo yabootConfigType = Line 274  struct configFileInfo yabootConfigType =
274  struct configFileInfo siloConfigType = {  struct configFileInfo siloConfigType = {
275      .defaultConfig = "/etc/silo.conf",      .defaultConfig = "/etc/silo.conf",
276      .keywords = siloKeywords,      .keywords = siloKeywords,
277      .entrySeparator = LT_KERNEL,      .entryStart = LT_KERNEL,
278      .needsBootPrefix = 1,      .needsBootPrefix = 1,
279      .argsInQuotes = 1,      .argsInQuotes = 1,
280      .maxTitleLength = 15,      .maxTitleLength = 15,
# Line 283  struct configFileInfo siloConfigType = { Line 283  struct configFileInfo siloConfigType = {
283  struct configFileInfo ziplConfigType = {  struct configFileInfo ziplConfigType = {
284      .defaultConfig = "/etc/zipl.conf",      .defaultConfig = "/etc/zipl.conf",
285      .keywords = ziplKeywords,      .keywords = ziplKeywords,
286      .entrySeparator = LT_TITLE,      .entryStart = LT_TITLE,
287      .argsInQuotes = 1,      .argsInQuotes = 1,
288      .titleBracketed = 1,      .titleBracketed = 1,
289  };  };
# Line 291  struct configFileInfo ziplConfigType = { Line 291  struct configFileInfo ziplConfigType = {
291  struct configFileInfo extlinuxConfigType = {  struct configFileInfo extlinuxConfigType = {
292      .defaultConfig = "/boot/extlinux/extlinux.conf",      .defaultConfig = "/boot/extlinux/extlinux.conf",
293      .keywords = extlinuxKeywords,      .keywords = extlinuxKeywords,
294      .entrySeparator = LT_TITLE,      .entryStart = LT_TITLE,
295      .needsBootPrefix = 1,      .needsBootPrefix = 1,
296      .maxTitleLength = 255,      .maxTitleLength = 255,
297      .mbAllowExtraInitRds = 1,      .mbAllowExtraInitRds = 1,
# Line 437  static int isBracketedTitle(struct singl Line 437  static int isBracketedTitle(struct singl
437      return 0;      return 0;
438  }  }
439    
440  static int isEntrySeparator(struct singleLine * line,  static int isEntryStart(struct singleLine * line,
441                              struct configFileInfo * cfi) {                              struct configFileInfo * cfi) {
442      return line->type == cfi->entrySeparator || line->type == LT_OTHER ||      return line->type == cfi->entryStart || line->type == LT_OTHER ||
443   (cfi->titleBracketed && isBracketedTitle(line));   (cfi->titleBracketed && isBracketedTitle(line));
444  }  }
445    
# Line 762  static struct grubConfig * readConfig(co Line 762  static struct grubConfig * readConfig(co
762      cfg->secondaryIndent = strdup(line->indent);      cfg->secondaryIndent = strdup(line->indent);
763   }   }
764    
765   if (isEntrySeparator(line, cfi)) {   if (isEntryStart(line, cfi)) {
766      sawEntry = 1;      sawEntry = 1;
767      if (!entry) {      if (!entry) {
768   cfg->entries = malloc(sizeof(*entry));   cfg->entries = malloc(sizeof(*entry));
# Line 2673  int addNewKernel(struct grubConfig * con Line 2673  int addNewKernel(struct grubConfig * con
2673   /* don't have a template, so start the entry with the   /* don't have a template, so start the entry with the
2674   * appropriate starting line   * appropriate starting line
2675   */   */
2676   switch (config->cfi->entrySeparator) {   switch (config->cfi->entryStart) {
2677      case LT_KERNEL:      case LT_KERNEL:
2678   if (new->multiboot && config->cfi->mbHyperFirst) {   if (new->multiboot && config->cfi->mbHyperFirst) {
2679      /* fall through to LT_HYPER */      /* fall through to LT_HYPER */
# Line 2725  int addNewKernel(struct grubConfig * con Line 2725  int addNewKernel(struct grubConfig * con
2725    
2726      /* add the remainder of the lines, i.e. those that either      /* add the remainder of the lines, i.e. those that either
2727       * weren't present in the template, or in the case of no template,       * weren't present in the template, or in the case of no template,
2728       * all the lines following the entrySeparator.       * all the lines following the entryStart.
2729       */       */
2730      if (needs & NEED_TITLE) {      if (needs & NEED_TITLE) {
2731   newLine = addLine(new, config->cfi, LT_TITLE,   newLine = addLine(new, config->cfi, LT_TITLE,

Legend:
Removed from v.1692  
changed lines
  Added in v.1693