Magellan Linux

Diff of /trunk/grubby/grubby.c

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

revision 3003 by niro, Tue Jun 27 14:14:00 2017 UTC revision 3027 by niro, Tue Jun 27 14:45:42 2017 UTC
# Line 132  struct singleEntry { Line 132  struct singleEntry {
132  #define NEED_DEVTREE (1 << 6)  #define NEED_DEVTREE (1 << 6)
133    
134  #define MAIN_DEFAULT    (1 << 0)  #define MAIN_DEFAULT    (1 << 0)
135    #define FIRST_ENTRY_INDEX    0 /* boot entry index value begin and increment
136       from this initial value */
137    #define NO_DEFAULT_ENTRY    -1 /* indicates that no specific default boot
138       entry was set or currently exists */
139  #define DEFAULT_SAVED       -2  #define DEFAULT_SAVED       -2
140  #define DEFAULT_SAVED_GRUB2 -3  #define DEFAULT_SAVED_GRUB2 -3
141    
# Line 677  struct grubConfig { Line 681  struct grubConfig {
681   int fallbackImage; /* just like defaultImage */   int fallbackImage; /* just like defaultImage */
682   int flags;   int flags;
683   struct configFileInfo *cfi;   struct configFileInfo *cfi;
684     int isModified; /* assumes only one entry added
685       per invocation of grubby */
686  };  };
687    
688  blkid_cache blkid;  blkid_cache blkid;
# Line 1296  static struct grubConfig *readConfig(con Line 1302  static struct grubConfig *readConfig(con
1302   cfg->theLines = NULL;   cfg->theLines = NULL;
1303   cfg->entries = NULL;   cfg->entries = NULL;
1304   cfg->fallbackImage = 0;   cfg->fallbackImage = 0;
1305     cfg->isModified = 0;
1306    
1307   /* copy everything we have */   /* copy everything we have */
1308   while (*head) {   while (*head) {
# Line 1615  static struct grubConfig *readConfig(con Line 1622  static struct grubConfig *readConfig(con
1622   *end == ' ' || *end == '\t'))   *end == ' ' || *end == '\t'))
1623   end++;   end++;
1624   if (*end)   if (*end)
1625   cfg->defaultImage = -1;   cfg->defaultImage = NO_DEFAULT_ENTRY;
1626   } else if (defaultLine->numElements == 3) {   } else if (defaultLine->numElements == 3) {
1627   char *value = defaultLine->elements[2].item;   char *value = defaultLine->elements[2].item;
1628   while (*value && (*value == '"' ||   while (*value && (*value == '"' ||
# Line 1628  static struct grubConfig *readConfig(con Line 1635  static struct grubConfig *readConfig(con
1635   *end == ' ' || *end == '\t'))   *end == ' ' || *end == '\t'))
1636   end++;   end++;
1637   if (*end)   if (*end)
1638   cfg->defaultImage = -1;   cfg->defaultImage = NO_DEFAULT_ENTRY;
1639   }   }
1640   } else if (cfi->defaultSupportSaved &&   } else if (cfi->defaultSupportSaved &&
1641     !strncmp(defaultLine->elements[1].item, "saved",     !strncmp(defaultLine->elements[1].item, "saved",
# Line 1638  static struct grubConfig *readConfig(con Line 1645  static struct grubConfig *readConfig(con
1645   cfg->defaultImage =   cfg->defaultImage =
1646      strtol(defaultLine->elements[1].item, &end, 10);      strtol(defaultLine->elements[1].item, &end, 10);
1647   if (*end)   if (*end)
1648   cfg->defaultImage = -1;   cfg->defaultImage = NO_DEFAULT_ENTRY;
1649   } else if (defaultLine->numElements >= 2) {   } else if (defaultLine->numElements >= 2) {
1650   int i = 0;   int i = 0;
1651   while ((entry = findEntryByIndex(cfg, i))) {   while ((entry = findEntryByIndex(cfg, i))) {
# Line 1666  static struct grubConfig *readConfig(con Line 1673  static struct grubConfig *readConfig(con
1673   if (entry) {   if (entry) {
1674   cfg->defaultImage = i;   cfg->defaultImage = i;
1675   } else {   } else {
1676   cfg->defaultImage = -1;   cfg->defaultImage = NO_DEFAULT_ENTRY;
1677   }   }
1678   }   }
1679   } else if (cfg->cfi->defaultIsSaved && cfg->cfi->getEnv) {   } else if (cfg->cfi->defaultIsSaved && cfg->cfi->getEnv) {
# Line 1683  static struct grubConfig *readConfig(con Line 1690  static struct grubConfig *readConfig(con
1690   cfg->defaultImage = index;   cfg->defaultImage = index;
1691   }   }
1692   } else {   } else {
1693   cfg->defaultImage = 0;   cfg->defaultImage = FIRST_ENTRY_INDEX;
1694   }   }
1695    
1696   return cfg;   return cfg;
# Line 1703  static void writeDefault(FILE * out, cha Line 1710  static void writeDefault(FILE * out, cha
1710   fprintf(out, "%sdefault%ssaved\n", indent, separator);   fprintf(out, "%sdefault%ssaved\n", indent, separator);
1711   else if (cfg->cfi->defaultIsSaved) {   else if (cfg->cfi->defaultIsSaved) {
1712   fprintf(out, "%sset default=\"${saved_entry}\"\n", indent);   fprintf(out, "%sset default=\"${saved_entry}\"\n", indent);
1713   if (cfg->defaultImage >= 0 && cfg->cfi->setEnv) {   if (cfg->defaultImage >= FIRST_ENTRY_INDEX && cfg->cfi->setEnv) {
1714   char *title;   char *title;
1715   entry = findEntryByIndex(cfg, cfg->defaultImage);   int trueIndex, currentIndex;
1716    
1717     trueIndex = 0;
1718     currentIndex = 0;
1719    
1720     while ((entry = findEntryByIndex(cfg, currentIndex))) {
1721     if (!entry->skip) {
1722     if (trueIndex == cfg->defaultImage) {
1723     break;
1724     }
1725     trueIndex++;
1726     }
1727     currentIndex++;
1728     }
1729   line = getLineByType(LT_MENUENTRY, entry->lines);   line = getLineByType(LT_MENUENTRY, entry->lines);
1730   if (!line)   if (!line)
1731   line = getLineByType(LT_TITLE, entry->lines);   line = getLineByType(LT_TITLE, entry->lines);
# Line 1716  static void writeDefault(FILE * out, cha Line 1736  static void writeDefault(FILE * out, cha
1736   "saved_entry", title);   "saved_entry", title);
1737   }   }
1738   }   }
1739   } else if (cfg->defaultImage > -1) {   } else if (cfg->defaultImage >= FIRST_ENTRY_INDEX) {
1740   if (cfg->cfi->defaultIsIndex) {   if (cfg->cfi->defaultIsIndex) {
1741   if (cfg->cfi->defaultIsVariable) {   if (cfg->cfi->defaultIsVariable) {
1742   fprintf(out, "%sset default=\"%d\"\n", indent,   fprintf(out, "%sset default=\"%d\"\n", indent,
# Line 2420  struct singleEntry *findTemplate(struct Line 2440  struct singleEntry *findTemplate(struct
2440   }   }
2441   }   }
2442   }   }
2443   } else if (cfg->defaultImage > -1) {   } else if (cfg->defaultImage >= FIRST_ENTRY_INDEX) {
2444   entry = findEntryByIndex(cfg, cfg->defaultImage);   entry = findEntryByIndex(cfg, cfg->defaultImage);
2445   if (entry && suitableImage(entry, prefix, skipRemoved, flags)) {   if (entry && suitableImage(entry, prefix, skipRemoved, flags)) {
2446   if (indexPtr)   if (indexPtr)
# Line 2432  struct singleEntry *findTemplate(struct Line 2452  struct singleEntry *findTemplate(struct
2452   index = 0;   index = 0;
2453   while ((entry = findEntryByIndex(cfg, index))) {   while ((entry = findEntryByIndex(cfg, index))) {
2454   if (suitableImage(entry, prefix, skipRemoved, flags)) {   if (suitableImage(entry, prefix, skipRemoved, flags)) {
2455   int j;   int j, unmodifiedIndex;
2456   for (j = 0; j < index; j++) {  
2457     unmodifiedIndex = index;
2458    
2459     for (j = 0; j < unmodifiedIndex; j++) {
2460   entry2 = findEntryByIndex(cfg, j);   entry2 = findEntryByIndex(cfg, j);
2461   if (entry2->skip)   if (entry2->skip)
2462   index--;   index--;
# Line 2494  void markRemovedImage(struct grubConfig Line 2517  void markRemovedImage(struct grubConfig
2517   entry->skip = 1;   entry->skip = 1;
2518  }  }
2519    
2520  void setDefaultImage(struct grubConfig *config, int hasNew,  void setDefaultImage(struct grubConfig *config, int isAddingBootEntry,
2521       const char *defaultKernelPath, int newIsDefault,       const char *defaultKernelPath, int newBootEntryIsDefault,
2522       const char *prefix, int flags, int index)       const char *prefix, int flags,
2523  {       int newDefaultBootEntryIndex, int newBootEntryIndex)
2524   struct singleEntry *entry, *entry2, *newDefault;  {
2525   int i, j;   struct singleEntry *bootEntry, *newDefault;
2526     int indexToVerify, firstKernelEntryIndex, currentLookupIndex;
2527   if (newIsDefault) {  
2528   config->defaultImage = 0;          /* initialize */
2529   return;          currentLookupIndex = FIRST_ENTRY_INDEX;
2530   } else if ((index >= 0) && config->cfi->defaultIsIndex) {  
2531   if (findEntryByIndex(config, index))   /* handle the two cases where the user explictly picks the default
2532   config->defaultImage = index;   * boot entry index as it would exist post-modification */
2533   else  
2534   config->defaultImage = -1;   /* Case 1: user chose to make the latest boot entry the default */
2535     if (newBootEntryIsDefault) {
2536     config->defaultImage = newBootEntryIndex;
2537   return;   return;
2538   } else if (defaultKernelPath) {   }
2539   i = 0;  
2540   if (findEntryByPath(config, defaultKernelPath, prefix, &i)) {   /* Case 2: user picked an arbitrary index as the default boot entry */
2541   config->defaultImage = i;   if (newDefaultBootEntryIndex >= FIRST_ENTRY_INDEX
2542   } else {      && config->cfi->defaultIsIndex) {
2543   config->defaultImage = -1;   indexToVerify = newDefaultBootEntryIndex;
2544    
2545     /* user chose to make latest boot entry the default */
2546     if (newDefaultBootEntryIndex == newBootEntryIndex) {
2547     config->defaultImage = newBootEntryIndex;
2548   return;   return;
2549   }   }
  }  
2550    
2551   /* defaultImage now points to what we'd like to use, but before any   /* the user picks the default index based on the
2552   * order changes */   * order of the bootloader configuration after
2553   if ((config->defaultImage == DEFAULT_SAVED) ||   * modification; ensure we are checking for the
2554      (config->defaultImage == DEFAULT_SAVED_GRUB2))   * existence of the correct entry */
2555   /* default is set to saved, we don't want to change it */   if (newBootEntryIndex < newDefaultBootEntryIndex) {
2556     if (!config->isModified)
2557     indexToVerify--;
2558     }
2559    
2560     /* verify the user selected index will exist */
2561     if (findEntryByIndex(config, indexToVerify)) {
2562     config->defaultImage = newDefaultBootEntryIndex;
2563     } else {
2564     config->defaultImage = NO_DEFAULT_ENTRY;
2565     }
2566    
2567   return;   return;
2568     }
2569    
2570   if (config->defaultImage > -1)   /* handle cases where the index value may shift */
  entry = findEntryByIndex(config, config->defaultImage);  
  else  
  entry = NULL;  
2571    
2572   if (entry && !entry->skip) {   /* check validity of existing default or first-entry-found
2573   /* we can preserve the default */     selection */
2574   if (hasNew)   if (defaultKernelPath) {
2575   config->defaultImage++;                  /* we must initialize this */
2576                    firstKernelEntryIndex = 0;
2577     /* user requested first-entry-found */
2578     if (!findEntryByPath(config, defaultKernelPath,
2579         prefix, &firstKernelEntryIndex)) {
2580     /* don't change default if can't find match */
2581     config->defaultImage = NO_DEFAULT_ENTRY;
2582     return;
2583     }
2584    
2585   /* count the number of entries erased before this one */   config->defaultImage = firstKernelEntryIndex;
2586   for (j = 0; j < config->defaultImage; j++) {  
2587   entry2 = findEntryByIndex(config, j);   /* this is where we start looking for decrement later */
2588   if (entry2->skip)   currentLookupIndex = config->defaultImage;
2589   config->defaultImage--;  
2590     if (isAddingBootEntry && !config->isModified &&
2591        (newBootEntryIndex < config->defaultImage)) {
2592     /* increment because new entry added before default */
2593     config->defaultImage++;
2594   }   }
  } else if (hasNew) {  
  config->defaultImage = 0;  
2595   } else {   } else {
2596   /* Either we just erased the default (or the default line was                  /* check to see if the default is stored in the environment */
2597   * bad to begin with) and didn't put a new one in. We'll use                  if (config->defaultImage < FIRST_ENTRY_INDEX) {
2598   * the first valid image. */                      if (config->defaultImage == DEFAULT_SAVED || config->defaultImage == DEFAULT_SAVED_GRUB2)
2599                        {
2600                            if (config->cfi->defaultIsSaved) {
2601                                if (config->cfi->getEnv) {
2602                                    char *defaultTitle = config->cfi->getEnv(config->cfi, "saved_entry");
2603    
2604                                    if (defaultTitle) {
2605                                        if (isnumber(defaultTitle)) {
2606                                            currentLookupIndex = atoi(defaultTitle);
2607                                        } else {
2608                                            findEntryByTitle(config, defaultTitle, &currentLookupIndex);
2609                                        }
2610                                        /* set the default Image to an actual index */
2611                                        config->defaultImage = currentLookupIndex;
2612                                    }
2613                                }
2614                             }
2615                        }
2616                    } else {
2617                            /* use pre-existing default entry from the file*/
2618                            currentLookupIndex = config->defaultImage;
2619                    }
2620    
2621     if (isAddingBootEntry
2622        && (newBootEntryIndex <= config->defaultImage)) {
2623     config->defaultImage++;
2624    
2625     if (config->isModified) {
2626     currentLookupIndex++;
2627     }
2628     }
2629     }
2630    
2631     /* sanity check - is this entry index valid? */
2632     bootEntry = findEntryByIndex(config, currentLookupIndex);
2633    
2634     if ((bootEntry && bootEntry->skip) || !bootEntry) {
2635     /* entry is to be skipped or is invalid */
2636     if (isAddingBootEntry) {
2637     config->defaultImage = newBootEntryIndex;
2638     return;
2639     }
2640   newDefault =   newDefault =
2641      findTemplate(config, prefix, &config->defaultImage, 1,      findTemplate(config, prefix, &config->defaultImage, 1,
2642   flags);   flags);
2643   if (!newDefault)   if (!newDefault) {
2644   config->defaultImage = -1;   config->defaultImage = NO_DEFAULT_ENTRY;
2645     }
2646    
2647     return;
2648     }
2649    
2650     currentLookupIndex--;
2651    
2652     /* decrement index by the total number of entries deleted */
2653    
2654     for (indexToVerify = currentLookupIndex;
2655         indexToVerify >= FIRST_ENTRY_INDEX; indexToVerify--) {
2656    
2657     bootEntry = findEntryByIndex(config, indexToVerify);
2658    
2659     if (bootEntry && bootEntry->skip) {
2660     config->defaultImage--;
2661     }
2662   }   }
2663  }  }
2664    
# Line 4210  int addNewKernel(struct grubConfig *conf Line 4315  int addNewKernel(struct grubConfig *conf
4315   const char *newKernelArgs, const char *newKernelInitrd,   const char *newKernelArgs, const char *newKernelInitrd,
4316   const char **extraInitrds, int extraInitrdCount,   const char **extraInitrds, int extraInitrdCount,
4317   const char *newMBKernel, const char *newMBKernelArgs,   const char *newMBKernel, const char *newMBKernelArgs,
4318   const char *newDevTreePath)   const char *newDevTreePath, int newIndex)
4319  {  {
4320   struct singleEntry *new;   struct singleEntry *new, *entry, *prev = NULL;
4321   struct singleLine *newLine = NULL, *tmplLine = NULL, *masterLine = NULL;   struct singleLine *newLine = NULL, *tmplLine = NULL, *masterLine = NULL;
4322   int needs;   int needs;
4323     char *indexs;
4324   char *chptr;   char *chptr;
4325     int rc;
4326    
4327   if (!newKernelPath)   if (!newKernelPath)
4328   return 0;   return 0;
4329    
4330     rc = asprintf(&indexs, "%d", newIndex);
4331     if (rc < 0)
4332     return 1;
4333    
4334   /* if the newKernelTitle is too long silently munge it into something   /* if the newKernelTitle is too long silently munge it into something
4335   * we can live with. truncating is first check, then we'll just mess with   * we can live with. truncating is first check, then we'll just mess with
4336   * it until it looks better */   * it until it looks better */
# Line 4242  int addNewKernel(struct grubConfig *conf Line 4353  int addNewKernel(struct grubConfig *conf
4353   new = malloc(sizeof(*new));   new = malloc(sizeof(*new));
4354   new->skip = 0;   new->skip = 0;
4355   new->multiboot = 0;   new->multiboot = 0;
  new->next = config->entries;  
4356   new->lines = NULL;   new->lines = NULL;
4357   config->entries = new;   entry = config->entries;
4358     for (unsigned int i = 0; i < newIndex; i++) {
4359     if (!entry)
4360     break;
4361     prev = entry;
4362     entry = entry->next;
4363     }
4364     new->next = entry;
4365    
4366     if (prev)
4367     prev->next = new;
4368     else
4369     config->entries = new;
4370    
4371   /* copy/update from the template */   /* copy/update from the template */
4372   needs = NEED_KERNEL | NEED_TITLE;   needs = NEED_KERNEL | NEED_TITLE;
# Line 4707  int addNewKernel(struct grubConfig *conf Line 4829  int addNewKernel(struct grubConfig *conf
4829   abort();   abort();
4830   }   }
4831    
4832   if (updateImage(config, "0", prefix, newKernelArgs, NULL,   if (updateImage(config, indexs, prefix, newKernelArgs, NULL,
4833   newMBKernelArgs, NULL))   newMBKernelArgs, NULL)) {
4834     config->isModified = 1;
4835   return 1;   return 1;
4836     }
4837    
4838   return 0;   return 0;
4839  }  }
# Line 4737  int main(int argc, const char **argv) Line 4861  int main(int argc, const char **argv)
4861   char *newDevTreePath = NULL;   char *newDevTreePath = NULL;
4862   char *newMBKernel = NULL;   char *newMBKernel = NULL;
4863   char *newMBKernelArgs = NULL;   char *newMBKernelArgs = NULL;
4864     int newIndex = 0;
4865   char *removeMBKernelArgs = NULL;   char *removeMBKernelArgs = NULL;
4866   char *removeMBKernel = NULL;   char *removeMBKernel = NULL;
4867   char *bootPrefix = NULL;   char *bootPrefix = NULL;
# Line 4771  int main(int argc, const char **argv) Line 4896  int main(int argc, const char **argv)
4896   NULL},   NULL},
4897   {"boot-filesystem", 0, POPT_ARG_STRING, &bootPrefix, 0,   {"boot-filesystem", 0, POPT_ARG_STRING, &bootPrefix, 0,
4898   _   _
4899   ("filestystem which contains /boot directory (for testing only)"),   ("filesystem which contains /boot directory (for testing only)"),
4900   _("bootfs")},   _("bootfs")},
4901  #if defined(__i386__) || defined(__x86_64__) || defined (__powerpc64__) || defined (__ia64__)  #if defined(__i386__) || defined(__x86_64__) || defined (__powerpc64__) || defined (__ia64__)
4902   {"bootloader-probe", 0, POPT_ARG_NONE, &bootloaderProbe, 0,   {"bootloader-probe", 0, POPT_ARG_NONE, &bootloaderProbe, 0,
# Line 4843  int main(int argc, const char **argv) Line 4968  int main(int argc, const char **argv)
4968   {"set-default-index", 0, POPT_ARG_INT, &defaultIndex, 0,   {"set-default-index", 0, POPT_ARG_INT, &defaultIndex, 0,
4969   _("make the given entry index the default entry"),   _("make the given entry index the default entry"),
4970   _("entry-index")},   _("entry-index")},
4971     {"set-index", 0, POPT_ARG_INT, &newIndex, 0,
4972     _("use the given index when creating a new entry"),
4973     _("entry-index")},
4974   {"silo", 0, POPT_ARG_NONE, &configureSilo, 0,   {"silo", 0, POPT_ARG_NONE, &configureSilo, 0,
4975   _("configure silo bootloader")},   _("configure silo bootloader")},
4976   {"title", 0, POPT_ARG_STRING, &newKernelTitle, 0,   {"title", 0, POPT_ARG_STRING, &newKernelTitle, 0,
# Line 5157  int main(int argc, const char **argv) Line 5285  int main(int argc, const char **argv)
5285   struct singleEntry *entry;   struct singleEntry *entry;
5286   char *rootspec;   char *rootspec;
5287    
5288   if (config->defaultImage == -1)   if (config->defaultImage == NO_DEFAULT_ENTRY)
5289   return 0;   return 0;
5290   if (config->defaultImage == DEFAULT_SAVED_GRUB2 &&   if (config->defaultImage == DEFAULT_SAVED_GRUB2 &&
5291      cfi->defaultIsSaved)      cfi->defaultIsSaved)
5292   config->defaultImage = 0;   config->defaultImage = FIRST_ENTRY_INDEX;
5293   entry = findEntryByIndex(config, config->defaultImage);   entry = findEntryByIndex(config, config->defaultImage);
5294   if (!entry)   if (!entry)
5295   return 0;   return 0;
# Line 5184  int main(int argc, const char **argv) Line 5312  int main(int argc, const char **argv)
5312   struct singleLine *line;   struct singleLine *line;
5313   struct singleEntry *entry;   struct singleEntry *entry;
5314    
5315   if (config->defaultImage == -1)   if (config->defaultImage == NO_DEFAULT_ENTRY)
5316   return 0;   return 0;
5317   if (config->defaultImage == DEFAULT_SAVED_GRUB2 &&   if (config->defaultImage == DEFAULT_SAVED_GRUB2 &&
5318      cfi->defaultIsSaved)      cfi->defaultIsSaved)
5319   config->defaultImage = 0;   config->defaultImage = FIRST_ENTRY_INDEX;
5320   entry = findEntryByIndex(config, config->defaultImage);   entry = findEntryByIndex(config, config->defaultImage);
5321   if (!entry)   if (!entry)
5322   return 0;   return 0;
# Line 5218  int main(int argc, const char **argv) Line 5346  int main(int argc, const char **argv)
5346   return 0;   return 0;
5347    
5348   } else if (displayDefaultIndex) {   } else if (displayDefaultIndex) {
5349   if (config->defaultImage == -1)   if (config->defaultImage == NO_DEFAULT_ENTRY)
5350   return 0;   return 0;
5351   if (config->defaultImage == DEFAULT_SAVED_GRUB2 &&   if (config->defaultImage == DEFAULT_SAVED_GRUB2 &&
5352      cfi->defaultIsSaved)      cfi->defaultIsSaved)
5353   config->defaultImage = 0;   config->defaultImage = FIRST_ENTRY_INDEX;
5354   printf("%i\n", config->defaultImage);   printf("%i\n", config->defaultImage);
5355   return 0;   return 0;
5356    
# Line 5238  int main(int argc, const char **argv) Line 5366  int main(int argc, const char **argv)
5366   markRemovedImage(config, removeKernelPath, bootPrefix);   markRemovedImage(config, removeKernelPath, bootPrefix);
5367   markRemovedImage(config, removeMBKernel, bootPrefix);   markRemovedImage(config, removeMBKernel, bootPrefix);
5368   setDefaultImage(config, newKernelPath != NULL, defaultKernel,   setDefaultImage(config, newKernelPath != NULL, defaultKernel,
5369   makeDefault, bootPrefix, flags, defaultIndex);   makeDefault, bootPrefix, flags, defaultIndex,
5370     newIndex);
5371   setFallbackImage(config, newKernelPath != NULL);   setFallbackImage(config, newKernelPath != NULL);
5372   if (updateImage(config, updateKernelPath, bootPrefix, newKernelArgs,   if (updateImage(config, updateKernelPath, bootPrefix, newKernelArgs,
5373   removeArgs, newMBKernelArgs, removeMBKernelArgs))   removeArgs, newMBKernelArgs, removeMBKernelArgs))
# Line 5258  int main(int argc, const char **argv) Line 5387  int main(int argc, const char **argv)
5387   if (addNewKernel(config, template, bootPrefix, newKernelPath,   if (addNewKernel(config, template, bootPrefix, newKernelPath,
5388   newKernelTitle, newKernelArgs, newKernelInitrd,   newKernelTitle, newKernelArgs, newKernelInitrd,
5389   (const char **)extraInitrds, extraInitrdCount,   (const char **)extraInitrds, extraInitrdCount,
5390   newMBKernel, newMBKernelArgs, newDevTreePath))   newMBKernel, newMBKernelArgs, newDevTreePath,
5391     newIndex))
5392   return 1;   return 1;
5393    
5394   if (numEntries(config) == 0) {   if (numEntries(config) == 0) {

Legend:
Removed from v.3003  
changed lines
  Added in v.3027