Open zxq432 opened 3 years ago
proot of termux does not support xattr. the stage3 tarball comes with a sys-dev/patch with xattr USE flag enabled, it seems the /usr/bin/patch with xattr enabled will make it fail in proot.
workaround: after run "proot-distro login gentoo", run the following script:
curl -LO http://distfiles.gentoo.org/experimental/prefix/arm/prefix-stage3-arm64-latest.tar.xz
tar -C /data -xf prefix-stage3-arm64-latest.tar.xz
mv /usr/bin/patch /usr/bin/patch.bk
ln -s /data/gentoo64/usr/bin/patch /usr/bin/patch
nano /etc/portage/make.conf ;# add '-xattr' to USE in the /etc/portage/make.conf.
emerge -v1 patch
rm /usr/bin/patch.bk
Proot does override lsetxattr
failure when application runs as root, however in Gentoo patch is ran as uid 250. I'll yet have to see how much this condition has to be relaxed.
For now it does work if following line is commented out: https://github.com/termux/proot/blob/f5ac93d9b006340171c9d8b2106fb7df5ae777ee/src/extension/fake_id0/fake_id0.c#L524
Gentoo now (1h ago) removed from Proot-distro. Thank you, @xeffyr (no sarcasm/ROFL!).
git clone https://aur.archlinux.org/fakeroot-tcp.git
Clone in native Termux first, then open a new PRoot session in the cloned directory and continue in the original native Termux session and in the new PRoot session. Use these commands in the PRoot session:
cd fakeroot-tcp
makepkg -firs --noconfirm
After waiting for the makepkg
command to err, apply the patches individually in both open sessions to see the difference in patch's behavior, the native Termux session and the Termux PRoot session.
$grep patch PKGBUILD
fakeroot-1.25.3-glibc-2.33-fix-1.patch
fakeroot-1.25.3-glibc-2.33-fix-2.patch
fakeroot-1.25.3-glibc-2.33-fix-3.patch)
patch -p1 -i $srcdir/fakeroot-1.25.3-glibc-2.33-fix-1.patch
patch -p1 -i $srcdir/fakeroot-1.25.3-glibc-2.33-fix-2.patch
patch -p1 -i $srcdir/fakeroot-1.25.3-glibc-2.33-fix-3.patch
The expected behavior is for the patch
command to work in native Termux and in Termux PRoot correctly.
Additional information
The obvious workaround is NOT to use patch
in the meantime in Termux PRoot for those of us who do not know how to fix this not so newly arisen error.
The patch
command used to work correctly in both native Termux and in Termux PRoot. How was it broken? Can I have some links to the code how the patch
command was cracked in the Termux PRoot environment please?
patch: setting attribute security.selinux for security.selinux: Permission denied #
This command ln -s /system/bin/patch /data/data/com.termux/files/home/arch/usr/local/bin/patch
run in a native Termux shell might resolve a patch: setting attribute security.selinux for security.selinux: Permission denied
error. This workaround seems to work with QEMU architecture emulation too.
Issues “Building xrdp from AUR fails mentioning selinux #293” at https://github.com/SDRausty/TermuxArch/issues/293 and “patch: setting attribute security.selinux for security.selinux: Permission denied #182” at https://github.com/termux/proot/issues/182 have more information about this error.
Problem description
Steps to reproduce
Expected behavior
Additional information