Skip to content

Commit 198e181

Browse files
feat(virtio-linux): further strip out unnecessary kconfigs
1 parent b1a1b1b commit 198e181

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

packages/virtio-linux/build.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,45 @@ $CFG --enable KVM
290290
$CFG --enable KVM_INTEL
291291
$CFG --enable KVM_AMD
292292

293+
# --- strip defconfig hardware a virtio guest has no bus to find --------------
294+
# Everything above *adds* to x86_64_defconfig, which is a general-purpose
295+
# desktop/server config: it pins a pile of physical-hardware drivers =y that
296+
# this kernel can never reach, on any of the hypervisors we target. They cost
297+
# image size and boot-time probing and buy nothing.
298+
#
299+
# This is deliberately the conservative subset. Plenty of other defconfig
300+
# leftovers (sound, HID/PS2, ATA/SATA, SELinux-without-an-LSM-entry, the debug
301+
# options) are just as unreachable, but each needs its own argument about what
302+
# userland might still poke at, so they stay for now.
303+
304+
# No wifi in a microVM; defconfig carries the whole 802.11 stack =y.
305+
nope CFG80211 MAC80211 RFKILL
306+
307+
# Physical NIC drivers: defconfig pins E1000/E1000E/IGB/R8169/TIGON3/SKY2/
308+
# FORCEDETH/8139TOO/E100/NET_TULIP =y. Only the vendor-driver menu goes —
309+
# NETDEVICES and VIRTIO_NET stay.
310+
nope ETHERNET
311+
312+
# The rootfs arrives over virtiofs or virtio-blk, never NFS. NETWORK_FILESYSTEMS
313+
# itself has to stay: 9P_FS lives under it, and 9p is wanted above.
314+
nope NFS_FS ROOT_NFS SUNRPC
315+
316+
# None of our hypervisors emulate a USB controller, so xhci/ehci/ohci/uhci plus
317+
# usb-storage and usb-hid are unreachable.
318+
nope USB_SUPPORT
319+
320+
# Assorted defconfig hardware with no virtio-guest analogue. Note VIRTIO_IOMMU
321+
# is a different symbol and is still wanted above — what goes here are the
322+
# drivers for real Intel/AMD IOMMUs.
323+
nope INTEL_IOMMU AMD_IOMMU
324+
nope PCCARD YENTA AGP HOTPLUG_PCI
325+
nope MACINTOSH_DRIVERS NVRAM WATCHDOG DMADEVICES
326+
nope BLK_DEV_MD # keep BLK_DEV_DM — wanted above
327+
nope HIBERNATION
328+
nope KEXEC CRASH_DUMP
329+
nope QUOTA
330+
nope I2C HPET EFI_STUB
331+
293332
# Resolve any new dependencies / silently drop options renamed upstream.
294333
make olddefconfig
295334

0 commit comments

Comments
 (0)