tarinstall/posix/preload
Alessandro Mauri 0b1149518d more complete version of the prepare script
- dependencies are fetched recursively
- script is more verbose
- increased compression ratio of package
- strip preload of comments before injection
- more I am missing
2020-08-22 13:35:31 +02:00

20 lines
478 B
Bash
Executable File

#!/bin/sh -e
# TODO: verify checksum before extracting
# SUM
# TODO: extract self without resolving to $0 because it doesn't resolve links
tail -c +"$(expr BYTES + 1)" $0 | lz4 -dc | tar -x
# TODO: remove hardcoded directory
# TODO: use a different extraction path
cd ID
export ORIGIN="$(pwd)"
export LD_LIBRARY_PATH="$ORIGIN/lib"
export PATH="$ORIGIN/bin":$PATH
#export LD_DEBUG='libs'
# TODO: use $0 instead
# FIXME: uses the system's basename
exec bin/"$(basename "$1")"