Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(812)

Unified Diff: scripts/image_signing/ensure_no_nonrelease_files.sh

Issue 6264023: Script to check for blacklisted files as described in chrome-os-partner:1991 (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/vboot_reference.git@master
Patch Set: Fix review items. Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « scripts/image_signing/ensure_no_nonrelease_files.config ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/image_signing/ensure_no_nonrelease_files.sh
diff --git a/scripts/image_signing/ensure_no_nonrelease_files.sh b/scripts/image_signing/ensure_no_nonrelease_files.sh
new file mode 100755
index 0000000000000000000000000000000000000000..e2e437f663e618446d90fc83fc09492e3bf254fc
--- /dev/null
+++ b/scripts/image_signing/ensure_no_nonrelease_files.sh
@@ -0,0 +1,53 @@
+#!/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 [config]"
+}
+
+main() {
+ # We want to catch all the discrepancies, not just the first one.
+ # So, any time we find one, we set testfail=1 and continue.
+ # When finished we will use testfail to determine our exit value.
+ local testfail=0
+
+ if [ $# -ne 1 ] && [ $# -ne 2 ]; then
+ usage
+ exit 1
+ fi
+
+ local image="$1"
+
+ # Default config location: same name/directory as this script,
+ # with a .config file extension, ie ensure_no_nonrelease_files.config.
+ local configfile="$(dirname "$0")/${0/%.sh/.config}"
+ # Or, maybe a config was provided on the command line.
+ if [ $# -eq 2 ]; then
+ configfile="$2"
+ fi
+ # Either way, load test-expectations data from config.
+ . "$configfile"
+
+ local rootfs=$(make_temp_dir)
+ mount_image_partition_ro "$image" 3 "$rootfs"
+
+ for file in ${RELEASE_FILE_BLACKLIST[@]}; do
+ if [ -e "$rootfs/$file" ]; then
+ echo "FAIL: $file exists in this image!"
+ ls -al "$rootfs/$file"
+ testfail=1
+ fi
+ done
+
+ exit $testfail
+}
+main $@
« no previous file with comments | « scripts/image_signing/ensure_no_nonrelease_files.config ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698