cmake: Update from 3.10.3 to 3.11.0
[termux-packages] / packages / proot / termux-chroot
index 9fde1a8..79801b1 100755 (executable)
@@ -31,8 +31,19 @@ ARGS="$ARGS -b /vendor:/vendor"
 # and $HOME so that Termux programs with hard-coded paths continue to work:
 ARGS="$ARGS -b /data:/data"
 
-# Used by getprop (see https://github.com/termux/termux-packages/issues/1076):
-ARGS="$ARGS -b /property_contexts:/property_contexts"
+
+# Bind Magisk binary directories so root works, closing per Issue #2100.
+if [ -d /sbin ] && [ -d /root ]; then
+       # Both of these directories exist under Android even without Magisk installed,
+       # The existence check is to ensure that it doesn't break if this changes.
+       ARGS="$ARGS -b /sbin:/sbin -b /root:/root"
+fi
+
+if [ -f /property_contexts ]; then
+       # Used by getprop (see https://github.com/termux/termux-packages/issues/1076)
+       # but does not exist on Android 8.
+       ARGS="$ARGS -b /property_contexts:/property_contexts"
+fi
 
 # Expose external and internal storage:
 if [ -d /storage ]; then