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 |
|
|
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; |
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) { |
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 == '"' || |
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", |
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))) { |
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) { |
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; |
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); |
entry = findEntryByIndex(cfg, cfg->defaultImage); |
1716 |
line = getLineByType(LT_MENUENTRY, entry->lines); |
line = getLineByType(LT_MENUENTRY, entry->lines); |
1723 |
"saved_entry", title); |
"saved_entry", title); |
1724 |
} |
} |
1725 |
} |
} |
1726 |
} else if (cfg->defaultImage > -1) { |
} else if (cfg->defaultImage >= FIRST_ENTRY_INDEX) { |
1727 |
if (cfg->cfi->defaultIsIndex) { |
if (cfg->cfi->defaultIsIndex) { |
1728 |
if (cfg->cfi->defaultIsVariable) { |
if (cfg->cfi->defaultIsVariable) { |
1729 |
fprintf(out, "%sset default=\"%d\"\n", indent, |
fprintf(out, "%sset default=\"%d\"\n", indent, |
2427 |
} |
} |
2428 |
} |
} |
2429 |
} |
} |
2430 |
} else if (cfg->defaultImage > -1) { |
} else if (cfg->defaultImage >= FIRST_ENTRY_INDEX) { |
2431 |
entry = findEntryByIndex(cfg, cfg->defaultImage); |
entry = findEntryByIndex(cfg, cfg->defaultImage); |
2432 |
if (entry && suitableImage(entry, prefix, skipRemoved, flags)) { |
if (entry && suitableImage(entry, prefix, skipRemoved, flags)) { |
2433 |
if (indexPtr) |
if (indexPtr) |
2439 |
index = 0; |
index = 0; |
2440 |
while ((entry = findEntryByIndex(cfg, index))) { |
while ((entry = findEntryByIndex(cfg, index))) { |
2441 |
if (suitableImage(entry, prefix, skipRemoved, flags)) { |
if (suitableImage(entry, prefix, skipRemoved, flags)) { |
2442 |
int j; |
int j, unmodifiedIndex; |
2443 |
for (j = 0; j < index; j++) { |
|
2444 |
|
unmodifiedIndex = index; |
2445 |
|
|
2446 |
|
for (j = 0; j < unmodifiedIndex; j++) { |
2447 |
entry2 = findEntryByIndex(cfg, j); |
entry2 = findEntryByIndex(cfg, j); |
2448 |
if (entry2->skip) |
if (entry2->skip) |
2449 |
index--; |
index--; |
2504 |
entry->skip = 1; |
entry->skip = 1; |
2505 |
} |
} |
2506 |
|
|
2507 |
void setDefaultImage(struct grubConfig *config, int hasNew, |
void setDefaultImage(struct grubConfig *config, int isAddingBootEntry, |
2508 |
const char *defaultKernelPath, int newIsDefault, |
const char *defaultKernelPath, int newBootEntryIsDefault, |
2509 |
const char *prefix, int flags, int index) |
const char *prefix, int flags, |
2510 |
{ |
int newDefaultBootEntryIndex, int newBootEntryIndex) |
2511 |
struct singleEntry *entry, *entry2, *newDefault; |
{ |
2512 |
int i, j; |
struct singleEntry *bootEntry, *newDefault; |
2513 |
|
int indexToVerify, firstKernelEntryIndex, currentLookupIndex; |
2514 |
if (newIsDefault) { |
|
2515 |
config->defaultImage = 0; |
/* handle the two cases where the user explictly picks the default |
2516 |
|
* boot entry index as it would exist post-modification */ |
2517 |
|
|
2518 |
|
/* Case 1: user chose to make the latest boot entry the default */ |
2519 |
|
if (newBootEntryIsDefault) { |
2520 |
|
config->defaultImage = newBootEntryIndex; |
2521 |
return; |
return; |
2522 |
} else if ((index >= 0) && config->cfi->defaultIsIndex) { |
} |
2523 |
if (findEntryByIndex(config, index)) |
|
2524 |
config->defaultImage = index; |
/* Case 2: user picked an arbitrary index as the default boot entry */ |
2525 |
else |
if (newDefaultBootEntryIndex >= FIRST_ENTRY_INDEX |
2526 |
config->defaultImage = -1; |
&& config->cfi->defaultIsIndex) { |
2527 |
return; |
indexToVerify = newDefaultBootEntryIndex; |
2528 |
} else if (defaultKernelPath) { |
|
2529 |
i = 0; |
/* user chose to make latest boot entry the default */ |
2530 |
if (findEntryByPath(config, defaultKernelPath, prefix, &i)) { |
if (newDefaultBootEntryIndex == newBootEntryIndex) { |
2531 |
config->defaultImage = i; |
config->defaultImage = newBootEntryIndex; |
|
} else { |
|
|
config->defaultImage = -1; |
|
2532 |
return; |
return; |
2533 |
} |
} |
|
} |
|
2534 |
|
|
2535 |
/* defaultImage now points to what we'd like to use, but before any |
/* the user picks the default index based on the |
2536 |
* order changes */ |
* order of the bootloader configuration after |
2537 |
if ((config->defaultImage == DEFAULT_SAVED) || |
* modification; ensure we are checking for the |
2538 |
(config->defaultImage == DEFAULT_SAVED_GRUB2)) |
* existence of the correct entry */ |
2539 |
/* default is set to saved, we don't want to change it */ |
if (newBootEntryIndex < newDefaultBootEntryIndex) { |
2540 |
|
if (!config->isModified) |
2541 |
|
indexToVerify--; |
2542 |
|
} |
2543 |
|
|
2544 |
|
/* verify the user selected index will exist */ |
2545 |
|
if (findEntryByIndex(config, indexToVerify)) { |
2546 |
|
config->defaultImage = newDefaultBootEntryIndex; |
2547 |
|
} else { |
2548 |
|
config->defaultImage = NO_DEFAULT_ENTRY; |
2549 |
|
} |
2550 |
|
|
2551 |
return; |
return; |
2552 |
|
} |
2553 |
|
|
2554 |
if (config->defaultImage > -1) |
/* handle cases where the index value may shift */ |
|
entry = findEntryByIndex(config, config->defaultImage); |
|
|
else |
|
|
entry = NULL; |
|
2555 |
|
|
2556 |
if (entry && !entry->skip) { |
/* check validity of existing default or first-entry-found |
2557 |
/* we can preserve the default */ |
selection */ |
2558 |
if (hasNew) |
if (defaultKernelPath) { |
2559 |
config->defaultImage++; |
/* user requested first-entry-found */ |
2560 |
|
if (!findEntryByPath(config, defaultKernelPath, |
2561 |
|
prefix, &firstKernelEntryIndex)) { |
2562 |
|
/* don't change default if can't find match */ |
2563 |
|
config->defaultImage = NO_DEFAULT_ENTRY; |
2564 |
|
return; |
2565 |
|
} |
2566 |
|
|
2567 |
/* count the number of entries erased before this one */ |
config->defaultImage = firstKernelEntryIndex; |
2568 |
for (j = 0; j < config->defaultImage; j++) { |
|
2569 |
entry2 = findEntryByIndex(config, j); |
/* this is where we start looking for decrement later */ |
2570 |
if (entry2->skip) |
currentLookupIndex = config->defaultImage; |
2571 |
config->defaultImage--; |
|
2572 |
|
if (isAddingBootEntry && !config->isModified && |
2573 |
|
(newBootEntryIndex < config->defaultImage)) { |
2574 |
|
/* increment because new entry added before default */ |
2575 |
|
config->defaultImage++; |
2576 |
} |
} |
|
} else if (hasNew) { |
|
|
config->defaultImage = 0; |
|
2577 |
} else { |
} else { |
2578 |
/* Either we just erased the default (or the default line was |
/* use pre-existing default entry */ |
2579 |
* bad to begin with) and didn't put a new one in. We'll use |
currentLookupIndex = config->defaultImage; |
2580 |
* the first valid image. */ |
|
2581 |
|
if (isAddingBootEntry |
2582 |
|
&& (newBootEntryIndex <= config->defaultImage)) { |
2583 |
|
config->defaultImage++; |
2584 |
|
|
2585 |
|
if (config->isModified) { |
2586 |
|
currentLookupIndex++; |
2587 |
|
} |
2588 |
|
} |
2589 |
|
} |
2590 |
|
|
2591 |
|
/* sanity check - is this entry index valid? */ |
2592 |
|
bootEntry = findEntryByIndex(config, currentLookupIndex); |
2593 |
|
|
2594 |
|
if ((bootEntry && bootEntry->skip) || !bootEntry) { |
2595 |
|
/* entry is to be skipped or is invalid */ |
2596 |
|
if (isAddingBootEntry) { |
2597 |
|
config->defaultImage = newBootEntryIndex; |
2598 |
|
return; |
2599 |
|
} |
2600 |
newDefault = |
newDefault = |
2601 |
findTemplate(config, prefix, &config->defaultImage, 1, |
findTemplate(config, prefix, &config->defaultImage, 1, |
2602 |
flags); |
flags); |
2603 |
if (!newDefault) |
if (!newDefault) { |
2604 |
config->defaultImage = -1; |
config->defaultImage = NO_DEFAULT_ENTRY; |
2605 |
|
} |
2606 |
|
|
2607 |
|
return; |
2608 |
|
} |
2609 |
|
|
2610 |
|
currentLookupIndex--; |
2611 |
|
|
2612 |
|
/* decrement index by the total number of entries deleted */ |
2613 |
|
|
2614 |
|
for (indexToVerify = currentLookupIndex; |
2615 |
|
indexToVerify >= FIRST_ENTRY_INDEX; indexToVerify--) { |
2616 |
|
|
2617 |
|
bootEntry = findEntryByIndex(config, indexToVerify); |
2618 |
|
|
2619 |
|
if (bootEntry && bootEntry->skip) { |
2620 |
|
config->defaultImage--; |
2621 |
|
} |
2622 |
} |
} |
2623 |
} |
} |
2624 |
|
|
4275 |
const char *newKernelArgs, const char *newKernelInitrd, |
const char *newKernelArgs, const char *newKernelInitrd, |
4276 |
const char **extraInitrds, int extraInitrdCount, |
const char **extraInitrds, int extraInitrdCount, |
4277 |
const char *newMBKernel, const char *newMBKernelArgs, |
const char *newMBKernel, const char *newMBKernelArgs, |
4278 |
const char *newDevTreePath) |
const char *newDevTreePath, int newIndex) |
4279 |
{ |
{ |
4280 |
struct singleEntry *new; |
struct singleEntry *new, *entry, *prev = NULL; |
4281 |
struct singleLine *newLine = NULL, *tmplLine = NULL, *masterLine = NULL; |
struct singleLine *newLine = NULL, *tmplLine = NULL, *masterLine = NULL; |
4282 |
int needs; |
int needs; |
4283 |
|
char *indexs; |
4284 |
char *chptr; |
char *chptr; |
4285 |
|
int rc; |
4286 |
|
|
4287 |
if (!newKernelPath) |
if (!newKernelPath) |
4288 |
return 0; |
return 0; |
4289 |
|
|
4290 |
|
rc = asprintf(&indexs, "%d", newIndex); |
4291 |
|
if (rc < 0) |
4292 |
|
return 1; |
4293 |
|
|
4294 |
/* if the newKernelTitle is too long silently munge it into something |
/* if the newKernelTitle is too long silently munge it into something |
4295 |
* 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 |
4296 |
* it until it looks better */ |
* it until it looks better */ |
4313 |
new = malloc(sizeof(*new)); |
new = malloc(sizeof(*new)); |
4314 |
new->skip = 0; |
new->skip = 0; |
4315 |
new->multiboot = 0; |
new->multiboot = 0; |
|
new->next = config->entries; |
|
4316 |
new->lines = NULL; |
new->lines = NULL; |
4317 |
config->entries = new; |
entry = config->entries; |
4318 |
|
for (unsigned int i = 0; i < newIndex; i++) { |
4319 |
|
if (!entry) |
4320 |
|
break; |
4321 |
|
prev = entry; |
4322 |
|
entry = entry->next; |
4323 |
|
} |
4324 |
|
new->next = entry; |
4325 |
|
|
4326 |
|
if (prev) |
4327 |
|
prev->next = new; |
4328 |
|
else |
4329 |
|
config->entries = new; |
4330 |
|
|
4331 |
/* copy/update from the template */ |
/* copy/update from the template */ |
4332 |
needs = NEED_KERNEL | NEED_TITLE; |
needs = NEED_KERNEL | NEED_TITLE; |
4789 |
abort(); |
abort(); |
4790 |
} |
} |
4791 |
|
|
4792 |
if (updateImage(config, "0", prefix, newKernelArgs, NULL, |
if (updateImage(config, indexs, prefix, newKernelArgs, NULL, |
4793 |
newMBKernelArgs, NULL)) |
newMBKernelArgs, NULL)) { |
4794 |
|
config->isModified = 1; |
4795 |
return 1; |
return 1; |
4796 |
|
} |
4797 |
|
|
4798 |
return 0; |
return 0; |
4799 |
} |
} |
4821 |
char *newDevTreePath = NULL; |
char *newDevTreePath = NULL; |
4822 |
char *newMBKernel = NULL; |
char *newMBKernel = NULL; |
4823 |
char *newMBKernelArgs = NULL; |
char *newMBKernelArgs = NULL; |
4824 |
|
int newIndex = 0; |
4825 |
char *removeMBKernelArgs = NULL; |
char *removeMBKernelArgs = NULL; |
4826 |
char *removeMBKernel = NULL; |
char *removeMBKernel = NULL; |
4827 |
char *bootPrefix = NULL; |
char *bootPrefix = NULL; |
4856 |
NULL}, |
NULL}, |
4857 |
{"boot-filesystem", 0, POPT_ARG_STRING, &bootPrefix, 0, |
{"boot-filesystem", 0, POPT_ARG_STRING, &bootPrefix, 0, |
4858 |
_ |
_ |
4859 |
("filestystem which contains /boot directory (for testing only)"), |
("filesystem which contains /boot directory (for testing only)"), |
4860 |
_("bootfs")}, |
_("bootfs")}, |
4861 |
#if defined(__i386__) || defined(__x86_64__) || defined (__powerpc64__) || defined (__ia64__) |
#if defined(__i386__) || defined(__x86_64__) || defined (__powerpc64__) || defined (__ia64__) |
4862 |
{"bootloader-probe", 0, POPT_ARG_NONE, &bootloaderProbe, 0, |
{"bootloader-probe", 0, POPT_ARG_NONE, &bootloaderProbe, 0, |
4928 |
{"set-default-index", 0, POPT_ARG_INT, &defaultIndex, 0, |
{"set-default-index", 0, POPT_ARG_INT, &defaultIndex, 0, |
4929 |
_("make the given entry index the default entry"), |
_("make the given entry index the default entry"), |
4930 |
_("entry-index")}, |
_("entry-index")}, |
4931 |
|
{"set-index", 0, POPT_ARG_INT, &newIndex, 0, |
4932 |
|
_("use the given index when creating a new entry"), |
4933 |
|
_("entry-index")}, |
4934 |
{"silo", 0, POPT_ARG_NONE, &configureSilo, 0, |
{"silo", 0, POPT_ARG_NONE, &configureSilo, 0, |
4935 |
_("configure silo bootloader")}, |
_("configure silo bootloader")}, |
4936 |
{"title", 0, POPT_ARG_STRING, &newKernelTitle, 0, |
{"title", 0, POPT_ARG_STRING, &newKernelTitle, 0, |
5245 |
struct singleEntry *entry; |
struct singleEntry *entry; |
5246 |
char *rootspec; |
char *rootspec; |
5247 |
|
|
5248 |
if (config->defaultImage == -1) |
if (config->defaultImage == NO_DEFAULT_ENTRY) |
5249 |
return 0; |
return 0; |
5250 |
if (config->defaultImage == DEFAULT_SAVED_GRUB2 && |
if (config->defaultImage == DEFAULT_SAVED_GRUB2 && |
5251 |
cfi->defaultIsSaved) |
cfi->defaultIsSaved) |
5252 |
config->defaultImage = 0; |
config->defaultImage = FIRST_ENTRY_INDEX; |
5253 |
entry = findEntryByIndex(config, config->defaultImage); |
entry = findEntryByIndex(config, config->defaultImage); |
5254 |
if (!entry) |
if (!entry) |
5255 |
return 0; |
return 0; |
5272 |
struct singleLine *line; |
struct singleLine *line; |
5273 |
struct singleEntry *entry; |
struct singleEntry *entry; |
5274 |
|
|
5275 |
if (config->defaultImage == -1) |
if (config->defaultImage == NO_DEFAULT_ENTRY) |
5276 |
return 0; |
return 0; |
5277 |
if (config->defaultImage == DEFAULT_SAVED_GRUB2 && |
if (config->defaultImage == DEFAULT_SAVED_GRUB2 && |
5278 |
cfi->defaultIsSaved) |
cfi->defaultIsSaved) |
5279 |
config->defaultImage = 0; |
config->defaultImage = FIRST_ENTRY_INDEX; |
5280 |
entry = findEntryByIndex(config, config->defaultImage); |
entry = findEntryByIndex(config, config->defaultImage); |
5281 |
if (!entry) |
if (!entry) |
5282 |
return 0; |
return 0; |
5306 |
return 0; |
return 0; |
5307 |
|
|
5308 |
} else if (displayDefaultIndex) { |
} else if (displayDefaultIndex) { |
5309 |
if (config->defaultImage == -1) |
if (config->defaultImage == NO_DEFAULT_ENTRY) |
5310 |
return 0; |
return 0; |
5311 |
if (config->defaultImage == DEFAULT_SAVED_GRUB2 && |
if (config->defaultImage == DEFAULT_SAVED_GRUB2 && |
5312 |
cfi->defaultIsSaved) |
cfi->defaultIsSaved) |
5313 |
config->defaultImage = 0; |
config->defaultImage = FIRST_ENTRY_INDEX; |
5314 |
printf("%i\n", config->defaultImage); |
printf("%i\n", config->defaultImage); |
5315 |
return 0; |
return 0; |
5316 |
|
|
5326 |
markRemovedImage(config, removeKernelPath, bootPrefix); |
markRemovedImage(config, removeKernelPath, bootPrefix); |
5327 |
markRemovedImage(config, removeMBKernel, bootPrefix); |
markRemovedImage(config, removeMBKernel, bootPrefix); |
5328 |
setDefaultImage(config, newKernelPath != NULL, defaultKernel, |
setDefaultImage(config, newKernelPath != NULL, defaultKernel, |
5329 |
makeDefault, bootPrefix, flags, defaultIndex); |
makeDefault, bootPrefix, flags, defaultIndex, |
5330 |
|
newIndex); |
5331 |
setFallbackImage(config, newKernelPath != NULL); |
setFallbackImage(config, newKernelPath != NULL); |
5332 |
if (updateImage(config, updateKernelPath, bootPrefix, newKernelArgs, |
if (updateImage(config, updateKernelPath, bootPrefix, newKernelArgs, |
5333 |
removeArgs, newMBKernelArgs, removeMBKernelArgs)) |
removeArgs, newMBKernelArgs, removeMBKernelArgs)) |
5347 |
if (addNewKernel(config, template, bootPrefix, newKernelPath, |
if (addNewKernel(config, template, bootPrefix, newKernelPath, |
5348 |
newKernelTitle, newKernelArgs, newKernelInitrd, |
newKernelTitle, newKernelArgs, newKernelInitrd, |
5349 |
(const char **)extraInitrds, extraInitrdCount, |
(const char **)extraInitrds, extraInitrdCount, |
5350 |
newMBKernel, newMBKernelArgs, newDevTreePath)) |
newMBKernel, newMBKernelArgs, newDevTreePath, |
5351 |
|
newIndex)) |
5352 |
return 1; |
return 1; |
5353 |
|
|
5354 |
if (numEntries(config) == 0) { |
if (numEntries(config) == 0) { |