If you run devtool modify on the kernel, run bitbake -c clean, then try to build the kernel again the configuration will be different: devtool modify virtual/kernel bitbake virtual/kernel cp tmp/work-shared/qemux86-64/kernel-build-artifacts/.config kconfig-good bitbake -c clean virtual/kernel bitbake virtual/kernel diff -udN kconfig-good tmp/work/qemux86_64-poky-linux/linux-yocto/4.12.14+git999-r0/linux-yocto-4.12.14+git999/.config (The second build of the kernel will almost certainly fail because it will try to generate X.509 certificates and openssl-native isn't in DEPENDS, so the openssl command won't be available to run.) There is some logic set up in the workspace bbappend for the kernel that sets up the configuration, and I suspect this is where the problem lies - it moves the configuration into place from ${S} to ${B} the first time but the second time around it's not there to move, and you get the default kernel configuration instead.
May also need a test.
Bulk move from 4.99 or 0.00 to 5.99
I found that the do_kernel_configme:prepend function standard.py unconditionally moved existing .config files, causing legitimate user configurations to be lost after clean/rebuild cycles. I changed the logic to preserve legitimate user configurations by checking for .config.baseline presence: # Before (problematic): if [ -e ${S}/.config ]; then mv ${S}/.config ${S}/.config.old fi # After: if [ -e ${S}/.config ] && [ ! -e ${S}/.config.baseline ]; then mv ${S}/.config ${S}/.config.old fi User configs with.config.baseline are preserved and stale configs without .config.baseline are moved appropriately. Patch available for integration.
Created attachment 5128 [details] Fix for kernel config loss in devtool modify workflow The do_kernel_configme:prepend function in scripts/lib/devtool/standard.py unconditionally moved existing .config files, causing legitimate user configurations to be lost after clean/rebuild cycles. Enhanced the logic to preserve legitimate user configurations by checking for .config.baseline presence: # Before: if [ -e ${S}/.config ]; then mv ${S}/.config ${S}/.config.old fi # After: if [ -e ${S}/.config ] && [ ! -e ${S}/.config.baseline ]; then mv ${S}/.config ${S}/.config.old fi