${D}
is the usual top of the path used by a Yocto recipe where the recipe installs files that belong to packages produced by this recipe. These directories under ${D}
are scanned by the build system for files to include into packages (like RPM files) and to be included in the so-called sysroot tree where files (e.g. libraries and headers) go that are used by other packages. There are some default rules for this scan and the rules can be expanded.
It is recommended to use these Yocto default paths under ${D}
as much as possible to benefit from the built-in mechanisms of Yocto.
${libdir}
is defined in bitbake.conf by default as: ${exec_prefix}/lib
which is /usr/lib
by default, defined in the same file.
install -d ${D}${libdir}
In the end this "install" shell command just creates a directory where files are to be saved (e.g. by do_install) that should finally be installed under /usr/lib
on the target.
${D}/a/b/c
for file c
is just the intermediate path used for Yocto packaging and ${D}
is "cut away" when the same file c
is on the target filesystem.
So for instance ${D}/a/b/c
will be at /a/b/c
on the target.
${D}
is defined by default in poky/meta/conf/bitbake.conf as:
TMPDIR = "${TOPDIR}/tmp"
BASE_WORKDIR ?= "${TMPDIR}/work"
WORKDIR = "${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}/${PN}/${EXTENDPE}${PV}-${PR}"
D = "${WORKDIR}/image"