Back to Articles

Common Yocto Variables

Common Variables for Yocto Recipes

Common Yocto Variables

When writing Yocto recipes there are some common variables that can be used, espcially in the do_install() section

An example of this would be:

do_install() {
  install -d ${D}${bindir}
  install -m 0644 ${S}/my_program ${D}${bindir}
}

These variables are defined in the file poky/meta/conf/bitbake.conf with some of the more useful ones listed below

Useful variables
Variable Value
bindir /usr/bin
sbindir /usr/sbin
libdir /usr/lib
sysconfdir /etc
sharedstatedir /com
localstatedir /srv
datadir /usr/share
infodir /usr/info
mandir /usr/man
docdir /usr/doc
systemd_unitdir /usr/lib/systemd
systemd_system_unitdir /usr/lib/systemd/system
systemd_user_unitdir /usr/lib/systemd/user
includedir /usr/include