Closed zxq432 closed 3 years ago
it seems link2symlink support 5 hardlinks of a file at most.
localhost /tmp # date>a1 && for i in `seq 10`;do ln a1 l${i}a1;done; ls -l *1
ln: failed to access 'a1': Too many levels of symbolic links
ln: failed to access 'a1': Too many levels of symbolic links
ln: failed to access 'a1': Too many levels of symbolic links
ln: failed to access 'a1': Too many levels of symbolic links
ln: failed to access 'a1': Too many levels of symbolic links
lrwxrwxrwx 1 root root 110 Sep 19 20:25 a1 -> /.l2s/.l2s..l2s.a10001.00020001
lrwxrwxrwx 1 root root 110 Sep 19 20:25 l1a1 -> /.l2s/.l2s..l2s.a10001.00020001
lrwxrwxrwx 1 root root 126 Sep 19 20:25 l2a1 -> /.l2s/.l2s..l2s..l2s.a10001.00020001.00020001
lrwxrwxrwx 1 root root 138 Sep 19 20:25 l3a1 -> /.l2s/.l2s..l2s..l2s..l2s.a10001.00020001.00020001.00020001
lrwxrwxrwx 1 root root 154 Sep 19 20:25 l4a1 -> /.l2s/.l2s..l2s..l2s..l2s..l2s.a10001.00020001.00020001.00020001.00020001
-rw-r--r-- 1 root root 29 Sep 19 20:25 l5a1
localhost /.l2s # ls -alt .l2s.*a1000*
lrwxrwxrwx 1 root root 158 Sep 19 20:25 .l2s..l2s..l2s..l2s..l2s.a10001.00020001.00020001.00020001.00020001 -> /.l2s/.l2s..l2s..l2s..l2s..l2s.a10001.00020001.00020001.00020001.00020001.0002
lrwxrwxrwx 1 root root 158 Sep 19 20:25 .l2s..l2s..l2s..l2s.a10001.00020001.00020001.00020001 -> /.l2s/.l2s..l2s..l2s..l2s..l2s.a10001.00020001.00020001.00020001.00020001.0002
lrwxrwxrwx 1 root root 154 Sep 19 20:25 .l2s..l2s..l2s.a10001.00020001.00020001.0002 -> /.l2s/.l2s..l2s..l2s..l2s..l2s.a10001.00020001.00020001.00020001.00020001
lrwxrwxrwx 1 root root 142 Sep 19 20:25 .l2s..l2s..l2s.a10001.00020001.00020001 -> /.l2s/.l2s..l2s..l2s..l2s.a10001.00020001.00020001.00020001.0002
lrwxrwxrwx 1 root root 138 Sep 19 20:25 .l2s..l2s.a10001.00020001.0002 -> /.l2s/.l2s..l2s..l2s..l2s.a10001.00020001.00020001.00020001
lrwxrwxrwx 1 root root 130 Sep 19 20:25 .l2s..l2s.a10001.00020001 -> /.l2s/.l2s..l2s..l2s.a10001.00020001.00020001.0002
lrwxrwxrwx 1 root root 126 Sep 19 20:25 .l2s.a10001.0002 -> /.l2s/.l2s..l2s..l2s.a10001.00020001.00020001
lrwxrwxrwx 1 root root 114 Sep 19 20:25 .l2s.a10001 -> /.l2s/.l2s..l2s.a10001.00020001.0002
-rw-r--r-- 1 root root 29 Sep 19 20:25 .l2s..l2s..l2s..l2s..l2s.a10001.00020001.00020001.00020001.00020001.0002
-rw-r--r-- 1 root root 29 Sep 19 20:25 .l2s..l2s..l2s..l2s.a10001.00020001.00020001.00020001.0002
localhost /.l2s #rm /tmp/*a1 && ls -alt .l2s.*a1000*
lrwxrwxrwx 1 root root 158 Sep 19 21:02 .l2s..l2s..l2s..l2s..l2s.a10001.00020001.00020001.00020001.00020001 -> /.l2s/.l2s..l2s..l2s..l2s..l2s.a10001.00020001.00020001.00020001.00020001.0001
lrwxrwxrwx 1 root root 158 Sep 19 21:02 .l2s..l2s..l2s..l2s.a10001.00020001.00020001.00020001 -> /.l2s/.l2s..l2s..l2s..l2s..l2s.a10001.00020001.00020001.00020001.00020001.0001
lrwxrwxrwx 1 root root 142 Sep 19 21:02 .l2s..l2s..l2s.a10001.00020001.00020001 -> /.l2s/.l2s..l2s..l2s..l2s.a10001.00020001.00020001.00020001.0001
lrwxrwxrwx 1 root root 130 Sep 19 21:02 .l2s..l2s.a10001.00020001 -> /.l2s/.l2s..l2s..l2s.a10001.00020001.00020001.0001
lrwxrwxrwx 1 root root 154 Sep 19 20:25 .l2s..l2s..l2s.a10001.00020001.00020001.0001 -> /.l2s/.l2s..l2s..l2s..l2s..l2s.a10001.00020001.00020001.00020001.00020001
lrwxrwxrwx 1 root root 138 Sep 19 20:25 .l2s..l2s.a10001.00020001.0001 -> /.l2s/.l2s..l2s..l2s..l2s.a10001.00020001.00020001.00020001
-rw-r--r-- 1 root root 29 Sep 19 20:25 .l2s..l2s..l2s..l2s..l2s.a10001.00020001.00020001.00020001.00020001.0001
-rw-r--r-- 1 root root 29 Sep 19 20:25 .l2s..l2s..l2s..l2s.a10001.00020001.00020001.00020001.0001
localhost /.l2s #
emerge -va git
worked fine for me
What you're showing in second post is clearly unexpected behavior, as after creation link2symlink symlinks should be shown as normal files
localhost /tmp # date>a1 && for i in `seq 10`;do ln a1 l${i}a1;done; ls -l *1
-rw-r--r-- 1 root root 29 Sep 19 15:27 a1
-rw-r--r-- 1 root root 29 Sep 19 15:27 l10a1
-rw-r--r-- 1 root root 29 Sep 19 15:27 l1a1
-rw-r--r-- 1 root root 29 Sep 19 15:27 l2a1
-rw-r--r-- 1 root root 29 Sep 19 15:27 l3a1
-rw-r--r-- 1 root root 29 Sep 19 15:27 l4a1
-rw-r--r-- 1 root root 29 Sep 19 15:27 l5a1
-rw-r--r-- 1 root root 29 Sep 19 15:27 l6a1
-rw-r--r-- 1 root root 29 Sep 19 15:27 l7a1
-rw-r--r-- 1 root root 29 Sep 19 15:27 l8a1
-rw-r--r-- 1 root root 29 Sep 19 15:27 l9a1
And all of them should be pointing to same file (example below is from running outside proot):
.../gentoo/tmp $ pwd
/data/data/com.termux/files/usr/var/lib/proot-distro/installed-rootfs/gentoo/tmp
.../gentoo/tmp $ ls -la
total 52
drwxrwxrwt 2 u0_a232 u0_a232 4096 Sep 19 17:27 .
drwxr-xr-x 22 u0_a232 u0_a232 4096 Sep 19 17:27 ..
-rw-r--r-- 1 u0_a232 u0_a232 0 Aug 5 07:49 .keep
lrwxrwxrwx 1 u0_a232 u0_a232 93 Sep 19 17:27 a1 -> /data/data/com.termux/files/usr/var/lib/proot-distro/installed-rootfs/gentoo/.l2s/.l2s.a10001
lrwxrwxrwx 1 u0_a232 u0_a232 93 Sep 19 17:27 l10a1 -> /data/data/com.termux/files/usr/var/lib/proot-distro/installed-rootfs/gentoo/.l2s/.l2s.a10001
lrwxrwxrwx 1 u0_a232 u0_a232 93 Sep 19 17:27 l1a1 -> /data/data/com.termux/files/usr/var/lib/proot-distro/installed-rootfs/gentoo/.l2s/.l2s.a10001
lrwxrwxrwx 1 u0_a232 u0_a232 93 Sep 19 17:27 l2a1 -> /data/data/com.termux/files/usr/var/lib/proot-distro/installed-rootfs/gentoo/.l2s/.l2s.a10001
lrwxrwxrwx 1 u0_a232 u0_a232 93 Sep 19 17:27 l3a1 -> /data/data/com.termux/files/usr/var/lib/proot-distro/installed-rootfs/gentoo/.l2s/.l2s.a10001
lrwxrwxrwx 1 u0_a232 u0_a232 93 Sep 19 17:27 l4a1 -> /data/data/com.termux/files/usr/var/lib/proot-distro/installed-rootfs/gentoo/.l2s/.l2s.a10001
lrwxrwxrwx 1 u0_a232 u0_a232 93 Sep 19 17:27 l5a1 -> /data/data/com.termux/files/usr/var/lib/proot-distro/installed-rootfs/gentoo/.l2s/.l2s.a10001
lrwxrwxrwx 1 u0_a232 u0_a232 93 Sep 19 17:27 l6a1 -> /data/data/com.termux/files/usr/var/lib/proot-distro/installed-rootfs/gentoo/.l2s/.l2s.a10001
lrwxrwxrwx 1 u0_a232 u0_a232 93 Sep 19 17:27 l7a1 -> /data/data/com.termux/files/usr/var/lib/proot-distro/installed-rootfs/gentoo/.l2s/.l2s.a10001
lrwxrwxrwx 1 u0_a232 u0_a232 93 Sep 19 17:27 l8a1 -> /data/data/com.termux/files/usr/var/lib/proot-distro/installed-rootfs/gentoo/.l2s/.l2s.a10001
lrwxrwxrwx 1 u0_a232 u0_a232 93 Sep 19 17:27 l9a1 -> /data/data/com.termux/files/usr/var/lib/proot-distro/installed-rootfs/gentoo/.l2s/.l2s.a10001
Anyway, it appears to be device (or configuration) specific, as I haven't reproduced it here.
Does this behaviour happen if ln
is used only once/twice? (There never should be files with ".l2s..l2s."
double prefix created)
Does it happen when just running in proot --link2symlink bash
(without specifying chroot)?
Does creating hardlinks works when you're outside proot?
it seems the problems is introduced by a running of stage4.
just after gentoo distro stage3 installed whithout massive package rebuild for stage4, link2symlink works fine. git was not in the distro stage3, and it could be emerged successfully for the first time running of emerge. for a try of stage4, 2 workaround need to be done at first:
after a running of stage4, all packages installed were re-emerged with a few failed packages. the git was among the few failed packages, and the ln command not work as expected, addtion of one more link will not increase the counting number, but increase the link hops. it seems after re-emerge some packages, maybe for the rebuilt glibc or coreutils or others, the behavior of link2symlink was changed in the gentoo distro.
"grep termux /var/db/pkg///CONTENTS" revealed only the openrc package installed some files into folder under the termux $PREFIX folder. with PREFIX commented out in /etc/profile.d/termux-proot.sh, the leaked files were get rid of after re-emerge of openrc and a few more failed packages emerged successfully, left perl and git to be the last 2 packages still failed emerge. perl failed in configure phase,
Which of these apply, if any? [linux-android]
./hints/linux-android.sh: line 317: getprop: command not found
......
What is your architecture name [aarch64-linux-android]
Add the Perl API version to your archname? [n]
This architecture is naturally 64-bit, not changing architecture name.
Pathname where the public executables will reside? (~name ok) [/usr/bin]
Use relocatable @INC? [y]
Pathname where the private library files will reside? (~name ok) [.../../lib/perl5/5.34.0]
Where do you want to put the public architecture-dependent libraries? (~name ok)
[.../../lib/perl5/5.34.0/aarch64-linux-android]
......
Cannot build with both -Duserelocatableinc and -Duseshrplib
See INSTALL for an explanation why that won't work.
+ die 'Unable to configure'
+ [[ -n '' ]]
+ set +x
* ERROR: dev-lang/perl-5.34.0-r2::gentoo failed (configure phase):
maybe it should be linux instead of linux-andriod, which introduced "Use relocatable @INC? [y]" and -Duserelocatableinc
install another new distro of gentoo, the link2symlink works fine.
the attached is a script log with PROOT_VERBOSE=9 for
for i in `seq 7`;do ln a1 l${i}a1;done
root@gentoo:/tmp# grep -E '"a1"|/a1|l[0-9]a1|l2s.a1' v9script.log
proot info: vpid 4: translate("/tmp" + "a1")
proot info: vpid 4: -> "/data/data/com.termux/files/usr/var/lib/proot-distro/installed-rootfs/gentoo/tmp/a1"
proot info: vpid 4: translate("/tmp" + "l1a1")
proot info: vpid 4: -> "/data/data/com.termux/files/usr/var/lib/proot-distro/installed-rootfs/gentoo/tmp/l1a1"
proot info: vpid 5: translate("/tmp" + "a1")
proot info: vpid 5: -> "/data/data/com.termux/files/usr/var/lib/proot-distro/installed-rootfs/gentoo/.l2s/.l2s.a10001.0002"
proot info: vpid 5: translate("/tmp" + "l2a1")
proot info: vpid 5: -> "/data/data/com.termux/files/usr/var/lib/proot-distro/installed-rootfs/gentoo/tmp/l2a1"
proot info: vpid 6: translate("/tmp" + "a1")
proot info: vpid 6: -> "/data/data/com.termux/files/usr/var/lib/proot-distro/installed-rootfs/gentoo/.l2s/.l2s..l2s.a10001.00020001.0002"
proot info: vpid 6: translate("/tmp" + "l3a1")
proot info: vpid 6: -> "/data/data/com.termux/files/usr/var/lib/proot-distro/installed-rootfs/gentoo/tmp/l3a1"
proot info: vpid 7: translate("/tmp" + "a1")
proot info: vpid 7: -> "/data/data/com.termux/files/usr/var/lib/proot-distro/installed-rootfs/gentoo/.l2s/.l2s..l2s..l2s.a10001.00020001.00020001.0002"
proot info: vpid 7: translate("/tmp" + "l4a1")
proot info: vpid 7: -> "/data/data/com.termux/files/usr/var/lib/proot-distro/installed-rootfs/gentoo/tmp/l4a1"
proot info: vpid 8: translate("/tmp" + "a1")
proot info: vpid 8: -> "/data/data/com.termux/files/usr/var/lib/proot-distro/installed-rootfs/gentoo/.l2s/.l2s..l2s..l2s..l2s.a10001.00020001.00020001.00020001.0002"
proot info: vpid 8: translate("/tmp" + "l5a1")
proot info: vpid 8: -> "/data/data/com.termux/files/usr/var/lib/proot-distro/installed-rootfs/gentoo/tmp/l5a1"
proot info: vpid 9: translate("/tmp" + "a1")
proot info: vpid 9: translate("/tmp" + "a1")
proot info: vpid 10: translate("/tmp" + "a1")
proot info: vpid 10: translate("/tmp" + "a1")
root@gentoo:/tmp#
log for the same script run in stage3 distro gentoo v9script_ok.log
root@gentoo:/tmp# grep -E '"a1"|/a1|l[0-9]a1|l2s.a1' v9script_ok.log
proot info: vpid 5: translate("/tmp" + "a1")
proot info: vpid 5: -> "/data/data/com.termux/files/usr/var/lib/proot-distro/installed-rootfs/gp/tmp/a1"
proot info: vpid 5: translate("/tmp" + "l1a1")
proot info: vpid 5: -> "/data/data/com.termux/files/usr/var/lib/proot-distro/installed-rootfs/gp/tmp/l1a1"
proot info: vpid 6: translate("/tmp" + "a1")
proot info: vpid 6: -> "/data/data/com.termux/files/usr/var/lib/proot-distro/installed-rootfs/gp/tmp/a1"
proot info: vpid 6: translate("/tmp" + "l2a1")
proot info: vpid 6: -> "/data/data/com.termux/files/usr/var/lib/proot-distro/installed-rootfs/gp/tmp/l2a1"
proot info: vpid 7: translate("/tmp" + "a1")
proot info: vpid 7: -> "/data/data/com.termux/files/usr/var/lib/proot-distro/installed-rootfs/gp/tmp/a1"
proot info: vpid 7: translate("/tmp" + "l3a1")
proot info: vpid 7: -> "/data/data/com.termux/files/usr/var/lib/proot-distro/installed-rootfs/gp/tmp/l3a1"
proot info: vpid 8: translate("/tmp" + "a1")
proot info: vpid 8: -> "/data/data/com.termux/files/usr/var/lib/proot-distro/installed-rootfs/gp/tmp/a1"
proot info: vpid 8: translate("/tmp" + "l4a1")
proot info: vpid 8: -> "/data/data/com.termux/files/usr/var/lib/proot-distro/installed-rootfs/gp/tmp/l4a1"
proot info: vpid 9: translate("/tmp" + "a1")
proot info: vpid 9: -> "/data/data/com.termux/files/usr/var/lib/proot-distro/installed-rootfs/gp/tmp/a1"
proot info: vpid 9: translate("/tmp" + "l5a1")
proot info: vpid 9: -> "/data/data/com.termux/files/usr/var/lib/proot-distro/installed-rootfs/gp/tmp/l5a1"
proot info: vpid 10: translate("/tmp" + "a1")
proot info: vpid 10: -> "/data/data/com.termux/files/usr/var/lib/proot-distro/installed-rootfs/gp/tmp/a1"
proot info: vpid 10: translate("/tmp" + "l6a1")
proot info: vpid 10: -> "/data/data/com.termux/files/usr/var/lib/proot-distro/installed-rootfs/gp/tmp/l6a1"
proot info: vpid 11: translate("/tmp" + "a1")
proot info: vpid 11: -> "/data/data/com.termux/files/usr/var/lib/proot-distro/installed-rootfs/gp/tmp/a1"
proot info: vpid 11: translate("/tmp" + "l7a1")
proot info: vpid 11: -> "/data/data/com.termux/files/usr/var/lib/proot-distro/installed-rootfs/gp/tmp/l7a1"
root@gentoo:/tmp#
it seems the translate() fuction has some difference.
the problem could be resolved by using --isolated for login distro. and comment out /etc/profile.d/termux-proot.sh
Problem description
the error message:
the .l2s.git files in /.l2s
Steps to reproduce
Expected behavior
emerge till finish successfully.
Additional information