summaryrefslogtreecommitdiffstats
path: root/system/statifier/detect_vdso.diff
blob: 8ff51f75c56abb02d7405dcd7ee049bdb8c8b5d9 (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
diff -Naur statifier-1.7.4/src/statifier statifier-1.7.4.patched/src/statifier
--- statifier-1.7.4/src/statifier	2015-10-23 05:17:13.000000000 -0400
+++ statifier-1.7.4.patched/src/statifier	2018-01-19 15:04:54.809053542 -0500
@@ -7,4 +7,20 @@
 # modify it under the terms of the GNU General Public License.
 # See LICENSE file in the doc directory.
 
+# Modified by B. Watson for the SlackBuilds.org project: detects
+# whether VDSO has been disabled and prints a warning if not.
+if ldd /bin/ls | grep -q 'linux-\(gate\|vdso\)\.'; then
+  echo "VDSO is enabled. Converted binary will likely segfault when run."
+  if [ -e /proc/sys/vm/vdso_enabled ]; then
+    cat <<EOF
+Disable VDSO by running this command, as root:
+  echo "0" > /proc/sys/vm/vdso_enabled
+EOF
+  else
+     cat <<EOF
+To disable VDSO, reboot with 'vdso=0 vdso32=0' on the kernel command line.
+EOF
+  fi
+fi
+
 ${STATIFIER_ROOT_DIR:-/usr/lib/statifier}/statifier.sh "$@"