CPU: Intel Core i5-4460 (Haswell, 4 cores, no HT)
GPU: Intel HD Graphics (i915)
Ethernet: Realtek RTL8111 (r8169)
Audio: Intel HD Audio (snd_hda_intel)
Storage: Intel AHCI SATA
USB: XHCI (USB 3.0), EHCI (USB 2.0)
Chipset: Intel H97
- ❌ WiFi
- ❌ Bluetooth
- ❌ Discrete GPU (AMD/NVIDIA)
- ❌ NVMe drives
- ❌ Multiple sockets/NUMA
- ❌ Hyperthreading/SMT
- ❌ Touchscreen
- ❌ PCMCIA/CardBus
Kernel hacking -->
Compile-time checks and compiler options -->
[ ] Compile the kernel with debug info ← DISABLE THIS!
Expected result: 515M modules → ~120M modules
Processor type and features -->
Processor family (Core 2/newer Xeon) ← Select this
Maximum number of CPUs (4) ← Change to 4
[ ] SMT (Simultaneous multithreading) ← DISABLE
Preemption Model (Preemptible Kernel) ← Low-latency
Timer frequency (1000 HZ) ← For desktop
[ ] NUMA ← DISABLE
| What | Search for | Action |
|---|---|---|
| Debug symbols | DEBUG_INFO |
Set to n |
| Processor | MCORE2 |
Set to y |
| Max CPUs | NR_CPUS |
Set to 4 |
| Preemption | PREEMPT |
Select "Preemptible Kernel" |
| Timer | HZ_1000 |
Set to y |
| WiFi | WLAN |
Set to n |
| Bluetooth | BT |
Set to n |
| NUMA | NUMA |
Set to n |
- ✅ Intel i915 (
CONFIG_DRM_I915) - ❌ AMD/Radeon
- ❌ NVIDIA/Nouveau
- ✅ Realtek r8169 (
CONFIG_R8169) - ❌ Intel e1000/igb/etc
- ❌ All WiFi drivers
- ❌ Bluetooth
- ✅ AHCI (
CONFIG_SATA_AHCI) - ✅ Intel PIIX/ICH (
CONFIG_ATA_PIIX) - ❌ NVMe
- ❌ AMD SATA
- ❌ Marvell SATA
- ✅ XHCI (USB 3.0)
- ✅ EHCI (USB 2.0)
⚠️ OHCI/UHCI (USB 1.1) - only if you have old devices
- ✅ Intel HDA (
CONFIG_SND_HDA_INTEL) - ❌ USB Audio
- ❌ FireWire Audio
# Set version name
make menuconfig # General setup -> Local version: -v2
# Build (use all 4 cores)
make -j4
make modules -j4
# Install
sudo make modules_install
sudo make install
sudo update-grub
# Verify
ls /boot/vmlinuz-6.12.6-v2
ls /lib/modules/6.12.6-v2/# Boot new kernel, then:
uname -r # Should show: 6.12.6-v2
lsmod | wc -l # Module count (compare to 141)
dmesg | grep -i error # Check for errors
# Test hardware:
ping 8.8.8.8 # Network
speaker-test -c2 # Sound
glxinfo | grep OpenGL # Graphics
lsusb # USB devices# Before optimization (your current):
/lib/modules/6.12.6/ → 515M (with debug symbols)
# After disabling debug:
/lib/modules/6.12.6-v2/ → ~120-150M (expected)
# After full optimization:
/lib/modules/6.12.6-final/ → ~80-100M (goal)- Kernel config backed up:
cp .config .config.v2.backup - Can boot to old kernel (6.12.6) from GRUB menu
- Have noted what changed
- Know how to access GRUB menu (hold Shift/ESC at boot)
# Check if driver is built
find /lib/modules/6.12.6-v2 -name "r8169*"
# If not built, rebuild with driver enabled
make menuconfig # Find and enable driver
make -j4 && make modules -j4
sudo make modules_install- Boot old kernel
- Check
CONFIG_R8169=mor=yin .config - Rebuild kernel
- Check
CONFIG_DRM_I915=mis enabled - Check
/sys/module/i915exists
- Boot old kernel from GRUB
- Check dmesg logs
- Review what you disabled
- Disable debug symbols
- Set processor type correctly
- Set max CPUs to 4
- Disable obvious unused hardware (WiFi, BT)
- Remove unused network drivers
- Remove unused storage drivers
- Remove unused filesystem support
- Fine-tune kernel options
- Optimize I/O scheduler
- Trim network stack
- Remove unused input drivers
- Profile module usage
Source tree: /usr/src/linux/.config
Reference: /boot/config-6.12.6
Your backups: ~/kernel-builds/*.config
Kernel: /boot/vmlinuz-6.12.6-v2
Config: /boot/config-6.12.6-v2
System: /boot/System.map-6.12.6-v2
Initrd: /boot/initrd.img-6.12.6-v2 (auto-generated)
Modules: /lib/modules/6.12.6-v2/
# Create after each build
cat > ~/kernel-builds/build-v2.md << EOF
# Build v2 - $(date)
## Changes
- Disabled DEBUG_INFO
- Processor: Core 2/newer Xeon
- Max CPUs: 4
- Disabled: WiFi, Bluetooth, NUMA, SMT
## Results
- Boot time: [fill in]
- Module size: [fill in]
- Module count: [fill in]
- Issues: [fill in]
## Status
- [ ] Boots
- [ ] Network works
- [ ] Sound works
- [ ] Graphics works
- [ ] USB works
- [ ] Stable after 24h
## Next Steps
[fill in]
EOF- One change at a time when starting
- Always keep working kernel available
- Test thoroughly before considering stable
- Document everything - you'll forget otherwise
- Have fun learning! This is how you truly understand Linux
Print this page and keep it next to you while configuring! ✨