rmc-db: allow multiple fingerprint per board directory

Different firmware revisions often result in different fingerprints for
the same hardware platform. This change allows multiple fingerprints to
be stored in the same board directory to avoid having to duplicate the
data for each record.

Signed-off-by: Todor Minchev <todor.minchev@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
This commit is contained in:
Todor Minchev 2017-06-07 15:24:23 -07:00 committed by Saul Wold
parent 489a786469
commit ac83d7c726

View File

@ -60,7 +60,6 @@ rmc_generate_db () {
# For all board dirs in a topdir: # For all board dirs in a topdir:
CUR_BOARD_DIRS=$(find ${topdir}/* -type d) CUR_BOARD_DIRS=$(find ${topdir}/* -type d)
for board_dir in ${CUR_BOARD_DIRS}; do for board_dir in ${CUR_BOARD_DIRS}; do
# FIXME: we shall fail when having more than one .fp file
CUR_FINGERPRINT=$(find ${board_dir}/ -name "*.fp") CUR_FINGERPRINT=$(find ${board_dir}/ -name "*.fp")
# disallow a board directory without any fingerprint file in it. # disallow a board directory without any fingerprint file in it.
@ -77,14 +76,15 @@ rmc_generate_db () {
continue continue
fi fi
CUR_TAG=$(echo "${board_dir}"|sed 's/\//-/g') for fp in ${CUR_FINGERPRINT}; do
CUR_RECORD=${RMC_DB_DIR}/rmc${CUR_TAG}.rec fullname=$(basename ${fp})
CUR_TAG="${fullname%.*}"
rmc -R -f ${CUR_FINGERPRINT} -b ${CUR_FILES} -o ${CUR_RECORD} CUR_RECORD=${RMC_DB_DIR}/${CUR_TAG}.rec
rmc -R -f ${fp} -b ${CUR_FILES} -o ${CUR_RECORD}
RMC_RECORDS="${RMC_RECORDS} ${CUR_RECORD}" RMC_RECORDS="${RMC_RECORDS} ${CUR_RECORD}"
done done
done done
done
if [ ! -z "${RMC_RECORDS}" ]; then if [ ! -z "${RMC_RECORDS}" ]; then
rmc -D ${RMC_RECORDS} -o "$2" rmc -D ${RMC_RECORDS} -o "$2"