Handle Qual DBs based on default board name.

All Qual DBs may be existed in the same directory of hardware_Components (overlaid internal git). So, if QUALDB is not specified, first check the existence of DBs matched the board name. Then remove other DBs not belonging to the board.

TEST=build_packages, build_image, image_to_usb

Review URL: http://codereview.chromium.org/3032036
This commit is contained in:
Tom Wai-Hong Tam 2010-08-05 14:19:45 +08:00
parent 58f25cca72
commit 2272ae5ce2

View File

@ -5,17 +5,25 @@
# found in the LICENSE file. # found in the LICENSE file.
TEST_DIR="${ROOT_FS_DIR}/usr/local/autotest/site_tests/hardware_Components" TEST_DIR="${ROOT_FS_DIR}/usr/local/autotest/site_tests/hardware_Components"
COMPONENTS_FILE="${TEST_DIR}/qualified_components"
# If QUALDB not specified, use the one based on board name. pushd ${TEST_DIR} 1> /dev/null
if [ -z ${QUALDB} ]; then if [ -z ${QUALDB} ]; then
QUALDB="${TEST_DIR}/qualified_components_${BOARD}" # If QUALDB not specified, check the existence of the qualified components
fi # belonging to the board.
QUALDB="qualified_components_${BOARD}*"
if [ ! -z ${QUALDB} ] && [ -f ${QUALDB} ]; then FIRST_QUALDB=$(ls $QUALDB | head -1)
# Copy the qualified component file to the image if [ ! -z ${FIRST_QUALDB} ]; then
echo "Copying ${QUALDB} to the image." # Remove qualified components belonging to other boards
cp -f ${QUALDB} ${COMPONENTS_FILE} ls qualified_components* | grep -v qualified_components_${BOARD} \
| xargs rm -f
else else
echo "No qualified component file found at: ${QUALDB}" echo "No qualified component file found at: ${QUALDB}"
fi fi
else
rm -f qualified_components*
echo "Copying ${QUALDB} to the image."
cp -f ${QUALDB} ${TEST_DIR}/
fi
popd 1> /dev/null