--- trunk/grubby/grubby.c 2017/06/27 14:28:28 3007 +++ trunk/grubby/grubby.c 2017/06/27 14:30:29 3010 @@ -4215,11 +4215,17 @@ struct singleEntry *new, *entry, *prev = NULL; struct singleLine *newLine = NULL, *tmplLine = NULL, *masterLine = NULL; int needs; + char *indexs; char *chptr; + int rc; if (!newKernelPath) return 0; + rc = asprintf(&indexs, "%d", newIndex); + if (rc < 0) + return 1; + /* if the newKernelTitle is too long silently munge it into something * we can live with. truncating is first check, then we'll just mess with * it until it looks better */ @@ -4718,7 +4724,7 @@ abort(); } - if (updateImage(config, "0", prefix, newKernelArgs, NULL, + if (updateImage(config, indexs, prefix, newKernelArgs, NULL, newMBKernelArgs, NULL)) return 1;