If BR2_TARGET_ROOTFS_CPIO is selected, the next time linux-menuconfig is run CONFIG_BLK_DEV_INITRD becomes selected. If CONFIG_BLK_DEV_INITRD is unselected, it is silently reselected when linux-menuconfig exits. Therefore, it is not possible to generate rootfs.cpio without building it into the kernel image.
Indeed, linux/linux.mk contains: $(if $(BR2_TARGET_ROOTFS_CPIO), $(call KCONFIG_ENABLE_OPT,CONFIG_BLK_DEV_INITRD,$(@D)/.config)) Which forces CONFIG_BLK_DEV_INITRD to be set when you're generating a cpio image of the filesystem. What is your use-case for generating a cpio image, but not enabling CONFIG_BLK_DEV_INITRD ?
(In reply to Thomas Petazzoni from comment #1) My use case is to generate a build that can be made into a disk image and also be PXE booted. For PXE booting, I need the cpio file. But for installing to disk, I don't want the root filesystem built in to the kernel.
(In reply to adyke from comment #2) CONFIG_BLK_DEV_INITRD does not link the cpio image into the kernel. It only makes it possible that the bootloader passes a cpio image to the kernel. To link it into the kernel, the option CONFIG_INITRAMFS_SOURCE must be non-empty. Buildroot will set this option when you enable the "initial RAM filesystem linked into linux kernel". However, when you unset this option again, the CONFIG_INITRAMFS_SOURCE is *not* removed from the kernel configuration. Indeed, Buildroot has no way to know if this was added by Buildroot itself, or if it was set by the user to refer to an externally-generated initramfs. So I guess you are in this situation. The CONFIG_BLK_DEV_INITRD option is on in most defconfig and just has a few KB overhead, so it is not worth removing this from linux.mk IMO. Therefore, I'm marking this as WONTFIX. If you disagree, or if you see some other problem, feel free to reopen.