meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
sw:yocto:bitbake:tips [2023/06/22 09:21] niziaksw:yocto:bitbake:tips [2025/06/11 11:55] (current) niziak
Line 2: Line 2:
  
   * [[https://stackoverflow.com/questions/51002891/overwriting-yocto-classes-through-meta-layer|Overwriting Yocto Classes through meta-layer]]   * [[https://stackoverflow.com/questions/51002891/overwriting-yocto-classes-through-meta-layer|Overwriting Yocto Classes through meta-layer]]
 +
 +===== Pass env variables to bitbake =====
 +
 +To control additional or user defined recipe's variables from env (usefull for CI) add variables to ''BB_ENV_PASSTHROUGH_ADDITIONS'':
 +<code bash>
 +export foo="BAR"
 +export BB_ENV_PASSTHROUGH_ADDITIONS="${BB_ENV_PASSTHROUGH_ADDITIONS} foo BUILD_VERSION CI_COMMIT_BRANCH CI_COMMIT_SHORT_SHA"
 +bitbake ...
 +</code>
 +
 +
 +
 +
 +===== add files to rootfs =====
 +
 +''IMAGE_PREPROCESS_COMMAND += "rsync -a --exclude=.git ${FILE_SRC}/rootfs/* ${WORKDIR}/rootfs;"''
  
 ===== override .conf ===== ===== override .conf =====
  
 No override or appends mechanism. But some workaround possible: No override or appends mechanism. But some workaround possible:
 +
   - override variables in ''local.conf''   - override variables in ''local.conf''
   - create new conf file and inherit old one with ''require''   - create new conf file and inherit old one with ''require''
   - create new conf file with the same name to mask old file (take care of layer priority)   - create new conf file with the same name to mask old file (take care of layer priority)
- 
  
 ===== MACHINEOVERRIDES ===== ===== MACHINEOVERRIDES =====
  
 When creatung new machine.conf based on existing one [[https://docs.yoctoproject.org/ref-manual/variables.html?highlight=machineoverrides#term-MACHINEOVERRIDES|MACHINEOVERRIDES]] can be used: When creatung new machine.conf based on existing one [[https://docs.yoctoproject.org/ref-manual/variables.html?highlight=machineoverrides#term-MACHINEOVERRIDES|MACHINEOVERRIDES]] can be used:
- 
- 
  
 [[https://github.com/Freescale/meta-freescale/blob/master/classes/machine-overrides-extender.bbclass|machine-overrides-extender.bbclass]] [[https://github.com/Freescale/meta-freescale/blob/master/classes/machine-overrides-extender.bbclass|machine-overrides-extender.bbclass]]
Line 25: Line 39:
  
 bb.debug("HELLO = %s" % HELLO) bb.debug("HELLO = %s" % HELLO)
 +
 </code> </code>
 +