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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « scripts/image_signing/ensure_no_nonrelease_files.config ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/bin/bash
2
3 # Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file.
6
7 # Abort on error.
8 set -e
9
10 # Load common constants and variables.
11 . "$(dirname "$0")/common.sh"
12
13 usage() {
14 echo "Usage $PROG image [config]"
15 }
16
17 main() {
18 # We want to catch all the discrepancies, not just the first one.
19 # So, any time we find one, we set testfail=1 and continue.
20 # When finished we will use testfail to determine our exit value.
21 local testfail=0
22
23 if [ $# -ne 1 ] && [ $# -ne 2 ]; then
24 usage
25 exit 1
26 fi
27
28 local image="$1"
29
30 # Default config location: same name/directory as this script,
31 # with a .config file extension, ie ensure_no_nonrelease_files.config.
32 local configfile="$(dirname "$0")/${0/%.sh/.config}"
33 # Or, maybe a config was provided on the command line.
34 if [ $# -eq 2 ]; then
35 configfile="$2"
36 fi
37 # Either way, load test-expectations data from config.
38 . "$configfile"
39
40 local rootfs=$(make_temp_dir)
41 mount_image_partition_ro "$image" 3 "$rootfs"
42
43 for file in ${RELEASE_FILE_BLACKLIST[@]}; do
44 if [ -e "$rootfs/$file" ]; then
45 echo "FAIL: $file exists in this image!"
46 ls -al "$rootfs/$file"
47 testfail=1
48 fi
49 done
50
51 exit $testfail
52 }
53 main $@
OLDNEW
« 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