a) KERNEL_FEATURES=" features/nfsd/nfsd-enable.scc features/debug/printk.scc cfg/fs/vfat.scc features/kernel-sample/kernel-sample.scc features/netfilter/netfilter.scc cfg/virtio.scc features/drm-bochs/drm-bochs.scc features/scsi/scsi-debug.scc features/gpio/mockup.scc " b) KERNEL_FEATURES=" features/nfsd/nfsd-enable.scc features/debug/printk.scc cfg/fs/vfat.scc features/kernel-sample/kernel-sample.scc features/netfilter/netfilter.scc cfg/virtio.scc features/drm-bochs/drm-bochs.scc features/scsi/scsi-debug.scc features/gpio/mockup.scc KERNEL_FEATURES:append = " ${@bb.utils.contains("DISTRO_FEATURES", "apparmor", "features/apparmor/apparmor.scc", "" ,d)}" When this DISTRO FEATURES is not set it appends a space as seen in "a" and changes the signature of the KERNEL_FEATURES variables.
It would do since you're doing KERNEL_FEATURES:append = " XXX", i.e. there is an unconditional space in there. Move the space into the conditional, i.e. " features/apparmor/apparmor.scc".