update: Moved board detection to a function

* Moved code that detected the board into a separate function and turned
  on profiling on it.

* Removed a bogous print

Signed-off-by: mr.Shu <mr@shu.io>