forked from len0rd/rockbox
multiboot_select plugin check volume root for valid firmware
Change-Id: I5feb4b00ae385ff8967de27682d4e4a528dc2ae5
This commit is contained in:
parent
15fdaa3abc
commit
4a91d37613
1 changed files with 5 additions and 2 deletions
|
@ -155,14 +155,17 @@ static int find_roots(void)
|
|||
|
||||
struct dirent* ent;
|
||||
while((ent = rb->readdir(dir))) {
|
||||
const char *dname = ent->d_name;
|
||||
if (*dname == '.' && *(dname + 1) == '\0')
|
||||
dname++; /* skip the dot so we can check root of volume */
|
||||
int r = rb->snprintf(tmpbuf, sizeof(tmpbuf), "/<%d>/%s/%s/%s",
|
||||
vol, ent->d_name, bootdir, BOOTFILE);
|
||||
vol, dname, bootdir, BOOTFILE);
|
||||
if(r < 0 || (size_t)r >= sizeof(tmpbuf))
|
||||
continue;
|
||||
|
||||
if(check_firmware(tmpbuf)) {
|
||||
rb->snprintf(roots[nroots], MAX_PATH, "/<%d>/%s",
|
||||
vol, ent->d_name);
|
||||
vol, dname);
|
||||
nroots += 1;
|
||||
|
||||
/* quit if we hit the maximum */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue