termux-tools: Try a more functional su wrapper

This commit is contained in:
Fredrik Fornwall 2016-08-31 17:39:18 -04:00
parent 8c1c670325
commit 0ee447355b
2 changed files with 10 additions and 5 deletions

View File

@ -1,6 +1,6 @@
TERMUX_PKG_HOMEPAGE=https://termux.com/ TERMUX_PKG_HOMEPAGE=https://termux.com/
TERMUX_PKG_DESCRIPTION="Basic system tools for Termux" TERMUX_PKG_DESCRIPTION="Basic system tools for Termux"
TERMUX_PKG_VERSION=0.28 TERMUX_PKG_VERSION=0.29
TERMUX_PKG_PLATFORM_INDEPENDENT=yes TERMUX_PKG_PLATFORM_INDEPENDENT=yes
termux_step_make_install () { termux_step_make_install () {

View File

@ -1,11 +1,16 @@
#!/bin/sh #!/data/data/com.termux/files/usr/bin/sh
ROOT_SHELL=$PREFIX/bin/bash
if test -x "$HOME/.termux/shell"; then ROOT_SHELL=`readlink -f $HOME/.termux/shell`; fi
for p in /system/xbin/su /su/bin/su for p in /system/xbin/su /su/bin/su
do do
if [ -x $p ]; then if [ -x $p ]; then
# The su tool may require programs # The su tool may require programs in PATH:
# from /system/bin in path: PATH=$PATH:/su/bin:/su/xbin:/system/bin:/system/xbin \
PATH=/system/bin:$PATH exec $p $@ exec $p \
--preserve-environment \
-c "LD_LIBRARY_PATH=$PREFIX/lib $ROOT_SHELL"
fi fi
done done