68 |
|
|
69 |
char *saved_command_line = NULL; |
char *saved_command_line = NULL; |
70 |
|
|
71 |
|
const char *mounts = "/proc/mounts"; |
72 |
|
|
73 |
/* comments get lumped in with indention */ |
/* comments get lumped in with indention */ |
74 |
struct lineElement { |
struct lineElement { |
75 |
char *item; |
char *item; |
134 |
#define NEED_DEVTREE (1 << 6) |
#define NEED_DEVTREE (1 << 6) |
135 |
|
|
136 |
#define MAIN_DEFAULT (1 << 0) |
#define MAIN_DEFAULT (1 << 0) |
137 |
|
#define FIRST_ENTRY_INDEX 0 /* boot entry index value begin and increment |
138 |
|
from this initial value */ |
139 |
|
#define NO_DEFAULT_ENTRY -1 /* indicates that no specific default boot |
140 |
|
entry was set or currently exists */ |
141 |
#define DEFAULT_SAVED -2 |
#define DEFAULT_SAVED -2 |
142 |
#define DEFAULT_SAVED_GRUB2 -3 |
#define DEFAULT_SAVED_GRUB2 -3 |
143 |
|
|
482 |
snprintf(result, resultMaxSize, "%s", ++current); |
snprintf(result, resultMaxSize, "%s", ++current); |
483 |
|
|
484 |
i++; |
i++; |
485 |
|
int result_len = 0; |
486 |
for (; i < line->numElements; ++i) { |
for (; i < line->numElements; ++i) { |
487 |
current = line->elements[i].item; |
current = line->elements[i].item; |
488 |
current_len = strlen(current); |
current_len = strlen(current); |
489 |
current_indent = line->elements[i].indent; |
current_indent = line->elements[i].indent; |
490 |
current_indent_len = strlen(current_indent); |
current_indent_len = strlen(current_indent); |
491 |
|
|
492 |
strncat(result, current_indent, current_indent_len); |
memcpy(result + result_len, current_indent, current_indent_len); |
493 |
|
result_len += current_indent_len; |
494 |
|
|
495 |
if (current[current_len - 1] != quote_char) { |
if (current[current_len - 1] != quote_char) { |
496 |
strncat(result, current, current_len); |
memcpy(result + result_len, current_indent, |
497 |
|
current_indent_len); |
498 |
|
result_len += current_len; |
499 |
} else { |
} else { |
500 |
strncat(result, current, current_len - 1); |
memcpy(result + result_len, current_indent, |
501 |
|
current_indent_len); |
502 |
|
result_len += (current_len - 1); |
503 |
break; |
break; |
504 |
} |
} |
505 |
} |
} |
506 |
|
result[result_len] = '\0'; |
507 |
return result; |
return result; |
508 |
} |
} |
509 |
|
|
691 |
int fallbackImage; /* just like defaultImage */ |
int fallbackImage; /* just like defaultImage */ |
692 |
int flags; |
int flags; |
693 |
struct configFileInfo *cfi; |
struct configFileInfo *cfi; |
694 |
|
int isModified; /* assumes only one entry added |
695 |
|
per invocation of grubby */ |
696 |
}; |
}; |
697 |
|
|
698 |
blkid_cache blkid; |
blkid_cache blkid; |
711 |
struct configFileInfo *cfi); |
struct configFileInfo *cfi); |
712 |
static int getNextLine(char **bufPtr, struct singleLine *line, |
static int getNextLine(char **bufPtr, struct singleLine *line, |
713 |
struct configFileInfo *cfi); |
struct configFileInfo *cfi); |
714 |
static char *getRootSpecifier(char *str); |
static size_t getRootSpecifier(const char *str); |
715 |
static void requote(struct singleLine *line, struct configFileInfo *cfi); |
static void requote(struct singleLine *line, struct configFileInfo *cfi); |
716 |
static void insertElement(struct singleLine *line, |
static void insertElement(struct singleLine *line, |
717 |
const char *item, int insertHere, |
const char *item, int insertHere, |
1312 |
cfg->theLines = NULL; |
cfg->theLines = NULL; |
1313 |
cfg->entries = NULL; |
cfg->entries = NULL; |
1314 |
cfg->fallbackImage = 0; |
cfg->fallbackImage = 0; |
1315 |
|
cfg->isModified = 0; |
1316 |
|
|
1317 |
/* copy everything we have */ |
/* copy everything we have */ |
1318 |
while (*head) { |
while (*head) { |
1448 |
extras = malloc(len + 1); |
extras = malloc(len + 1); |
1449 |
*extras = '\0'; |
*extras = '\0'; |
1450 |
|
|
1451 |
|
int buf_len = 0; |
1452 |
/* get title. */ |
/* get title. */ |
1453 |
for (int i = 0; i < line->numElements; i++) { |
for (int i = 0; i < line->numElements; i++) { |
1454 |
if (!strcmp |
if (!strcmp |
1465 |
|
|
1466 |
len = strlen(title); |
len = strlen(title); |
1467 |
if (title[len - 1] == quote_char) { |
if (title[len - 1] == quote_char) { |
1468 |
strncat(buf, title, len - 1); |
memcpy(buf + buf_len, title, len - 1); |
1469 |
|
buf_len += (len - 1); |
1470 |
break; |
break; |
1471 |
} else { |
} else { |
1472 |
strcat(buf, title); |
memcpy(buf + buf_len, title, len); |
1473 |
strcat(buf, line->elements[i].indent); |
buf_len += len; |
1474 |
|
len = strlen(line->elements[i].indent); |
1475 |
|
memcpy(buf + buf_len, line->elements[i].indent, len); |
1476 |
|
buf_len += len; |
1477 |
} |
} |
1478 |
} |
} |
1479 |
|
buf[buf_len] = '\0'; |
1480 |
|
|
1481 |
/* get extras */ |
/* get extras */ |
1482 |
int count = 0; |
int count = 0; |
1638 |
*end == ' ' || *end == '\t')) |
*end == ' ' || *end == '\t')) |
1639 |
end++; |
end++; |
1640 |
if (*end) |
if (*end) |
1641 |
cfg->defaultImage = -1; |
cfg->defaultImage = NO_DEFAULT_ENTRY; |
1642 |
} else if (defaultLine->numElements == 3) { |
} else if (defaultLine->numElements == 3) { |
1643 |
char *value = defaultLine->elements[2].item; |
char *value = defaultLine->elements[2].item; |
1644 |
while (*value && (*value == '"' || |
while (*value && (*value == '"' || |
1651 |
*end == ' ' || *end == '\t')) |
*end == ' ' || *end == '\t')) |
1652 |
end++; |
end++; |
1653 |
if (*end) |
if (*end) |
1654 |
cfg->defaultImage = -1; |
cfg->defaultImage = NO_DEFAULT_ENTRY; |
1655 |
} |
} |
1656 |
} else if (cfi->defaultSupportSaved && |
} else if (cfi->defaultSupportSaved && |
1657 |
!strncmp(defaultLine->elements[1].item, "saved", |
!strncmp(defaultLine->elements[1].item, "saved", |
1661 |
cfg->defaultImage = |
cfg->defaultImage = |
1662 |
strtol(defaultLine->elements[1].item, &end, 10); |
strtol(defaultLine->elements[1].item, &end, 10); |
1663 |
if (*end) |
if (*end) |
1664 |
cfg->defaultImage = -1; |
cfg->defaultImage = NO_DEFAULT_ENTRY; |
1665 |
} else if (defaultLine->numElements >= 2) { |
} else if (defaultLine->numElements >= 2) { |
1666 |
int i = 0; |
int i = 0; |
1667 |
while ((entry = findEntryByIndex(cfg, i))) { |
while ((entry = findEntryByIndex(cfg, i))) { |
1689 |
if (entry) { |
if (entry) { |
1690 |
cfg->defaultImage = i; |
cfg->defaultImage = i; |
1691 |
} else { |
} else { |
1692 |
cfg->defaultImage = -1; |
cfg->defaultImage = NO_DEFAULT_ENTRY; |
1693 |
} |
} |
1694 |
} |
} |
1695 |
} else if (cfg->cfi->defaultIsSaved && cfg->cfi->getEnv) { |
} else if (cfg->cfi->defaultIsSaved && cfg->cfi->getEnv) { |
1706 |
cfg->defaultImage = index; |
cfg->defaultImage = index; |
1707 |
} |
} |
1708 |
} else { |
} else { |
1709 |
cfg->defaultImage = 0; |
cfg->defaultImage = FIRST_ENTRY_INDEX; |
1710 |
} |
} |
1711 |
|
|
1712 |
return cfg; |
return cfg; |
1726 |
fprintf(out, "%sdefault%ssaved\n", indent, separator); |
fprintf(out, "%sdefault%ssaved\n", indent, separator); |
1727 |
else if (cfg->cfi->defaultIsSaved) { |
else if (cfg->cfi->defaultIsSaved) { |
1728 |
fprintf(out, "%sset default=\"${saved_entry}\"\n", indent); |
fprintf(out, "%sset default=\"${saved_entry}\"\n", indent); |
1729 |
if (cfg->defaultImage >= 0 && cfg->cfi->setEnv) { |
if (cfg->defaultImage >= FIRST_ENTRY_INDEX && cfg->cfi->setEnv) { |
1730 |
char *title; |
char *title; |
1731 |
entry = findEntryByIndex(cfg, cfg->defaultImage); |
int trueIndex, currentIndex; |
1732 |
|
|
1733 |
|
trueIndex = 0; |
1734 |
|
currentIndex = 0; |
1735 |
|
|
1736 |
|
while ((entry = findEntryByIndex(cfg, currentIndex))) { |
1737 |
|
if (!entry->skip) { |
1738 |
|
if (trueIndex == cfg->defaultImage) { |
1739 |
|
break; |
1740 |
|
} |
1741 |
|
trueIndex++; |
1742 |
|
} |
1743 |
|
currentIndex++; |
1744 |
|
} |
1745 |
line = getLineByType(LT_MENUENTRY, entry->lines); |
line = getLineByType(LT_MENUENTRY, entry->lines); |
1746 |
if (!line) |
if (!line) |
1747 |
line = getLineByType(LT_TITLE, entry->lines); |
line = getLineByType(LT_TITLE, entry->lines); |
1752 |
"saved_entry", title); |
"saved_entry", title); |
1753 |
} |
} |
1754 |
} |
} |
1755 |
} else if (cfg->defaultImage > -1) { |
} else if (cfg->defaultImage >= FIRST_ENTRY_INDEX) { |
1756 |
if (cfg->cfi->defaultIsIndex) { |
if (cfg->cfi->defaultIsIndex) { |
1757 |
if (cfg->cfi->defaultIsVariable) { |
if (cfg->cfi->defaultIsVariable) { |
1758 |
fprintf(out, "%sset default=\"%d\"\n", indent, |
fprintf(out, "%sset default=\"%d\"\n", indent, |
1808 |
int needs = MAIN_DEFAULT; |
int needs = MAIN_DEFAULT; |
1809 |
struct stat sb; |
struct stat sb; |
1810 |
int i; |
int i; |
1811 |
|
int rc = 0; |
1812 |
|
|
1813 |
if (!strcmp(outName, "-")) { |
if (!strcmp(outName, "-")) { |
1814 |
out = stdout; |
out = stdout; |
1923 |
} |
} |
1924 |
|
|
1925 |
if (tmpOutName) { |
if (tmpOutName) { |
1926 |
if (rename(tmpOutName, outName)) { |
/* write userspace buffers */ |
1927 |
fprintf(stderr, |
if (fflush(out)) |
1928 |
_("grubby: error moving %s to %s: %s\n"), |
rc = 1; |
1929 |
tmpOutName, outName, strerror(errno)); |
|
1930 |
unlink(outName); |
/* purge the write-back cache with fsync() */ |
1931 |
return 1; |
if (fsync(fileno(out))) |
1932 |
|
rc = 1; |
1933 |
|
|
1934 |
|
if (fclose(out)) |
1935 |
|
rc = 1; |
1936 |
|
|
1937 |
|
if (rc == 0 && rename(tmpOutName, outName)) { |
1938 |
|
unlink(tmpOutName); |
1939 |
|
rc = 1; |
1940 |
|
} |
1941 |
|
|
1942 |
|
/* fsync() the destination directory after rename */ |
1943 |
|
if (rc == 0) { |
1944 |
|
int dirfd; |
1945 |
|
|
1946 |
|
dirfd = open(dirname(strdupa(outName)), O_RDONLY); |
1947 |
|
if (dirfd < 0) |
1948 |
|
rc = 1; |
1949 |
|
else if (fsync(dirfd)) |
1950 |
|
rc = 1; |
1951 |
|
|
1952 |
|
if (dirfd >= 0) |
1953 |
|
close(dirfd); |
1954 |
} |
} |
1955 |
|
|
1956 |
|
if (rc == 1) |
1957 |
|
fprintf(stderr, |
1958 |
|
_("grubby: error flushing data: %m\n")); |
1959 |
} |
} |
1960 |
|
|
1961 |
return 0; |
return rc; |
1962 |
} |
} |
1963 |
|
|
1964 |
static int numEntries(struct grubConfig *cfg) |
static int numEntries(struct grubConfig *cfg) |
2134 |
return s[slen] == c; |
return s[slen] == c; |
2135 |
} |
} |
2136 |
|
|
2137 |
|
typedef struct { |
2138 |
|
const char *start; |
2139 |
|
size_t chars; |
2140 |
|
} field; |
2141 |
|
|
2142 |
|
static int iscomma(int c) |
2143 |
|
{ |
2144 |
|
return c == ','; |
2145 |
|
} |
2146 |
|
|
2147 |
|
static int isequal(int c) |
2148 |
|
{ |
2149 |
|
return c == '='; |
2150 |
|
} |
2151 |
|
|
2152 |
|
static field findField(const field *in, typeof(isspace) *isdelim, field *out) |
2153 |
|
{ |
2154 |
|
field nxt = {}; |
2155 |
|
size_t off = 0; |
2156 |
|
|
2157 |
|
while (off < in->chars && isdelim(in->start[off])) |
2158 |
|
off++; |
2159 |
|
|
2160 |
|
if (off == in->chars) |
2161 |
|
return nxt; |
2162 |
|
|
2163 |
|
out->start = &in->start[off]; |
2164 |
|
out->chars = 0; |
2165 |
|
|
2166 |
|
while (off + out->chars < in->chars && !isdelim(out->start[out->chars])) |
2167 |
|
out->chars++; |
2168 |
|
|
2169 |
|
nxt.start = out->start + out->chars; |
2170 |
|
nxt.chars = in->chars - off - out->chars; |
2171 |
|
return nxt; |
2172 |
|
} |
2173 |
|
|
2174 |
|
static int fieldEquals(const field *in, const char *str) |
2175 |
|
{ |
2176 |
|
return in->chars == strlen(str) && |
2177 |
|
strncmp(in->start, str, in->chars) == 0; |
2178 |
|
} |
2179 |
|
|
2180 |
|
/* Parse /proc/mounts to determine the subvolume prefix. */ |
2181 |
|
static size_t subvolPrefix(const char *str) |
2182 |
|
{ |
2183 |
|
FILE *file = NULL; |
2184 |
|
char *line = NULL; |
2185 |
|
size_t prfx = 0; |
2186 |
|
size_t size = 0; |
2187 |
|
|
2188 |
|
file = fopen(mounts, "r"); |
2189 |
|
if (!file) |
2190 |
|
return 0; |
2191 |
|
|
2192 |
|
for (ssize_t s; (s = getline(&line, &size, file)) >= 0; ) { |
2193 |
|
field nxt = { line, s }; |
2194 |
|
field dev = {}; |
2195 |
|
field path = {}; |
2196 |
|
field type = {}; |
2197 |
|
field opts = {}; |
2198 |
|
field opt = {}; |
2199 |
|
|
2200 |
|
nxt = findField(&nxt, isspace, &dev); |
2201 |
|
if (!nxt.start) |
2202 |
|
continue; |
2203 |
|
|
2204 |
|
nxt = findField(&nxt, isspace, &path); |
2205 |
|
if (!nxt.start) |
2206 |
|
continue; |
2207 |
|
|
2208 |
|
nxt = findField(&nxt, isspace, &type); |
2209 |
|
if (!nxt.start) |
2210 |
|
continue; |
2211 |
|
|
2212 |
|
nxt = findField(&nxt, isspace, &opts); |
2213 |
|
if (!nxt.start) |
2214 |
|
continue; |
2215 |
|
|
2216 |
|
if (!fieldEquals(&type, "btrfs")) |
2217 |
|
continue; |
2218 |
|
|
2219 |
|
/* We have found a btrfs mount point. */ |
2220 |
|
|
2221 |
|
nxt = opts; |
2222 |
|
while ((nxt = findField(&nxt, iscomma, &opt)).start) { |
2223 |
|
field key = {}; |
2224 |
|
field val = {}; |
2225 |
|
|
2226 |
|
opt = findField(&opt, isequal, &key); |
2227 |
|
if (!opt.start) |
2228 |
|
continue; |
2229 |
|
|
2230 |
|
opt = findField(&opt, isequal, &val); |
2231 |
|
if (!opt.start) |
2232 |
|
continue; |
2233 |
|
|
2234 |
|
if (!fieldEquals(&key, "subvol")) |
2235 |
|
continue; |
2236 |
|
|
2237 |
|
/* We have found a btrfs subvolume mount point. */ |
2238 |
|
|
2239 |
|
if (strncmp(val.start, str, val.chars)) |
2240 |
|
continue; |
2241 |
|
|
2242 |
|
if (val.start[val.chars - 1] != '/' && |
2243 |
|
str[val.chars] != '/') |
2244 |
|
continue; |
2245 |
|
|
2246 |
|
/* The subvolume mount point matches our input. */ |
2247 |
|
|
2248 |
|
if (prfx < val.chars) |
2249 |
|
prfx = val.chars; |
2250 |
|
} |
2251 |
|
} |
2252 |
|
|
2253 |
|
dbgPrintf("%s(): str: '%s', prfx: '%s'\n", __FUNCTION__, str, prfx); |
2254 |
|
|
2255 |
|
fclose(file); |
2256 |
|
free(line); |
2257 |
|
return prfx; |
2258 |
|
} |
2259 |
|
|
2260 |
int suitableImage(struct singleEntry *entry, const char *bootPrefix, |
int suitableImage(struct singleEntry *entry, const char *bootPrefix, |
2261 |
int skipRemoved, int flags) |
int skipRemoved, int flags) |
2262 |
{ |
{ |
2264 |
char *fullName; |
char *fullName; |
2265 |
int i; |
int i; |
2266 |
char *dev; |
char *dev; |
2267 |
char *rootspec; |
size_t rs; |
2268 |
char *rootdev; |
char *rootdev; |
2269 |
|
|
2270 |
if (skipRemoved && entry->skip) { |
if (skipRemoved && entry->skip) { |
2292 |
|
|
2293 |
fullName = alloca(strlen(bootPrefix) + |
fullName = alloca(strlen(bootPrefix) + |
2294 |
strlen(line->elements[1].item) + 1); |
strlen(line->elements[1].item) + 1); |
2295 |
rootspec = getRootSpecifier(line->elements[1].item); |
rs = getRootSpecifier(line->elements[1].item); |
|
int rootspec_offset = rootspec ? strlen(rootspec) : 0; |
|
2296 |
int hasslash = endswith(bootPrefix, '/') || |
int hasslash = endswith(bootPrefix, '/') || |
2297 |
beginswith(line->elements[1].item + rootspec_offset, '/'); |
beginswith(line->elements[1].item + rs, '/'); |
2298 |
sprintf(fullName, "%s%s%s", bootPrefix, hasslash ? "" : "/", |
sprintf(fullName, "%s%s%s", bootPrefix, hasslash ? "" : "/", |
2299 |
line->elements[1].item + rootspec_offset); |
line->elements[1].item + rs); |
2300 |
if (access(fullName, R_OK)) { |
if (access(fullName, R_OK)) { |
2301 |
notSuitablePrintf(entry, 0, "access to %s failed\n", fullName); |
notSuitablePrintf(entry, 0, "access to %s failed\n", fullName); |
2302 |
return 0; |
return 0; |
2388 |
struct singleLine *line; |
struct singleLine *line; |
2389 |
int i; |
int i; |
2390 |
char *chptr; |
char *chptr; |
|
char *rootspec = NULL; |
|
2391 |
enum lineType_e checkType = LT_KERNEL; |
enum lineType_e checkType = LT_KERNEL; |
2392 |
|
|
2393 |
if (isdigit(*kernel)) { |
if (isdigit(*kernel)) { |
2492 |
|
|
2493 |
if (line && line->type != LT_MENUENTRY && |
if (line && line->type != LT_MENUENTRY && |
2494 |
line->numElements >= 2) { |
line->numElements >= 2) { |
2495 |
rootspec = |
if (!strcmp(line->elements[1].item + |
2496 |
getRootSpecifier(line->elements[1]. |
getRootSpecifier( |
2497 |
item); |
line->elements[1].item), |
2498 |
if (!strcmp |
kernel + strlen(prefix))) |
|
(line->elements[1].item + |
|
|
((rootspec != |
|
|
NULL) ? strlen(rootspec) : 0), |
|
|
kernel + strlen(prefix))) |
|
2499 |
break; |
break; |
2500 |
} |
} |
2501 |
if (line->type == LT_MENUENTRY && |
if (line->type == LT_MENUENTRY && |
2600 |
} |
} |
2601 |
} |
} |
2602 |
} |
} |
2603 |
} else if (cfg->defaultImage > -1) { |
} else if (cfg->defaultImage >= FIRST_ENTRY_INDEX) { |
2604 |
entry = findEntryByIndex(cfg, cfg->defaultImage); |
entry = findEntryByIndex(cfg, cfg->defaultImage); |
2605 |
if (entry && suitableImage(entry, prefix, skipRemoved, flags)) { |
if (entry && suitableImage(entry, prefix, skipRemoved, flags)) { |
2606 |
if (indexPtr) |
if (indexPtr) |
2612 |
index = 0; |
index = 0; |
2613 |
while ((entry = findEntryByIndex(cfg, index))) { |
while ((entry = findEntryByIndex(cfg, index))) { |
2614 |
if (suitableImage(entry, prefix, skipRemoved, flags)) { |
if (suitableImage(entry, prefix, skipRemoved, flags)) { |
2615 |
int j; |
int j, unmodifiedIndex; |
2616 |
for (j = 0; j < index; j++) { |
|
2617 |
|
unmodifiedIndex = index; |
2618 |
|
|
2619 |
|
for (j = 0; j < unmodifiedIndex; j++) { |
2620 |
entry2 = findEntryByIndex(cfg, j); |
entry2 = findEntryByIndex(cfg, j); |
2621 |
if (entry2->skip) |
if (entry2->skip) |
2622 |
index--; |
index--; |
2677 |
entry->skip = 1; |
entry->skip = 1; |
2678 |
} |
} |
2679 |
|
|
2680 |
void setDefaultImage(struct grubConfig *config, int isUserSpecifiedKernelPath, |
void setDefaultImage(struct grubConfig *config, int isAddingBootEntry, |
2681 |
const char *defaultKernelPath, int newBootEntryIsDefault, |
const char *defaultKernelPath, int newBootEntryIsDefault, |
2682 |
const char *prefix, int flags, int newDefaultBootEntryIndex) |
const char *prefix, int flags, |
2683 |
|
int newDefaultBootEntryIndex, int newBootEntryIndex) |
2684 |
{ |
{ |
2685 |
struct singleEntry *entry, *entry2, *newDefault; |
struct singleEntry *bootEntry, *newDefault; |
2686 |
int i, j; |
int indexToVerify, firstKernelEntryIndex, currentLookupIndex; |
2687 |
|
|
2688 |
|
/* initialize */ |
2689 |
|
currentLookupIndex = FIRST_ENTRY_INDEX; |
2690 |
|
|
2691 |
|
/* handle the two cases where the user explictly picks the default |
2692 |
|
* boot entry index as it would exist post-modification */ |
2693 |
|
|
2694 |
|
/* Case 1: user chose to make the latest boot entry the default */ |
2695 |
if (newBootEntryIsDefault) { |
if (newBootEntryIsDefault) { |
2696 |
config->defaultImage = 0; |
config->defaultImage = newBootEntryIndex; |
2697 |
return; |
return; |
2698 |
} else if ((newDefaultBootEntryIndex >= 0) && config->cfi->defaultIsIndex) { |
} |
2699 |
if (findEntryByIndex(config, newDefaultBootEntryIndex)) |
|
2700 |
|
/* Case 2: user picked an arbitrary index as the default boot entry */ |
2701 |
|
if (newDefaultBootEntryIndex >= FIRST_ENTRY_INDEX) { |
2702 |
|
indexToVerify = newDefaultBootEntryIndex; |
2703 |
|
|
2704 |
|
/* user chose to make latest boot entry the default */ |
2705 |
|
if (newDefaultBootEntryIndex == newBootEntryIndex) { |
2706 |
|
config->defaultImage = newBootEntryIndex; |
2707 |
|
return; |
2708 |
|
} |
2709 |
|
|
2710 |
|
/* the user picks the default index based on the |
2711 |
|
* order of the bootloader configuration after |
2712 |
|
* modification; ensure we are checking for the |
2713 |
|
* existence of the correct entry */ |
2714 |
|
if (newBootEntryIndex < newDefaultBootEntryIndex) { |
2715 |
|
if (!config->isModified) |
2716 |
|
indexToVerify--; |
2717 |
|
} |
2718 |
|
|
2719 |
|
/* verify the user selected index will exist */ |
2720 |
|
if (findEntryByIndex(config, indexToVerify)) { |
2721 |
config->defaultImage = newDefaultBootEntryIndex; |
config->defaultImage = newDefaultBootEntryIndex; |
|
else |
|
|
config->defaultImage = -1; |
|
|
return; |
|
|
} else if (defaultKernelPath) { |
|
|
i = 0; |
|
|
if (findEntryByPath(config, defaultKernelPath, prefix, &i)) { |
|
|
config->defaultImage = i; |
|
2722 |
} else { |
} else { |
2723 |
config->defaultImage = -1; |
config->defaultImage = NO_DEFAULT_ENTRY; |
|
return; |
|
2724 |
} |
} |
|
} |
|
2725 |
|
|
|
/* defaultImage now points to what we'd like to use, but before any |
|
|
* order changes */ |
|
|
if ((config->defaultImage == DEFAULT_SAVED) || |
|
|
(config->defaultImage == DEFAULT_SAVED_GRUB2)) |
|
|
/* default is set to saved, we don't want to change it */ |
|
2726 |
return; |
return; |
2727 |
|
} |
2728 |
|
|
2729 |
if (config->defaultImage > -1) |
/* handle cases where the index value may shift */ |
|
entry = findEntryByIndex(config, config->defaultImage); |
|
|
else |
|
|
entry = NULL; |
|
2730 |
|
|
2731 |
if (entry && !entry->skip) { |
/* check validity of existing default or first-entry-found |
2732 |
/* we can preserve the default */ |
selection */ |
2733 |
if (isUserSpecifiedKernelPath) |
if (defaultKernelPath) { |
2734 |
config->defaultImage++; |
/* we must initialize this */ |
2735 |
|
firstKernelEntryIndex = 0; |
2736 |
|
/* user requested first-entry-found */ |
2737 |
|
if (!findEntryByPath(config, defaultKernelPath, |
2738 |
|
prefix, &firstKernelEntryIndex)) { |
2739 |
|
/* don't change default if can't find match */ |
2740 |
|
config->defaultImage = NO_DEFAULT_ENTRY; |
2741 |
|
return; |
2742 |
|
} |
2743 |
|
|
2744 |
|
config->defaultImage = firstKernelEntryIndex; |
2745 |
|
|
2746 |
/* count the number of entries erased before this one */ |
/* this is where we start looking for decrement later */ |
2747 |
for (j = 0; j < config->defaultImage; j++) { |
currentLookupIndex = config->defaultImage; |
2748 |
entry2 = findEntryByIndex(config, j); |
|
2749 |
if (entry2->skip) |
if (isAddingBootEntry && !config->isModified && |
2750 |
config->defaultImage--; |
(newBootEntryIndex < config->defaultImage)) { |
2751 |
|
/* increment because new entry added before default */ |
2752 |
|
config->defaultImage++; |
2753 |
} |
} |
|
} else if (isUserSpecifiedKernelPath) { |
|
|
config->defaultImage = 0; |
|
2754 |
} else { |
} else { |
2755 |
/* Either we just erased the default (or the default line was |
/* check to see if the default is stored in the environment */ |
2756 |
* bad to begin with) and didn't put a new one in. We'll use |
if (config->defaultImage < FIRST_ENTRY_INDEX) { |
2757 |
* the first valid image. */ |
if (config->defaultImage == DEFAULT_SAVED || config->defaultImage == DEFAULT_SAVED_GRUB2) |
2758 |
|
{ |
2759 |
|
if (config->cfi->defaultIsSaved) { |
2760 |
|
if (config->cfi->getEnv) { |
2761 |
|
char *defaultTitle = config->cfi->getEnv(config->cfi, "saved_entry"); |
2762 |
|
|
2763 |
|
if (defaultTitle) { |
2764 |
|
if (isnumber(defaultTitle)) { |
2765 |
|
currentLookupIndex = atoi(defaultTitle); |
2766 |
|
} else { |
2767 |
|
findEntryByTitle(config, defaultTitle, ¤tLookupIndex); |
2768 |
|
} |
2769 |
|
/* set the default Image to an actual index */ |
2770 |
|
config->defaultImage = currentLookupIndex; |
2771 |
|
} |
2772 |
|
} |
2773 |
|
} |
2774 |
|
} |
2775 |
|
} else { |
2776 |
|
/* use pre-existing default entry from the file*/ |
2777 |
|
currentLookupIndex = config->defaultImage; |
2778 |
|
} |
2779 |
|
|
2780 |
|
if (isAddingBootEntry |
2781 |
|
&& (newBootEntryIndex <= config->defaultImage)) { |
2782 |
|
config->defaultImage++; |
2783 |
|
|
2784 |
|
if (config->isModified) { |
2785 |
|
currentLookupIndex++; |
2786 |
|
} |
2787 |
|
} |
2788 |
|
} |
2789 |
|
|
2790 |
|
/* sanity check - is this entry index valid? */ |
2791 |
|
bootEntry = findEntryByIndex(config, currentLookupIndex); |
2792 |
|
|
2793 |
|
if ((bootEntry && bootEntry->skip) || !bootEntry) { |
2794 |
|
/* entry is to be skipped or is invalid */ |
2795 |
|
if (isAddingBootEntry) { |
2796 |
|
config->defaultImage = newBootEntryIndex; |
2797 |
|
return; |
2798 |
|
} |
2799 |
newDefault = |
newDefault = |
2800 |
findTemplate(config, prefix, &config->defaultImage, 1, |
findTemplate(config, prefix, &config->defaultImage, 1, |
2801 |
flags); |
flags); |
2802 |
if (!newDefault) |
if (!newDefault) { |
2803 |
config->defaultImage = -1; |
config->defaultImage = NO_DEFAULT_ENTRY; |
2804 |
|
} |
2805 |
|
|
2806 |
|
return; |
2807 |
|
} |
2808 |
|
|
2809 |
|
currentLookupIndex--; |
2810 |
|
|
2811 |
|
/* decrement index by the total number of entries deleted */ |
2812 |
|
|
2813 |
|
for (indexToVerify = currentLookupIndex; |
2814 |
|
indexToVerify >= FIRST_ENTRY_INDEX; indexToVerify--) { |
2815 |
|
|
2816 |
|
bootEntry = findEntryByIndex(config, indexToVerify); |
2817 |
|
|
2818 |
|
if (bootEntry && bootEntry->skip) { |
2819 |
|
config->defaultImage--; |
2820 |
|
} |
2821 |
} |
} |
2822 |
} |
} |
2823 |
|
|
2846 |
} |
} |
2847 |
} |
} |
2848 |
|
|
2849 |
void displayEntry(struct singleEntry *entry, const char *prefix, int index) |
void displayEntry(struct grubConfig *config, struct singleEntry *entry, const char *prefix, int index) |
2850 |
{ |
{ |
2851 |
struct singleLine *line; |
struct singleLine *line; |
2852 |
char *root = NULL; |
char *root = NULL; |
2942 |
|
|
2943 |
line = getLineByType(LT_TITLE, entry->lines); |
line = getLineByType(LT_TITLE, entry->lines); |
2944 |
if (line) { |
if (line) { |
2945 |
printf("title=%s\n", line->elements[1].item); |
char *entryTitle; |
2946 |
|
/* if we can extractTitle, then it's a zipl config and |
2947 |
|
* if not then we go ahead with what's existed prior */ |
2948 |
|
entryTitle = extractTitle(config, line); |
2949 |
|
if (!entryTitle) { |
2950 |
|
entryTitle=line->elements[1].item; |
2951 |
|
} |
2952 |
|
printf("title=%s\n", entryTitle); |
2953 |
} else { |
} else { |
2954 |
char *title; |
char *title; |
2955 |
line = getLineByType(LT_MENUENTRY, entry->lines); |
line = getLineByType(LT_MENUENTRY, entry->lines); |
3365 |
printf("lba\n"); |
printf("lba\n"); |
3366 |
} |
} |
3367 |
|
|
3368 |
displayEntry(entry, prefix, i); |
displayEntry(config, entry, prefix, i); |
3369 |
|
|
3370 |
i++; |
i++; |
3371 |
while ((entry = findEntryByPath(config, kernel, prefix, &i))) { |
while ((entry = findEntryByPath(config, kernel, prefix, &i))) { |
3372 |
displayEntry(entry, prefix, i); |
displayEntry(config, entry, prefix, i); |
3373 |
i++; |
i++; |
3374 |
} |
} |
3375 |
|
|
3404 |
type & (LT_HYPER | LT_KERNEL | LT_MBMODULE | LT_INITRD | |
type & (LT_HYPER | LT_KERNEL | LT_MBMODULE | LT_INITRD | |
3405 |
LT_KERNEL_EFI | LT_INITRD_EFI | LT_KERNEL_16 | |
LT_KERNEL_EFI | LT_INITRD_EFI | LT_KERNEL_16 | |
3406 |
LT_INITRD_16)) { |
LT_INITRD_16)) { |
3407 |
char *rootspec = |
const char *prfx = tmplLine->elements[1].item; |
3408 |
getRootSpecifier(tmplLine->elements[1].item); |
size_t rs = getRootSpecifier(prfx); |
3409 |
if (rootspec != NULL) { |
if (isinitrd(tmplLine->type)) { |
3410 |
|
for (struct singleLine *l = entry->lines; |
3411 |
|
rs == 0 && l; l = l->next) { |
3412 |
|
if (iskernel(l->type)) { |
3413 |
|
prfx = l->elements[1].item; |
3414 |
|
rs = getRootSpecifier(prfx); |
3415 |
|
break; |
3416 |
|
} |
3417 |
|
} |
3418 |
|
} |
3419 |
|
if (rs > 0) { |
3420 |
free(newLine->elements[1].item); |
free(newLine->elements[1].item); |
3421 |
newLine->elements[1].item = |
newLine->elements[1].item = sdupprintf( |
3422 |
sdupprintf("%s%s", rootspec, val); |
"%.*s%s", (int) rs, prfx, val); |
3423 |
} |
} |
3424 |
} |
} |
3425 |
} |
} |
3709 |
line->numElements--; |
line->numElements--; |
3710 |
} |
} |
3711 |
|
|
3712 |
int argMatch(const char *one, const char *two) |
static int argNameMatch(const char *one, const char *two) |
3713 |
{ |
{ |
3714 |
char *first, *second; |
char *first, *second; |
3715 |
char *chptr; |
char *chptra, *chptrb; |
3716 |
|
int rc; |
3717 |
|
|
3718 |
first = strcpy(alloca(strlen(one) + 1), one); |
first = strcpy(alloca(strlen(one) + 1), one); |
3719 |
second = strcpy(alloca(strlen(two) + 1), two); |
second = strcpy(alloca(strlen(two) + 1), two); |
3720 |
|
|
3721 |
chptr = strchr(first, '='); |
chptra = strchr(first, '='); |
3722 |
if (chptr) |
if (chptra) |
3723 |
*chptr = '\0'; |
*chptra = '\0'; |
3724 |
|
|
3725 |
|
chptrb = strchr(second, '='); |
3726 |
|
if (chptrb) |
3727 |
|
*chptrb = '\0'; |
3728 |
|
|
3729 |
|
rc = strcmp(first, second); |
3730 |
|
|
3731 |
|
if (chptra) |
3732 |
|
*chptra = '='; |
3733 |
|
if (chptrb) |
3734 |
|
*chptrb = '='; |
3735 |
|
|
3736 |
chptr = strchr(second, '='); |
return rc; |
3737 |
|
} |
3738 |
|
|
3739 |
|
static int argHasValue(const char *arg) |
3740 |
|
{ |
3741 |
|
char *chptr; |
3742 |
|
|
3743 |
|
chptr = strchr(arg, '='); |
3744 |
if (chptr) |
if (chptr) |
3745 |
*chptr = '\0'; |
return 1; |
3746 |
|
return 0; |
3747 |
|
} |
3748 |
|
|
3749 |
return strcmp(first, second); |
static int argValueMatch(const char *one, const char *two) |
3750 |
|
{ |
3751 |
|
char *first, *second; |
3752 |
|
char *chptra, *chptrb; |
3753 |
|
|
3754 |
|
first = strcpy(alloca(strlen(one) + 1), one); |
3755 |
|
second = strcpy(alloca(strlen(two) + 1), two); |
3756 |
|
|
3757 |
|
chptra = strchr(first, '='); |
3758 |
|
if (chptra) |
3759 |
|
chptra += 1; |
3760 |
|
|
3761 |
|
chptrb = strchr(second, '='); |
3762 |
|
if (chptrb) |
3763 |
|
chptrb += 1; |
3764 |
|
|
3765 |
|
if (!chptra && !chptrb) |
3766 |
|
return 0; |
3767 |
|
else if (!chptra && chptrb) |
3768 |
|
return *chptrb - 0; |
3769 |
|
else if (!chptrb && chptra) |
3770 |
|
return 0 - *chptra; |
3771 |
|
else |
3772 |
|
return strcmp(chptra, chptrb); |
3773 |
} |
} |
3774 |
|
|
3775 |
int updateActualImage(struct grubConfig *cfg, const char *image, |
int updateActualImage(struct grubConfig *cfg, const char *image, |
3913 |
} |
} |
3914 |
if (usedElements[i]) |
if (usedElements[i]) |
3915 |
continue; |
continue; |
3916 |
if (!argMatch(line->elements[i].item, *arg)) { |
if (!argNameMatch(line->elements[i].item, *arg)) { |
3917 |
usedElements[i] = 1; |
usedElements[i] = 1; |
3918 |
break; |
break; |
3919 |
} |
} |
3972 |
!strcmp(line->elements[i].item, "--")) |
!strcmp(line->elements[i].item, "--")) |
3973 |
/* reached the end of hyper args, stop here */ |
/* reached the end of hyper args, stop here */ |
3974 |
break; |
break; |
3975 |
if (!argMatch(line->elements[i].item, *arg)) { |
if (!argNameMatch(line->elements[i].item, *arg)) { |
3976 |
removeElement(line, i); |
if (!argHasValue(*arg) || |
3977 |
break; |
!argValueMatch(line->elements[i].item, *arg)) { |
3978 |
|
removeElement(line, i); |
3979 |
|
break; |
3980 |
|
} |
3981 |
} |
} |
3982 |
} |
} |
3983 |
/* handle removing LT_ROOT line too */ |
/* handle removing LT_ROOT line too */ |
4471 |
return 1; |
return 1; |
4472 |
} |
} |
4473 |
|
|
4474 |
static char *getRootSpecifier(char *str) |
static size_t getRootSpecifier(const char *str) |
4475 |
{ |
{ |
4476 |
char *idx, *rootspec = NULL; |
size_t rs = 0; |
4477 |
|
|
4478 |
if (*str == '(') { |
if (*str == '(') { |
4479 |
idx = rootspec = strdup(str); |
for (; str[rs] != ')' && !isspace(str[rs]); rs++) { |
4480 |
while (*idx && (*idx != ')') && (!isspace(*idx))) |
if (!str[rs]) |
4481 |
idx++; |
return rs; |
4482 |
*(++idx) = '\0'; |
} |
4483 |
|
rs++; |
4484 |
} |
} |
4485 |
return rootspec; |
|
4486 |
|
return rs + subvolPrefix(str + rs); |
4487 |
} |
} |
4488 |
|
|
4489 |
static char *getInitrdVal(struct grubConfig *config, |
static char *getInitrdVal(struct grubConfig *config, |
5055 |
} |
} |
5056 |
|
|
5057 |
if (updateImage(config, indexs, prefix, newKernelArgs, NULL, |
if (updateImage(config, indexs, prefix, newKernelArgs, NULL, |
5058 |
newMBKernelArgs, NULL)) |
newMBKernelArgs, NULL)) { |
5059 |
|
config->isModified = 1; |
5060 |
return 1; |
return 1; |
5061 |
|
} |
5062 |
|
|
5063 |
return 0; |
return 0; |
5064 |
} |
} |
5115 |
{"mbargs", 0, POPT_ARG_STRING, &newMBKernelArgs, 0, |
{"mbargs", 0, POPT_ARG_STRING, &newMBKernelArgs, 0, |
5116 |
_("default arguments for the new multiboot kernel or " |
_("default arguments for the new multiboot kernel or " |
5117 |
"new arguments for multiboot kernel being updated"), NULL}, |
"new arguments for multiboot kernel being updated"), NULL}, |
5118 |
|
{"mounts", 0, POPT_ARG_STRING, &mounts, 0, |
5119 |
|
_("path to fake /proc/mounts file (for testing only)"), |
5120 |
|
_("mounts")}, |
5121 |
{"bad-image-okay", 0, 0, &badImageOkay, 0, |
{"bad-image-okay", 0, 0, &badImageOkay, 0, |
5122 |
_ |
_ |
5123 |
("don't sanity check images in boot entries (for testing only)"), |
("don't sanity check images in boot entries (for testing only)"), |
5226 |
exit(1); |
exit(1); |
5227 |
} |
} |
5228 |
saved_command_line[0] = '\0'; |
saved_command_line[0] = '\0'; |
5229 |
|
int cmdline_len = 0, arg_len; |
5230 |
for (int j = 1; j < argc; j++) { |
for (int j = 1; j < argc; j++) { |
5231 |
strcat(saved_command_line, argv[j]); |
arg_len = strlen(argv[j]); |
5232 |
strncat(saved_command_line, j == argc - 1 ? "" : " ", 1); |
memcpy(saved_command_line + cmdline_len, argv[j], arg_len); |
5233 |
|
cmdline_len += arg_len; |
5234 |
|
if (j != argc - 1) { |
5235 |
|
memcpy(saved_command_line + cmdline_len, " ", 1); |
5236 |
|
cmdline_len++; |
5237 |
|
} |
5238 |
|
|
5239 |
} |
} |
5240 |
|
saved_command_line[cmdline_len] = '\0'; |
5241 |
|
|
5242 |
optCon = poptGetContext("grubby", argc, argv, options, 0); |
optCon = poptGetContext("grubby", argc, argv, options, 0); |
5243 |
poptReadDefaultConfig(optCon, 1); |
poptReadDefaultConfig(optCon, 1); |
5310 |
if (!cfi) { |
if (!cfi) { |
5311 |
if (grub2FindConfig(&grub2ConfigType)) { |
if (grub2FindConfig(&grub2ConfigType)) { |
5312 |
cfi = &grub2ConfigType; |
cfi = &grub2ConfigType; |
5313 |
|
configureGrub2 = 1; |
5314 |
if (envPath) |
if (envPath) |
5315 |
cfi->envFile = envPath; |
cfi->envFile = envPath; |
5316 |
} else |
} else { |
5317 |
#ifdef __ia64__ |
#ifdef __ia64__ |
5318 |
cfi = &eliloConfigType; |
cfi = &eliloConfigType; |
5319 |
#elif __powerpc__ |
configureLilo = 1; |
5320 |
|
#elif defined(__powerpc__) |
5321 |
cfi = &yabootConfigType; |
cfi = &yabootConfigType; |
5322 |
#elif __sparc__ |
configureYaboot = 1; |
5323 |
|
#elif defined(__sparc__) |
5324 |
cfi = &siloConfigType; |
cfi = &siloConfigType; |
5325 |
#elif __s390__ |
configureSilo = 1; |
5326 |
|
#elif defined(__s390__) || defined(__s390x__) |
5327 |
cfi = &ziplConfigType; |
cfi = &ziplConfigType; |
5328 |
#elif __s390x__ |
configureZipl = 1; |
|
cfi = &ziplConfigtype; |
|
5329 |
#else |
#else |
5330 |
cfi = &grubConfigType; |
cfi = &grubConfigType; |
5331 |
|
configureGrub = 1; |
5332 |
#endif |
#endif |
5333 |
|
} |
5334 |
} |
} |
5335 |
|
|
5336 |
if (!grubConfig) { |
if (!grubConfig) { |
5524 |
if (displayDefault) { |
if (displayDefault) { |
5525 |
struct singleLine *line; |
struct singleLine *line; |
5526 |
struct singleEntry *entry; |
struct singleEntry *entry; |
5527 |
char *rootspec; |
size_t rs; |
5528 |
|
|
5529 |
if (config->defaultImage == -1) |
if (config->defaultImage == NO_DEFAULT_ENTRY) |
5530 |
return 0; |
return 0; |
5531 |
if (config->defaultImage == DEFAULT_SAVED_GRUB2 && |
if (config->defaultImage == DEFAULT_SAVED_GRUB2 && |
5532 |
cfi->defaultIsSaved) |
cfi->defaultIsSaved) |
5533 |
config->defaultImage = 0; |
config->defaultImage = FIRST_ENTRY_INDEX; |
5534 |
entry = findEntryByIndex(config, config->defaultImage); |
entry = findEntryByIndex(config, config->defaultImage); |
5535 |
if (!entry) |
if (!entry) |
5536 |
return 0; |
return 0; |
5537 |
if (!suitableImage(entry, bootPrefix, 0, flags)) |
|
5538 |
return 0; |
/* check if is a suitable image but still print it */ |
5539 |
|
suitableImage(entry, bootPrefix, 0, flags); |
5540 |
|
|
5541 |
line = |
line = |
5542 |
getLineByType(LT_KERNEL | LT_HYPER | LT_KERNEL_EFI | |
getLineByType(LT_KERNEL | LT_HYPER | LT_KERNEL_EFI | |
5544 |
if (!line) |
if (!line) |
5545 |
return 0; |
return 0; |
5546 |
|
|
5547 |
rootspec = getRootSpecifier(line->elements[1].item); |
rs = getRootSpecifier(line->elements[1].item); |
5548 |
printf("%s%s\n", bootPrefix, line->elements[1].item + |
printf("%s%s\n", bootPrefix, line->elements[1].item + rs); |
|
((rootspec != NULL) ? strlen(rootspec) : 0)); |
|
5549 |
|
|
5550 |
return 0; |
return 0; |
5551 |
|
|
5553 |
struct singleLine *line; |
struct singleLine *line; |
5554 |
struct singleEntry *entry; |
struct singleEntry *entry; |
5555 |
|
|
5556 |
if (config->defaultImage == -1) |
if (config->defaultImage == NO_DEFAULT_ENTRY) |
5557 |
return 0; |
return 0; |
5558 |
if (config->defaultImage == DEFAULT_SAVED_GRUB2 && |
if (config->defaultImage == DEFAULT_SAVED_GRUB2 && |
5559 |
cfi->defaultIsSaved) |
cfi->defaultIsSaved) |
5560 |
config->defaultImage = 0; |
config->defaultImage = FIRST_ENTRY_INDEX; |
5561 |
entry = findEntryByIndex(config, config->defaultImage); |
entry = findEntryByIndex(config, config->defaultImage); |
5562 |
if (!entry) |
if (!entry) |
5563 |
return 0; |
return 0; |
5587 |
return 0; |
return 0; |
5588 |
|
|
5589 |
} else if (displayDefaultIndex) { |
} else if (displayDefaultIndex) { |
5590 |
if (config->defaultImage == -1) |
if (config->defaultImage == NO_DEFAULT_ENTRY) |
5591 |
return 0; |
return 0; |
5592 |
if (config->defaultImage == DEFAULT_SAVED_GRUB2 && |
if (config->defaultImage == DEFAULT_SAVED_GRUB2 && |
5593 |
cfi->defaultIsSaved) |
cfi->defaultIsSaved) |
5594 |
config->defaultImage = 0; |
config->defaultImage = FIRST_ENTRY_INDEX; |
5595 |
printf("%i\n", config->defaultImage); |
printf("%i\n", config->defaultImage); |
5596 |
return 0; |
return 0; |
5597 |
|
|
5607 |
markRemovedImage(config, removeKernelPath, bootPrefix); |
markRemovedImage(config, removeKernelPath, bootPrefix); |
5608 |
markRemovedImage(config, removeMBKernel, bootPrefix); |
markRemovedImage(config, removeMBKernel, bootPrefix); |
5609 |
setDefaultImage(config, newKernelPath != NULL, defaultKernel, |
setDefaultImage(config, newKernelPath != NULL, defaultKernel, |
5610 |
makeDefault, bootPrefix, flags, defaultIndex); |
makeDefault, bootPrefix, flags, defaultIndex, |
5611 |
|
newIndex); |
5612 |
setFallbackImage(config, newKernelPath != NULL); |
setFallbackImage(config, newKernelPath != NULL); |
5613 |
if (updateImage(config, updateKernelPath, bootPrefix, newKernelArgs, |
if (updateImage(config, updateKernelPath, bootPrefix, newKernelArgs, |
5614 |
removeArgs, newMBKernelArgs, removeMBKernelArgs)) |
removeArgs, newMBKernelArgs, removeMBKernelArgs)) |