From c99d607df3b0bd19813a9139479358b26943ef72 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Tue, 27 Oct 2015 17:22:35 -0400 Subject: find_board(): Finish --- diff --git a/src/board.sh b/src/board.sh index 7f0d031..dfd128d 100644 --- a/src/board.sh +++ b/src/board.sh @@ -30,12 +30,21 @@ register_board() find_board() { + local vendor="${1}" + local part="${2}" + local chip="${3}" + shift 3 local board= local fn= - board='x200_8mb' - - for fn in ${board_functions}; do - eval "board_${fn}() { board_${board}_${fn} \"\${@}\"; }" + for board in ${boards}; do + if ! board_${board}_match "${vendor}" "${part}" "${chip}"; then + continue + fi + for fn in ${board_functions}; do + eval "board_${fn}() { board_${board}_${fn} \"\${@}\"; }" + done + return 0 done + return 1 } -- cgit v0.9.1