Browse Source

termux-tools: Unset LD_LIBRARY_PATH in wrappers

Previously the wrappers assumed that if
	/system/bin/linker64
that LD_LIBRARY_PATH should be set to /system/lib64. This seems
to not always be the case (see #192) and hopefully the system
binaries should work without LD_LIBRARY_PATH being set, so we
just unset it before calling the system binary.
android-5
Fredrik Fornwall 8 years ago
parent
commit
c9379a3ed8
  1. 11
      packages/termux-tools/build.sh

11
packages/termux-tools/build.sh

@ -1,23 +1,18 @@
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.33 TERMUX_PKG_VERSION=0.34
TERMUX_PKG_PLATFORM_INDEPENDENT=yes TERMUX_PKG_PLATFORM_INDEPENDENT=yes
termux_step_make_install () { termux_step_make_install () {
# Remove LD_LIBRARY_PATH from environment to avoid conflicting # Remove LD_LIBRARY_PATH from environment to avoid conflicting
# with system libraries that am may link against. # with system libraries that system binaries may link against:
for tool in am df getprop logcat ping ping6 ip pm settings; do for tool in am df getprop logcat ping ping6 ip pm settings; do
WRAPPER_FILE=$TERMUX_PREFIX/bin/$tool WRAPPER_FILE=$TERMUX_PREFIX/bin/$tool
echo '#!/bin/sh' > $WRAPPER_FILE echo '#!/bin/sh' > $WRAPPER_FILE
echo 'unset LD_LIBRARY_PATH' >> $WRAPPER_FILE
# Some of these tools (am,dalvikvm,?) requires LD_LIBRARY_PATH setup on at least some devices:
echo 'if [ -f /system/bin/linker64 ]; then BITS=64; else BITS=; fi' >> $WRAPPER_FILE
echo -n 'LD_LIBRARY_PATH=/system/lib$BITS ' >> $WRAPPER_FILE
# Some tools require having /system/bin/app_process in the PATH, # Some tools require having /system/bin/app_process in the PATH,
# at least am&pm on a Nexus 6p running Android 6.0: # at least am&pm on a Nexus 6p running Android 6.0:
echo -n 'PATH=$PATH:/system/bin ' >> $WRAPPER_FILE echo -n 'PATH=$PATH:/system/bin ' >> $WRAPPER_FILE
echo "exec /system/bin/$tool \"\$@\"" >> $WRAPPER_FILE echo "exec /system/bin/$tool \"\$@\"" >> $WRAPPER_FILE
chmod +x $TERMUX_PREFIX/bin/$tool chmod +x $TERMUX_PREFIX/bin/$tool
done done

Loading…
Cancel
Save