Skip to content

Latest commit

 

History

History
254 lines (200 loc) · 5.64 KB

File metadata and controls

254 lines (200 loc) · 5.64 KB

Quick Optimization Checklist for Intel i5-4460 System

Your Hardware (Keep ONLY these drivers)

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

YOU DON'T HAVE (Disable all of these)

  • ❌ WiFi
  • ❌ Bluetooth
  • ❌ Discrete GPU (AMD/NVIDIA)
  • ❌ NVMe drives
  • ❌ Multiple sockets/NUMA
  • ❌ Hyperthreading/SMT
  • ❌ Touchscreen
  • ❌ PCMCIA/CardBus

Critical Size Reduction (Do First!)

menuconfig Path

Kernel hacking -->
  Compile-time checks and compiler options -->
    [ ] Compile the kernel with debug info    ← DISABLE THIS!

Expected result: 515M modules → ~120M modules

Essential Settings for Your CPU

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

Quick menuconfig Navigation Checklist

Press / to search, then enter option name (without CONFIG_)

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

Drivers to Keep (=y or =m)

Graphics

  • ✅ Intel i915 (CONFIG_DRM_I915)
  • ❌ AMD/Radeon
  • ❌ NVIDIA/Nouveau

Network

  • ✅ Realtek r8169 (CONFIG_R8169)
  • ❌ Intel e1000/igb/etc
  • ❌ All WiFi drivers
  • ❌ Bluetooth

Storage

  • ✅ AHCI (CONFIG_SATA_AHCI)
  • ✅ Intel PIIX/ICH (CONFIG_ATA_PIIX)
  • ❌ NVMe
  • ❌ AMD SATA
  • ❌ Marvell SATA

USB

  • ✅ XHCI (USB 3.0)
  • ✅ EHCI (USB 2.0)
  • ⚠️ OHCI/UHCI (USB 1.1) - only if you have old devices

Sound

  • ✅ Intel HDA (CONFIG_SND_HDA_INTEL)
  • ❌ USB Audio
  • ❌ FireWire Audio

Build Commands

# 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/

Post-Build Testing

# 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

Size Comparison

# 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)

Safety Checklist

  • 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)

Common Issues & Fixes

Module not found

# 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

No network after boot

  • Boot old kernel
  • Check CONFIG_R8169=m or =y in .config
  • Rebuild kernel

Graphics not working

  • Check CONFIG_DRM_I915=m is enabled
  • Check /sys/module/i915 exists

Kernel panic on boot

  • Boot old kernel from GRUB
  • Check dmesg logs
  • Review what you disabled

Progressive Optimization Plan

Build v2 (First optimization)

  • Disable debug symbols
  • Set processor type correctly
  • Set max CPUs to 4
  • Disable obvious unused hardware (WiFi, BT)

Build v3 (After v2 works)

  • Remove unused network drivers
  • Remove unused storage drivers
  • Remove unused filesystem support
  • Fine-tune kernel options

Build v4 (Fine-tuning)

  • Optimize I/O scheduler
  • Trim network stack
  • Remove unused input drivers
  • Profile module usage

Config File Locations

Source tree:     /usr/src/linux/.config
Reference:       /boot/config-6.12.6
Your backups:    ~/kernel-builds/*.config

Key Files After Install

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/

Documentation Template

# 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

Remember

  1. One change at a time when starting
  2. Always keep working kernel available
  3. Test thoroughly before considering stable
  4. Document everything - you'll forget otherwise
  5. Have fun learning! This is how you truly understand Linux

Print this page and keep it next to you while configuring! ✨