This is no news, but I got sick of forgetting how to build an Ubuntu kernel package:
tar -xjf kernel*.bz2
# cd to new kernel tree
make-kpkg clean
cp /boot/config-$(uname -r) ./.config
make oldconfig
make-kpkg -initrd --revision= kernel_image kernel_headers modules_image
# sleep || eat || whatever
dpkg -i ../kernel-image*.deb
Good magic is that the -j option to make sets the number of concurrent jobs so as to take advantage of multiple CPUs. This number should be (numCPUs * 2 ) + 1. So before doing your make-kpkg, do this:
export CONCURRENCY_LEVEL=5 # a 2-CPU system
You can get really cute and put the following in your .bashrc:
if [ -a /proc/cpuinfo ]; then
export CONCURRENCY_LEVEL=$(($(grep -c processor /proc/cpuinfo) * 2 + 1))
export MAKEOPTS="-j${CONCURRENCY_LEVEL}"
fi
Maybe my .bashrc will be the subject of a future post.
No comments:
Post a Comment