This is a complex use case and probably can be simplified but this is how it happened for me. I had this in my local.conf: MACHINE ??= "intel-corei7-64" PREFERRED_VERSION_linux-intel = "4.12%" PREFERRED_PROVIDER_virtual/kernel = "linux-yocto" When I executed: bitbake -c devshell virtual/kernel Everything worked for the first time. After that I changed the provider to linux-intel to check something and changed linux-intel version to 4.9: bitbake -c devshell virtual/kernel If I switch back to linux-yocto after this - Now everytime I do -c devshell even for linux-intel, I am being taken to the same kernel source directory i.e. for linux-yocto 4.12 version. bitbake is unable to check that it should be unpacking linux-intel again and behaves as if both linux-yocto and linux-intel are same thing. If I do bitbake linux-intel, I get this: ERROR: linux-intel-4.9.76+gitAUTOINC+0c0ae2d617_6e69421d39-r0 do_kernel_version_sanity_check: Package Version (4.9.76+gitAUTOINC+0c0ae2d617_6e69421d39) does not match of kernel being built (4.12.19). Please update the PV variable to match the kernel source or set KERNEL_VERSION_SANITY_SKIP="1" in your recipe. ERROR: linux-intel-4.9.76+gitAUTOINC+0c0ae2d617_6e69421d39-r0 do_kernel_version_sanity_check: Function failed: do_kernel_version_sanity_check (log file is located at /home/anmitta2/work/poky/build/tmp/work/corei7-64-intel-common-poky-linux/linux-intel/4.9.76+gitAUTOINC+0c0ae2d617_6e69421d39-r0/temp/log.do_kernel_version_sanity_check.7010) ERROR: Logfile of failure stored in: /home/anmitta2/work/poky/build/tmp/work/corei7-64-intel-common-poky-linux/linux-intel/4.9.76+gitAUTOINC+0c0ae2d617_6e69421d39-r0/temp/log.do_kernel_version_sanity_check.7010 ERROR: Task (/home/anmitta2/work/poky/meta-intel/recipes-kernel/linux/linux-intel_4.9.bb:do_kernel_version_sanity_check) failed with exit code '1'
I guess the correct workflow should be to cleansstate when switching the providers for a virtual/ package. I didn't do that at the time and this works if I do that. Marking this as not-a-bug.