diff --git a/scripts/ablrun_part b/scripts/ablrun_part index 5c15952..af180fb 100755 --- a/scripts/ablrun_part +++ b/scripts/ablrun_part @@ -82,6 +82,16 @@ ablrun_nocap() { # This method also use for root user. } +ablrun_nocap_noreplace() { + exec bwrap \ + --dev-bind / / \ + --bind /usr/${ABL_DIR_PREFIX}/additional-base-lib/"$ABL_TARGET_LD_SO_PATH" "$ABL_LD_SO_PATH" \ + --bind /usr/${ABL_DIR_PREFIX}/additional-base-lib/libc.so.6 "$ABL_LIBC_SO_PATH" \ + --bind /usr/${ABL_DIR_PREFIX}/additional-base-lib/ldd /usr/bin/ldd \ + --setenv LD_LIBRARY_PATH "$ABL_LIBRARY_PATH" \ + "$@" +} + if [ `whoami` = "root" ] then ablrun_nocap "$@" @@ -129,8 +139,8 @@ then read -u ${COPROC[0]} ABLIMAGE_DIR - `ablrun_nocap "$ABLIMAGE_DIR/AppRun" "${ABLIMAGE_PARAMETERS[@]:1}"` - # Use coproc, no exec here. This is trick to spawn a subprocess + ablrun_nocap_noreplace "$ABLIMAGE_DIR/AppRun" "${ABLIMAGE_PARAMETERS[@]:1}" + # Use coproc, so no exec here. exit fi fi