When configuring a linux kernel, i often stumble across options which can't be deselected, because they are automatically selected by other options. Usually, the Selected by:
line only lists a few options, making it easy to find the culprit. But sometimes you are presented with a huge boolean expression, containing dozens or even hundreds of individual options.
On my platform, two examples of this would be the top-level options Patch physical to virtual translations at runtime
and Cryptographic API
.
The first one is easy, with only a few options:
Selected by: ARCH_MULTIPLATFORM [=y] && <choice> && MMU [=y]
The second one however, is a bit more complex (194 options):
Selected by: SYSTEM_DATA_VERIFICATION [=n] || BT [=n] && NET [=y] && !S390 && (RFKILL [=n] || !RFKILL [=n]) || AF_RXRPC [=n] && NET [=y] && INET [=y] || RXKAD [=n] && NET [=y] && AF_RXRPC [=n] || CEPH_LIB [=n] && NET [=y] && INET [=y] || TLS [=n] && NET [=y] && INET [=y] || XFRM_ALGO [=y] && NET [=y] || XFRM_IPCOMP [=n] && NET [=y] || INET [=y] && NET [=y] || IP_SCTP [=n] && NET [=y] && INET [=y] && (IPV6 [=y] || IPV6 [=y]=n) || MAC802154 [=n] && NET [=y] && IEEE802154 [=n] || INET_AH [=n] && NET [=y] && INET [=y] || INET_ESP [=n] && NET [=y] && INET [=y] || TCP_MD5SIG [=n] && NET [=y] && INET [=y] || INET6_AH [=n] && NET [=y] && INET [=y] && IPV6 [=y] || INET6_ESP [=n] && NET [=y] && INET [=y] && IPV6 [=y] || MAC80211 [=n] && NET [=y] && WIRELESS [=n] && CFG80211 [=n] || NFC_S3FWRN5 [=n] && NET [=y] && NFC [=n] || THUNDERBOLT [=n] && PCI [=n] && (X86 || COMPILE_TEST [=n]) || BLK_DEV_CRYPTOLOOP [=n] && BLK_DEV [=y] && BLK_DEV_LOOP [=n] || BLK_DEV_RBD [=n] && BLK_DEV [=y] && INET [=y] && BLOCK [=y] || ISCSI_TCP [=n] && SCSI_LOWLEVEL [=n] && SCSI [=n] && INET [=y] || DM_CRYPT [=n] && MD [=n] && BLK_DEV_DM [=n] || DM_VERITY [=n] && MD [=n] && BLK_DEV_DM [=n] || DM_INTEGRITY [=n] && MD [=n] && BLK_DEV_DM [=n] || ISCSI_TARGET [=n] && TARGET_CORE [=n] && NET [=y] || MACSEC [=n] && NETDEVICES [=y] && NET_CORE [=y] || PPP_MPPE [=n] && NETDEVICES [=y] && PPP [=n] || AIRO [=n] && NETDEVICES [=y] && WLAN [=n] && WLAN_VENDOR_CISCO [=n] && CFG80211 [=n] && ISA_DMA_API [=n] && (PCI [=n] || BROKEN [=n]) || AIRO_CS [=n] && NETDEVICES [=y] && WLAN [=n] && WLAN_VENDOR_CISCO [=n] && CFG80211 [=n] && PCMCIA [=n] && (BROKEN [=n] || !M32R) || LIBIPW [=n] && NETDEVICES [=y] && WLAN [=n] && WLAN_VENDOR_INTEL [=n] && PCI [=n] && CFG80211 [=n] || HOSTAP [=n] && NETDEVICES [=y] && WLAN [=n] && WLAN_VENDOR_INTERSIL [=n] || HERMES [=n] && NETDEVICES [=y] && WLAN [=n] && WLAN_VENDOR_INTERSIL [=n] && (PPC_PMAC || PCI [=n] || PCMCIA [=n]) && CFG80211 [=n] || TCG_TPM [=n] && HAS_IOMEM [=y] || USB_WUSB [=n] && USB_SUPPORT [=n] && USB [=n] && UWB [=n] || RTL8192U [=n] && STAGING [=n] && PCI [=n] && WLAN [=n] && USB [=n] && m && MODULES [=y] || LUSTRE_FS [=n] && STAGING [=n] && m && MODULES [=y] && !MIPS && !XTENSA && ! SUPERH && LNET [=n] && MULTIUSER [=y] || RTL8192E [=n] && STAGING [=n] && PCI [=n] && WLAN [=n] && RTLLIB [=n] && m && MODULES [=y] || FS_ENCRYPTION [=n] || EXT3_FS [=y] && BLOCK [=y] || EXT4_FS [=y] && BLOCK [=y] || JBD2 [=y] && BLOCK [=y] || BTRFS_FS [=n] && BLOCK [=y] || F2FS_FS [=n] && BLOCK [=y] || UBIFS_FS [=y] && MISC_FILESYSTEMS [=y] && MTD_UBI [=y] && UBIFS_FS_ADVANCED_COMPR [=n] || UBIFS_FS [=y] && MISC_FILESYSTEMS [=y] && MTD_UBI [=y] && UBIFS_FS_LZO [=y] || UBIFS_FS [=y] && MISC_FILESYSTEMS [=y] && MTD_UBI [=y] && UBIFS_FS_ZLIB [=y] || NFSD_V4 [=n] && NETWORK_FILESYSTEMS [=y] && NFSD [=n] && PROC_FS [=y] || CEPH_FS [=n] && NETWORK_FILESYSTEMS [=y] && INET [=y] || CIFS [=y] && NETWORK_FILESYSTEMS [=y] && INET [=y] || BIG_KEYS [=n] && KEYS [=y] && TMPFS [=y] || TRUSTED_KEYS [=n] && KEYS [=y] && TCG_TPM [=n] || ENCRYPTED_KEYS [=n] && KEYS [=y] || KEY_DH_OPERATIONS [=n] && KEYS [=y] || SECURITY_APPARMOR_HASH [=n] && SECURITY_APPARMOR [=n] || IMA [=n] && INTEGRITY [=n] || CRC_T10DIF [=n] || LIBCRC32C [=n] || SIGNATURE [=n] && KEYS [=y]
With some effort, this can be shortened to:
XFRM_ALGO [=y] && NET [=y]
|| INET [=y] && NET [=y]
|| EXT3_FS [=y] && BLOCK [=y]
|| EXT4_FS [=y] && BLOCK [=y]
|| JBD2 [=y] && BLOCK [=y]
|| UBIFS_FS [=y] && MISC_FILESYSTEMS [=y] && MTD_UBI [=y] && UBIFS_FS_LZO [=y]
|| UBIFS_FS [=y] && MISC_FILESYSTEMS [=y] && MTD_UBI [=y] && UBIFS_FS_ZLIB [=y]
|| CIFS [=y] && NETWORK_FILESYSTEMS [=y] && INET [=y]
Is there an easy (automated) way to get only those relevant parts of the Selected by:
line, without all the noise?
PS: the two options above are chosen to represent the two ends of the spectrum, i don't actually want to disable either of these.
Edit: this is what is displayed by nconfig for the second example