summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJim Hebert <jimhebert@chromium.org>2011-10-19 15:26:04 -0700
committerJim Hebert <jimhebert@chromium.org>2011-10-19 16:04:11 -0700
commit7f253ebc030cfa3ab69c72f6159e04922e55b617 (patch)
treee0963a5f0a9c23f855fdabb32f3451639354d9b7 /scripts
parent6b0003c6381a7e69818b0b34b358c2cfb1393043 (diff)
downloadvboot-7f253ebc030cfa3ab69c72f6159e04922e55b617.tar.gz
Add test script that can determine if a build contains ASAN-binaries.factory-1235.B
BUG=chromium-os:21863 TEST=ensure_not_ASAN.sh image.bin Change-Id: I414f941a787e0023257401bb8ed7b4a5257f026a Reviewed-on: http://gerrit.chromium.org/gerrit/10352 Reviewed-by: Gaurav Shah <gauravsh@chromium.org> Tested-by: Jim Hebert <jimhebert@chromium.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/image_signing/ensure_not_ASAN.sh35
1 files changed, 35 insertions, 0 deletions
diff --git a/scripts/image_signing/ensure_not_ASAN.sh b/scripts/image_signing/ensure_not_ASAN.sh
new file mode 100755
index 00000000..aeb8b6c9
--- /dev/null
+++ b/scripts/image_signing/ensure_not_ASAN.sh
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# Abort on error.
+set -e
+
+# Load common constants and variables.
+. "$(dirname "$0")/common.sh"
+
+usage() {
+ echo "Usage $PROG image"
+}
+
+main() {
+ if [ $# -ne 1 ]; then
+ usage
+ exit 1
+ fi
+
+ local image="$1"
+
+ local rootfs=$(make_temp_dir)
+ mount_image_partition_ro "$image" 3 "$rootfs"
+
+ # This mirrors the check performed in the platform_ToolchainOptions
+ # autotest.
+ if readelf -s "$rootfs/opt/google/chrome/chrome" | \
+ grep -q __asan_init; then
+ exit 1
+ fi
+}
+main $@