Magellan Linux

Diff of /trunk/grubby/grubby.c

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

revision 3010 by niro, Tue Jun 27 14:30:29 2017 UTC revision 3017 by niro, Tue Jun 27 14:36:53 2017 UTC
# Line 2494  void markRemovedImage(struct grubConfig Line 2494  void markRemovedImage(struct grubConfig
2494   entry->skip = 1;   entry->skip = 1;
2495  }  }
2496    
2497  void setDefaultImage(struct grubConfig *config, int hasNew,  void setDefaultImage(struct grubConfig *config, int isUserSpecifiedKernelPath,
2498       const char *defaultKernelPath, int newIsDefault,       const char *defaultKernelPath, int newBootEntryIsDefault,
2499       const char *prefix, int flags, int index)       const char *prefix, int flags, int newDefaultBootEntryIndex)
2500  {  {
2501   struct singleEntry *entry, *entry2, *newDefault;   struct singleEntry *entry, *entry2, *newDefault;
2502   int i, j;   int i, j;
2503    
2504   if (newIsDefault) {   if (newBootEntryIsDefault) {
2505   config->defaultImage = 0;   config->defaultImage = 0;
2506   return;   return;
2507   } else if ((index >= 0) && config->cfi->defaultIsIndex) {   } else if ((newDefaultBootEntryIndex >= 0) && config->cfi->defaultIsIndex) {
2508   if (findEntryByIndex(config, index))   if (findEntryByIndex(config, newDefaultBootEntryIndex))
2509   config->defaultImage = index;   config->defaultImage = newDefaultBootEntryIndex;
2510   else   else
2511   config->defaultImage = -1;   config->defaultImage = -1;
2512   return;   return;
# Line 2534  void setDefaultImage(struct grubConfig * Line 2534  void setDefaultImage(struct grubConfig *
2534    
2535   if (entry && !entry->skip) {   if (entry && !entry->skip) {
2536   /* we can preserve the default */   /* we can preserve the default */
2537   if (hasNew)   if (isUserSpecifiedKernelPath)
2538   config->defaultImage++;   config->defaultImage++;
2539    
2540   /* count the number of entries erased before this one */   /* count the number of entries erased before this one */
# Line 2543  void setDefaultImage(struct grubConfig * Line 2543  void setDefaultImage(struct grubConfig *
2543   if (entry2->skip)   if (entry2->skip)
2544   config->defaultImage--;   config->defaultImage--;
2545   }   }
2546   } else if (hasNew) {   } else if (isUserSpecifiedKernelPath) {
2547   config->defaultImage = 0;   config->defaultImage = 0;
2548   } else {   } else {
2549   /* Either we just erased the default (or the default line was   /* Either we just erased the default (or the default line was
# Line 4789  int main(int argc, const char **argv) Line 4789  int main(int argc, const char **argv)
4789   NULL},   NULL},
4790   {"boot-filesystem", 0, POPT_ARG_STRING, &bootPrefix, 0,   {"boot-filesystem", 0, POPT_ARG_STRING, &bootPrefix, 0,
4791   _   _
4792   ("filestystem which contains /boot directory (for testing only)"),   ("filesystem which contains /boot directory (for testing only)"),
4793   _("bootfs")},   _("bootfs")},
4794  #if defined(__i386__) || defined(__x86_64__) || defined (__powerpc64__) || defined (__ia64__)  #if defined(__i386__) || defined(__x86_64__) || defined (__powerpc64__) || defined (__ia64__)
4795   {"bootloader-probe", 0, POPT_ARG_NONE, &bootloaderProbe, 0,   {"bootloader-probe", 0, POPT_ARG_NONE, &bootloaderProbe, 0,

Legend:
Removed from v.3010  
changed lines
  Added in v.3017