1
0
Fork 0
forked from len0rd/rockbox

multiboot_select plugin check volume root for valid firmware

Change-Id: I5feb4b00ae385ff8967de27682d4e4a528dc2ae5
This commit is contained in:
William Wilgus 2024-04-01 23:20:38 -04:00 committed by William Wilgus
parent 15fdaa3abc
commit 4a91d37613

View file

@ -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 */