gentoo kernel compile

I seem to be doing this so often that I need a ready reference. So here's a post :)

lspci: without it, my wireless card wasn't detected at boot.
$ emerge --search pciutils
# emerge --ask sys-apps/pciutils
for some strange reason, gentoo installs lspci in /usr/sbin.
$ /usr/sbin/lspci -knnvvv
$ lsmod

source
# emerge --ask sys-kernel/gentoo-sources

compression
There are many opinions about kernel compressions. My research led me to lzo. Is that the most efficient?
If you want to use lzo, you need to install lzop, or your kernel build will fail.
# emerge --ask app-arch/lzop

config
http://wiki.gentoo.org/wiki/Handbook:X86/Installation/Kernel#Activating_required_options
http://wiki.gentoo.org/wiki/Kernel/Gentoo_Kernel_Configuration_Guide

$ cd /usr/src/linux
$ cp -vi {backup}/config .config
$ make oldconfig
$ make nconfig

make
# make -j4 -s && make -j4 modules_install && make install

initramfs
http://wiki.gentoo.org/wiki/initramfs

gentoo wiki doesn't say how to.. just refers genkernel.
gentoo wiki also suggests no initramfs or modules, but including everything in kernel.

I am a fan of micro-kernels, rather than monolithic kernels. I prefer my kernel slim. Anything and everything, not required for initial boot or always in use, stays out of kernel.

I also use btrfs subvolumes, and LABELs in fstab.. so I need initramfs.

# emerge --ask sys-kernel/genkernel
# genkernel --install --no-ramdisk-modules --disklabel initramfs

Firmware:

FIRMWARE_IN_KERNEL=n
The kernel source tree includes a number of firmware 'blobs' that are used by various drivers. The recommended way to use these is to run "make firmware_install", which, after converting ihex files to binary, copies all of the needed binary files in firmware/ to /lib/firmware/ on your system so that they can be loaded by userspace helpers on request.

$ emerge --search firmware
# emerge --ask sys-kernel/linux-firmware


[1] http://wiki.gentoo.org/wiki/kernel/upgrade
[2] http://swift.siphos.be/linux_sea/kernelbuilding.html

No comments:

Post a Comment

most viewed