The test suite of PRoot makes many FHS assumptions, such as assuming that /bin, /bin/true, and /usr exist. This patch fixes these assumptions. --- source/tests/GNUmakefile 2017-05-11 15:26:36.899115484 +0200 +++ source/tests/GNUmakefile 2017-05-11 15:26:46.143063166 +0200 @@ -121,7 +121,7 @@ $(ROOTFS_DIR): setup: $(ROOTFS_BIN) $(ROOTFS)/bin/abs-true: - @ln -fs /bin/true $@ + @ln -fs `which true` $@ $(ROOTFS)/bin/rel-true: @ln -fs ./true $@ --- source/tests/test-d2175fc3.sh 2017-05-11 15:36:53.727617010 +0200 +++ source/tests/test-d2175fc3.sh 2017-05-11 15:37:10.155523637 +0200 @@ -2,8 +2,8 @@ if [ ! -x ${ROOTFS}/bin/readlink ] || [ exit 125; fi -${PROOT} -r ${ROOTFS} /bin/readlink /bin/abs-true | grep '^/bin/true$' +${PROOT} -r ${ROOTFS} /bin/readlink /bin/abs-true | grep "`which true`" ${PROOT} -r ${ROOTFS} /bin/readlink /bin/rel-true | grep '^\./true$' -${PROOT} -b /:/host-rootfs -r ${ROOTFS} /bin/readlink /bin/abs-true | grep '^/bin/true$' +${PROOT} -b /:/host-rootfs -r ${ROOTFS} /bin/readlink /bin/abs-true | grep "`which true`" ${PROOT} -b /:/host-rootfs -r ${ROOTFS} /bin/readlink /bin/rel-true | grep '^./true$' --- source/tests/test-d1be631a.sh 2017-05-11 15:41:36.458008715 +0200 +++ source/tests/test-d1be631a.sh 2017-05-11 15:41:38.921994686 +0200 @@ -1,4 +1,4 @@ -if [ -z `which mknod`] || [ `id -u` -eq 0 ]; then +if [ -z `which mknod` ] || [ `id -u` -eq 0 ]; then exit 125; fi --- source/tests/test-5bed7141.c 2017-05-11 15:34:23.088472743 +0200 +++ source/tests/test-5bed7141.c 2017-05-11 15:34:27.052450235 +0200 @@ -80,7 +80,7 @@ int main(int argc, char *argv[]) exit(EXIT_FAILURE); case 0: /* child */ - status = chdir("/usr"); + status = chdir("/gnu"); if (status < 0) { perror("chdir"); exit(EXIT_FAILURE); --- a/tests/test-092c5e26.sh +++ b/tests/test-092c5e26.sh @@ -24,7 +24,7 @@ fi unset LD_LIBRARY_PATH -env PROOT_FORCE_FOREIGN_BINARY=1 PATH=/tmp:/bin:/usr/bin ${PROOT} -r ${ROOTFS} -q echo ${TMP} | grep "^-U LD_LIBRARY_PATH ${EXTRA}-0 /bin/argv0 /bin/argv0 ${TMP_ABS}$" +env PROOT_FORCE_FOREIGN_BINARY=1 PATH=/tmp:/bin:/usr/bin:$(dirname $(which echo)) ${PROOT} -r ${ROOTFS} -q echo ${TMP} | grep "^-U LD_LIBRARY_PATH ${EXTRA}-0 /bin/argv0 /bin/argv0 ${TMP_ABS}$" env PROOT_FORCE_FOREIGN_BINARY=1 ${PROOT} -r ${ROOTFS} -q echo ${TMP_ABS} | grep "^-U LD_LIBRARY_PATH ${EXTRA}-0 /bin/argv0 /bin/argv0 ${TMP_ABS}$" cat > ${ROOTFS}/${TMP_ABS} <