I have mounted an ISO at /mnt. The ISO is android's system.img. At the root it has a folder etc that is linked to /system/etc:
lrw-r--r-- 1 root root 11 Dec 31 2008 etc -> /system/etc
But it seems that my linux system does not identify that this symbolic link actually points to a directory INSIDE /mnt, but not to my system root directory.
In the /system/etc/ folder there's a standard hosts file:
$ cat /mnt/system/etc/hosts
127.0.0.1 localhost
::1 ip6-localhost
I expect cat /mnt/etc/hosts to output the same, but in reality it output:
$ cat /mnt/etc/hosts
cat: /mnt/etc/hosts: No such file or directory
I created a stub file at /system/etc/hosts in my system root and tried again:
$ sudo mkdir /system
$ sudo mkdir /system/etc
$ echo "STUB" | sudo tee /system/etc/hosts
STUB
$ sudo mkdir /system/etc
$ cat /mnt/etc/hosts
STUB
As expected, it printed contents of /system/etc/hosts instead of /mnt/system/etc/hosts, as I wanted.
I want all symbolic links in the mounted folder /mnt to be resolved as if it was mounted at root /, so all symbolic links are resolved correctly.
Is there any way I can do that without actually changing anything in the mounted filesystem (redefining symbolic links to point to /mnt{ACTUAL LINK})?