When building core-image-minimal on poky (in my case this is being built for custom hardware loosely based on the BBG reference), yocto writes a hostname to /etc/hostname on the file system image.
Occasionally it is preferable to exclude the creation of the hostname file during the fs image build, and instead generate a hostname, and subsequently an /etc/hostname file, dynamically the first time a device boots the image.
An example implementation would be the employment of systemd and a 'firstboot' unit file that uses ConditionPathExists=|!/etc/hostname to determine the need to generate a hostname.
So, where is the most appropriate place/method for disabling the creation of /etc/hostname?