X-Git-Url: https://git.archive.openwrt.org/?a=blobdiff_plain;f=scripts%2Fbundle-libraries.sh;h=869286bdba303b9f3905c43cef372e9afe68fecb;hb=2581b4991e6086ccbc463d6f7311f39c03ca83b6;hp=08b52b9906c7421a8dd8bf8856876a8636d4dedd;hpb=79cadaa2aaaa7a6be76e6bee1e281475fbaa8fff;p=openwrt.git diff --git a/scripts/bundle-libraries.sh b/scripts/bundle-libraries.sh index 08b52b9906..869286bdba 100755 --- a/scripts/bundle-libraries.sh +++ b/scripts/bundle-libraries.sh @@ -1,9 +1,8 @@ #!/usr/bin/env bash # # Script to install host system binaries along with required libraries. -# Refer to the --help output for more information. # -# Copyright (C) 2012 Jo-Philipp Wich +# Copyright (C) 2012-2013 Jo-Philipp Wich # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -90,17 +89,19 @@ for BIN in "$@"; do if [ -n "$LDSO" ]; then _cp "$BIN" "$DIR/bundled/${BIN##*/}" - [ -x "$DIR/bundled/run.sh" ] || { - cat <<-EOF > "$DIR/bundled/run.sh" + RUN="${LDSO#ld-}"; RUN="run-${RUN%%.so*}.sh" + + [ -x "$DIR/bundled/$RUN" ] || { + cat <<-EOF > "$DIR/bundled/$RUN" #!/usr/bin/env bash dir="\$(dirname "\$0")" bin="\$(basename "\$0")" exec -a "\$0" "\$dir/bundled/lib/$LDSO" --library-path "\$dir/bundled/lib" "\$dir/bundled/\$bin" "\$@" EOF - chmod ${VERBOSE:+-v} 0755 "$DIR/bundled/run.sh" + chmod ${VERBOSE:+-v} 0755 "$DIR/bundled/$RUN" } - _ln "./bundled/run.sh" "$DIR/${BIN##*/}" + _ln "./bundled/$RUN" "$DIR/${BIN##*/}" # is a static executable or non-elf binary else