From 8e3840a240870efb957255d020a5b8d37d9e789f Mon Sep 17 00:00:00 2001 From: ShadowEO Date: Wed, 7 Mar 2018 01:22:34 -0500 Subject: [PATCH 1/4] Added arguments for proot to enable the use of MagiskSU from within termux-chroot. --- packages/proot/termux-chroot | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/proot/termux-chroot b/packages/proot/termux-chroot index 7e49a42c419cb3..f2f2c3ae933890 100755 --- a/packages/proot/termux-chroot +++ b/packages/proot/termux-chroot @@ -1,4 +1,4 @@ -#!/bin/sh +#!/data/data/com.termux/files/usr/bin/sh SCRIPTNAME=termux-chroot show_usage () { @@ -31,6 +31,9 @@ ARGS="$ARGS -b /vendor:/vendor" # and $HOME so that Termux programs with hard-coded paths continue to work: ARGS="$ARGS -b /data:/data" +# Bind Magisk binary directories so root works, closing per Issue #2100. +ARGS="$ARGS -b /sbin:/sbin -b /root:/root" + if [ -f /property_contexts ]; then # Used by getprop (see https://github.com/termux/termux-packages/issues/1076) # but does not exist on Android 8. From 9aac3c6cc995accf855bf72c6fbf860d59aae22b Mon Sep 17 00:00:00 2001 From: ShadowEO Date: Wed, 7 Mar 2018 01:25:02 -0500 Subject: [PATCH 2/4] Restore original shebang to termux-chroot for pull-request. --- packages/proot/termux-chroot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/proot/termux-chroot b/packages/proot/termux-chroot index f2f2c3ae933890..ec292216bdd126 100755 --- a/packages/proot/termux-chroot +++ b/packages/proot/termux-chroot @@ -1,4 +1,4 @@ -#!/data/data/com.termux/files/usr/bin/sh +#!/bin/sh SCRIPTNAME=termux-chroot show_usage () { From 58708d275143b2bf8824e86f40c794f764a198c4 Mon Sep 17 00:00:00 2001 From: ShadowEO Date: Wed, 7 Mar 2018 01:35:59 -0500 Subject: [PATCH 3/4] Added folder existence check to ensure MagiskSU changes don't break termux-chroot on later versions of Android, just in case. --- packages/proot/termux-chroot | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/proot/termux-chroot b/packages/proot/termux-chroot index ec292216bdd126..79801b144e655b 100755 --- a/packages/proot/termux-chroot +++ b/packages/proot/termux-chroot @@ -31,8 +31,13 @@ ARGS="$ARGS -b /vendor:/vendor" # and $HOME so that Termux programs with hard-coded paths continue to work: ARGS="$ARGS -b /data:/data" + # Bind Magisk binary directories so root works, closing per Issue #2100. -ARGS="$ARGS -b /sbin:/sbin -b /root:/root" +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) From d95e2fdee1434ef6054e48c911493b4845c1eef2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Bednarski?= Date: Sat, 10 Mar 2018 10:25:28 +0100 Subject: [PATCH 4/4] proot: Update for accept -> accept4 translation --- packages/proot/build.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/proot/build.sh b/packages/proot/build.sh index 39a3ebce991a6a..1741bc0b86d3a8 100644 --- a/packages/proot/build.sh +++ b/packages/proot/build.sh @@ -1,11 +1,11 @@ TERMUX_PKG_HOMEPAGE=https://proot-me.github.io/ TERMUX_PKG_DESCRIPTION="Emulate chroot, bind mount and binfmt_misc for non-root users" # Just bump commit and version when needed: -_COMMIT=9553bc6b65f705b26249cf70244bff9ab8e935e9 +_COMMIT=c24fa3a43af2336a93f63fe3fb3eac599f0e3592 TERMUX_PKG_VERSION=5.1.107 -TERMUX_PKG_REVISION=5 +TERMUX_PKG_REVISION=6 TERMUX_PKG_SRCURL=https://github.com/termux/proot/archive/${_COMMIT}.zip -TERMUX_PKG_SHA256=8602a43aa0ce16e0f8248cde726eac11938cae78ad04b4ef75a9c62870db3cc5 +TERMUX_PKG_SHA256=185e01d02a0bbf93036d143500e747e06b95fa6056fc1b8c1a093764b467e5b8 TERMUX_PKG_DEPENDS="libtalloc" termux_step_pre_configure() {