Magellan Linux

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

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

revision 1718 by niro, Sat Feb 18 00:49:41 2012 UTC revision 1720 by niro, Sat Feb 18 00:51:28 2012 UTC
# Line 3160  int main(int argc, const char ** argv) { Line 3160  int main(int argc, const char ** argv) {
3160      struct singleEntry * template = NULL;      struct singleEntry * template = NULL;
3161      int copyDefault = 0, makeDefault = 0;      int copyDefault = 0, makeDefault = 0;
3162      int displayDefault = 0;      int displayDefault = 0;
3163        int displayDefaultIndex = 0;
3164      struct poptOption options[] = {      struct poptOption options[] = {
3165   { "add-kernel", 0, POPT_ARG_STRING, &newKernelPath, 0,   { "add-kernel", 0, POPT_ARG_STRING, &newKernelPath, 0,
3166      _("add an entry for the specified kernel"), _("kernel-path") },      _("add an entry for the specified kernel"), _("kernel-path") },
# Line 3192  int main(int argc, const char ** argv) { Line 3193  int main(int argc, const char ** argv) {
3193        "template"), NULL },        "template"), NULL },
3194   { "default-kernel", 0, 0, &displayDefault, 0,   { "default-kernel", 0, 0, &displayDefault, 0,
3195      _("display the path of the default kernel") },      _("display the path of the default kernel") },
3196     { "default-index", 0, 0, &displayDefaultIndex, 0,
3197        _("display the index of the default kernel") },
3198   { "elilo", 0, POPT_ARG_NONE, &configureELilo, 0,   { "elilo", 0, POPT_ARG_NONE, &configureELilo, 0,
3199      _("configure elilo bootloader") },      _("configure elilo bootloader") },
3200   { "extlinux", 0, POPT_ARG_NONE, &configureExtLinux, 0,   { "extlinux", 0, POPT_ARG_NONE, &configureExtLinux, 0,
# Line 3335  int main(int argc, const char ** argv) { Line 3338  int main(int argc, const char ** argv) {
3338    
3339      if (bootloaderProbe && (displayDefault || kernelInfo || newKernelVersion ||      if (bootloaderProbe && (displayDefault || kernelInfo || newKernelVersion ||
3340    newKernelPath || removeKernelPath || makeDefault ||    newKernelPath || removeKernelPath || makeDefault ||
3341    defaultKernel)) {    defaultKernel || displayDefaultIndex)) {
3342   fprintf(stderr, _("grubby: --bootloader-probe may not be used with "   fprintf(stderr, _("grubby: --bootloader-probe may not be used with "
3343    "specified option"));    "specified option"));
3344   return 1;   return 1;
# Line 3386  int main(int argc, const char ** argv) { Line 3389  int main(int argc, const char ** argv) {
3389    
3390      if (!removeKernelPath && !newKernelPath && !displayDefault && !defaultKernel      if (!removeKernelPath && !newKernelPath && !displayDefault && !defaultKernel
3391   && !kernelInfo && !bootloaderProbe && !updateKernelPath   && !kernelInfo && !bootloaderProbe && !updateKernelPath
3392          && !removeMBKernel) {          && !removeMBKernel && !displayDefaultIndex) {
3393   fprintf(stderr, _("grubby: no action specified\n"));   fprintf(stderr, _("grubby: no action specified\n"));
3394   return 1;   return 1;
3395      }      }
# Line 3481  int main(int argc, const char ** argv) { Line 3484  int main(int argc, const char ** argv) {
3484                 ((rootspec != NULL) ? strlen(rootspec) : 0));                 ((rootspec != NULL) ? strlen(rootspec) : 0));
3485    
3486   return 0;   return 0;
3487    
3488        } else if (displayDefaultIndex) {
3489            if (config->defaultImage == -1) return 0;
3490            printf("%i\n", config->defaultImage);
3491    
3492      } else if (kernelInfo)      } else if (kernelInfo)
3493   return displayInfo(config, kernelInfo, bootPrefix);   return displayInfo(config, kernelInfo, bootPrefix);
3494    

Legend:
Removed from v.1718  
changed lines
  Added in v.1720