I've personally tested it on:
Linux Mint 14, Cinnamon
Linux Mint Debian Edition, Cinnamon
I made a video of it, so you can see what a proper build should look like. http://www.youtube.com/watch?v=_uWjGagIQcs
The first thing we need to do is install what is needed to compile the kernel. These are the essentials:
Code: Select all
sudo apt-get install build-essential kernel-package libncurses5-dev fakeroot wget bzip2
Code: Select all
sudo apt-get install qt4-designer qt4-dev-tools qt4-doc qt4-linguist-tools qt4-qmake
Code: Select all
export CONCURRENCY_LEVEL=2
export CHOST="x86_64-pc-Linux-gnu"
export CFLAGS="-march=native -O2 -pipe"
export CXXFLAGS="$CFLAGS"
Code: Select all
mkdir kernel-build
cd kernel-build
Mainline
- The most recent kernel, released by Torvalds, with latest features, not necessarily stable
- The latest stable kernel, with updates that are only bug fixes, no new features
- Not actually a version number. Hundreds of devs add to this tree daily, and there is no record of previous days kernels of this tree. It can change drastically over 24 hours, and is not recommended for production or home use
Code: Select all
wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.8.7.tar.xz
tar -Jxf linux-3.8.7.tar.xz
cd linux-3.8.7
Next we want to copy our old kernel configs to the new kernel, reducing the work we need to do for selecting options for the kernel. You can answer these to the best of your ability or you can simply press enter (return) to use the default options.
Code: Select all
cp /boot/config-`uname -r` ./.config
make oldconfig
Code: Select all
make xconfig
Code: Select all
make menuconfig
Code: Select all
fakeroot make-kpkg --initrd --append-to-version=-customname kernel_image kernel_headers
Code: Select all
cd ..
sudo dpkg -i linux-image-*.deb linux-headers-*.deb
sudo update-grub
Now you have your own custom kernel, congratulations. Feel free to remove the folder holding all the source code, as it's likely over 10Gb now. Keep the .debs if you have the space (they're about 55Mb combined), and have fun.
For nvidia driver users who blacklisted nouveau, you have one more step, due to a recently introduced change with nvidia drivers. Reboot into the new kernel via recovery mode. As root, run:
Code: Select all
update-initramfs -k 'uname -r'
Code: Select all
shutdown -r now
---------
EDIT:
-- For a leaner kernelLethe wrote:What you can also do is starting with a generic kernel (i.e. the standard Mint/Debian kernel) is to plug in all your devices (USB stick, USB printer etc.) so that the modules get loaded, then run in your unpacked 'linux kernel' directory:
What this will do it automatically tune your config to only use the modules required on your system, and turn all the other off. A lot quicker than trying to do it manually.Code: Select all
make localmodconfig
Nick