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

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

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


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

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


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


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


No comments:

Post a Comment

most viewed