Do not early mount on symlinks on half Treble devices

Fix #399
This commit is contained in:
topjohnwu 2018-07-19 17:43:37 +08:00
parent c8cc652b71
commit 3ae959af95

View File

@ -157,6 +157,12 @@ static int strend(const char *s1, const char *s2) {
static int read_fstab_dt(const struct cmdline *cmd, const char *mnt_point, char *partname) {
char buf[128];
struct stat st;
sprintf(buf, "/%s", mnt_point);
lstat(buf, &st);
// Don't early mount if the mount point is symlink
if (S_ISLNK(st.st_mode))
return 1;
sprintf(buf, "%s/fstab/%s/dev", cmd->dt_dir, mnt_point);
if (access(buf, F_OK) == 0) {
int fd = open(buf, O_RDONLY | O_CLOEXEC);