summaryrefslogtreecommitdiff
path: root/gnu/packages/patches/proot-test-fhs.patch
blob: d3896addd61cf6b10293efa225ad9cf0ef42ebfb (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
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} <<EOF
@@ -34,7 +34,7 @@ chmod +x ${ROOTFS}/${TMP_ABS}
 
 # Valgrind prepends "/bin/sh" in front of foreign binaries.
 if ! $(echo ${PROOT} | grep -q valgrind); then
-    env PATH=/tmp:/bin:/usr/bin ${PROOT} -r ${ROOTFS} -q echo ${TMP} | grep "^-U LD_LIBRARY_PATH -0 ${TMP} ${TMP_ABS}$"
+    env PATH=/tmp:/bin:/usr/bin:$(dirname $(which echo)) ${PROOT} -r ${ROOTFS} -q echo ${TMP} | grep "^-U LD_LIBRARY_PATH -0 ${TMP} ${TMP_ABS}$"
     ${PROOT} -r ${ROOTFS} -q echo ${TMP_ABS}                | grep "^-U LD_LIBRARY_PATH -0 ${TMP_ABS} ${TMP_ABS}$"
 fi
 
diff --git a/tests/test-5467b986.sh b/tests/test-5467b986.sh
index c6ac71a..f616f1e 100644
--- a/tests/test-5467b986.sh
+++ b/tests/test-5467b986.sh
@@ -30,8 +30,8 @@ ${PROOT} -v -1 -b /tmp:/b -b /tmp:/a -r ${ROOTFS} fchdir_getcwd /b | grep '^/[ab
 ! ${PROOT} -w /bin -r ${ROOTFS} fchdir_getcwd true
 [ $? -eq 0 ]
 
-${PROOT} -v -1 -w /usr -r / ${ROOTFS}/bin/chdir_getcwd share  | grep '^/usr/share$'
-${PROOT} -v -1 -w /usr -r / ${ROOTFS}/bin/fchdir_getcwd share | grep '^/usr/share$'
+${PROOT} -v -1 -w /gnu -r / ${ROOTFS}/bin/chdir_getcwd store  | grep '^/gnu/store$'
+${PROOT} -v -1 -w /gnu -r / ${ROOTFS}/bin/fchdir_getcwd store | grep '^/gnu/store$'
 
-(cd /; ${PROOT} -v -1 -w usr -r / ${ROOTFS}/bin/chdir_getcwd share  | grep '^/usr/share$')
-(cd /; ${PROOT} -v -1 -w usr -r / ${ROOTFS}/bin/fchdir_getcwd share | grep '^/usr/share$')
+(cd /; ${PROOT} -v -1 -w gnu -r / ${ROOTFS}/bin/chdir_getcwd store  | grep '^/gnu/store$')
+(cd /; ${PROOT} -v -1 -w gnu -r / ${ROOTFS}/bin/fchdir_getcwd store | grep '^/gnu/store$')

--- a/tests/test-c15999f9.sh
+++ b/tests/test-c15999f9.sh
@@ -5,7 +5,7 @@ fi
 TMP=/tmp/$(mcookie)
 mkdir ${TMP}
 
-${PROOT} -b /bin/true:${TMP}/true /bin/true
+${PROOT} -b `which true`:${TMP}/true `which true`
 ! test -e ${TMP}/true
 [ $? -eq 0 ]