From bfafc9cfd23b52ba12351b098dceaf3003031677 Mon Sep 17 00:00:00 2001 From: Tom Wai-Hong Tam Date: Sat, 21 Aug 2010 04:03:55 +0800 Subject: [PATCH] Populate the GBB blob files to factory image. We use the filename format gbb_${BOARD}_${HWID} for GBB blob files and place them in the same directory of site_tests/factory_WriteGBB, but in private git. Actually, these files will be automatically put in the factory image. This change is to remove those not belonging to the same board. Also do some fixes and rename QualDbs stuffs. TEST=run image_to_usb.sh and check the gbb files. BUG=chrome-os-partner:789 Change-Id: I5913a14eb3ceef5abfdf1a87156faa6bb7dbd561 Review URL: http://codereview.chromium.org/3111014 --- .../{500copyQualDb => 500populateQualDbs} | 6 +++--- mod_for_factory_scripts/510populateGbbFiles | 20 +++++++++++++++++++ 2 files changed, 23 insertions(+), 3 deletions(-) rename mod_for_factory_scripts/{500copyQualDb => 500populateQualDbs} (82%) create mode 100755 mod_for_factory_scripts/510populateGbbFiles diff --git a/mod_for_factory_scripts/500copyQualDb b/mod_for_factory_scripts/500populateQualDbs similarity index 82% rename from mod_for_factory_scripts/500copyQualDb rename to mod_for_factory_scripts/500populateQualDbs index 778d8dc600..646f36c6d2 100755 --- a/mod_for_factory_scripts/500copyQualDb +++ b/mod_for_factory_scripts/500populateQualDbs @@ -12,11 +12,11 @@ if [ -z ${QUALDB} ]; then # If QUALDB not specified, check the existence of the qualified components # belonging to the board. QUALDB="qualified_components_${BOARD}*" - FIRST_QUALDB=$(ls $QUALDB | head -1) + FIRST_QUALDB=$(ls $QUALDB 2> /dev/null | head -1) if [ ! -z ${FIRST_QUALDB} ]; then # Remove qualified components belonging to other boards - ls qualified_components* | grep -v qualified_components_${BOARD} \ - | xargs rm -f + ls qualified_components* 2> /dev/null | grep -v \ + qualified_components_${BOARD} | xargs rm -f else echo "No qualified component file found at: ${QUALDB}" fi diff --git a/mod_for_factory_scripts/510populateGbbFiles b/mod_for_factory_scripts/510populateGbbFiles new file mode 100755 index 0000000000..4a017e9f06 --- /dev/null +++ b/mod_for_factory_scripts/510populateGbbFiles @@ -0,0 +1,20 @@ +#!/bin/bash + +# Copyright (c) 2010 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. + +TEST_DIR="${ROOT_FS_DIR}/usr/local/autotest/site_tests/factory_WriteGBB" + +pushd ${TEST_DIR} 1> /dev/null + +GBB_FILE="gbb_${BOARD}*" +FIRST_GBB_FILE=$(ls $GBB_FILE 2> /dev/null | head -1) +if [ -e "${FIRST_GBB_FILE}" -o "${BOARD}" = "x86-generic" ]; then + # Remove GBB files belonging to other boards + ls gbb* 2> /dev/null | grep -v gbb_${BOARD} | xargs rm -f +else + echo "No GBB file found at: ${GBB_FILE}" +fi + +popd 1> /dev/null