configfs: add /config as an alternate mount point

This commit is contained in:
Marcel Alexandru Nitan
2023-05-22 09:36:51 +00:00
parent 0ae438cfb5
commit c3df4d359a

View File

@@ -10,6 +10,7 @@
#include <array>
#include <memory>
#include <cstdio>
#include <dirent.h>
char *fs_mount_point(char *filesystem_type) {
struct mntent *ent;
@@ -24,6 +25,17 @@ char *fs_mount_point(char *filesystem_type) {
break;
}
}
// Alternate search location on Android
if (mount_point == nullptr)
{
const char *alt_usb_gadget = "/config/usb_gadget";
DIR *dir = opendir(alt_usb_gadget);
if (dir)
{
mount_point = (char*)"/config";
}
}
return mount_point;
}