190 |
NULL |
NULL |
191 |
}; |
}; |
192 |
static int i = -1; |
static int i = -1; |
193 |
|
static const char *grub_cfg = "/boot/grub/grub.cfg"; |
194 |
|
|
195 |
if (i == -1) { |
if (i == -1) { |
196 |
for (i = 0; configFiles[i] != NULL; i++) { |
for (i = 0; configFiles[i] != NULL; i++) { |
199 |
dbgPrintf("found\n"); |
dbgPrintf("found\n"); |
200 |
return configFiles[i]; |
return configFiles[i]; |
201 |
} |
} |
|
dbgPrintf("not found\n"); |
|
202 |
} |
} |
203 |
} |
} |
204 |
|
|
205 |
|
/* Ubuntu renames grub2 to grub, so check for the grub.d directory |
206 |
|
* that isn't in grub1, and if it exists, return the config file path |
207 |
|
* that they use. */ |
208 |
|
if (configFiles[i] == NULL && !access("/etc/grub.d/", R_OK)) { |
209 |
|
dbgPrintf("found\n"); |
210 |
|
return grub_cfg; |
211 |
|
} |
212 |
|
|
213 |
|
dbgPrintf("not found\n"); |
214 |
return configFiles[i]; |
return configFiles[i]; |
215 |
} |
} |
216 |
|
|
2594 |
} |
} |
2595 |
|
|
2596 |
int checkForGrub2(struct grubConfig * config) { |
int checkForGrub2(struct grubConfig * config) { |
2597 |
if (!access("/boot/grub2", R_OK)) |
if (!access("/etc/grub.d/", R_OK)) |
2598 |
return 2; |
return 2; |
2599 |
|
|
2600 |
return 1; |
return 1; |