Skip to contentSkip to conversation

zephyr.bbclass: Add ability to set board

PATCH New Jon Mason 1 participant 1 message Sep 28, 2020

lore
Share & tools
lore

Jon Mason

author
#0 lore raw

PATCH 1/1 zephyr.bbclass: Add ability to set board

Currently, there is no ability to set the board used by Zephyr. This limits the ability to set the board to something other than the machine name. By setting up an intermediate variable, ZEPHYR_BOARD, this can be set by those that know better (with the default to use the machine name as before).

---
 classes/zephyr.bbclass | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
classes/zephyr.bbclass +2 -3
index 3ea074613117..ead762aea11c 100644
@@ -1,5 +1,3 @@
-
-
 inherit terminal
 
 OE_TERMINAL_EXPORTS += "HOST_EXTRACFLAGS HOSTLDFLAGS TERMINFO CROSS_CURSES_LIB CROSS_CURSES_INC"
@@ -10,11 +8,12 @@ CROSS_CURSES_INC = '-DCURSES_LOC="<curses.h>"'
 TERMINFO = "${STAGING_DATADIR_NATIVE}/terminfo"
 
 KCONFIG_CONFIG_COMMAND ??= "menuconfig"
+ZEPHYR_BOARD ?= "${MACHINE}"
 
 python () {
     # Translate MACHINE into Zephyr BOARD
     # Zephyr BOARD is basically our MACHINE, except we must use "-" instead of "_"
-    board = d.getVar('MACHINE',True)
+    board = d.getVar('ZEPHYR_BOARD', True)
     board = board.replace('-', '_')
     d.setVar('BOARD',board)
 }
Signature · 1 line
2.20.1