A execve() wrapper to fix problem with shebangs when running in NeoTerm.
A lot of Linux software is written with the assumption that /bin/sh, /usr/bin/env
and similar file exists. This is not the case on Android where neither /bin/ nor /usr/
exists.
When building packages for NeoTerm those hard-coded assumptions are patched away - but this does not help with installing scripts and programs from other sources than NeoTerm packages.
Create an execve() wrapper that rewrites calls to execute files under /bin/ and /usr/bin
into the matching NeoTerm executables under $PREFIX/bin/ and inject that into processes
using LD_PRELOAD.
- Install with
pkg install neoterm-exec. - Exit your current session and start a new one.
- From now on shebangs such as
/bin/shand/usr/bin/env pythonshould work.
The $PREFIX/bin/login program which is used to create new NeoTerm sessions checks for
$PREFIX/lib/libneoterm-exec.so and if so sets up LD_PRELOAD before launching the login shell.