Howardism Musings from my Awakening Dementia
My collected thoughts flamed by hubris
Home PageSend Comment

…the Linux philosophy is 'laugh in the face of danger'. Oops. Wrong one. 'Do it yourself'. That's it.

—Linus Torvalds

Rebuilding the Linux Kernel

The worst part about Linux is that after all the work that has been put into it, I still have to recompile the friggin' kernel. I mean, really. Is it really that hard to to include smbfs as a loadable module?

Obviously, I'm not a real geek anymore as I don't enjoy this step anymore.

Anyway, since I always have to research the exact makefile incantation, I figured that I would make it easier for myself and note it on my own website.

  • Be the root user.

  • Install the kernel-src package (oh, and the general development tool suite, including the C/C++ suite), as it generally isn't installed.

  • cd /usr/src/linux

  • make mrproper … this is a good step for other RPMs to hook up with the kernel, and I generally do this even if I am not going to completely rebuild the kernel.

  • make cloneconfig … This beautiful piece of incantation will take your current kernel, and create a configuration based on what it is. This is great when you just want to add the missing feature.

  • make xconfig … You should now have a dialog of all the features you can choose from. They have improved navigating the huge array of options, so it shouldn't be too bad to find the missing module.

  • make modules_prepare

  • make clean

  • make modules && make modules_install … builds the modules, and the install is safe to do.

  • make bzImage … this actually builds the kernel.

  • Install it. You can't do a make install anymore, since no one uses lilo anymore (in preference to grub). To install, try to locate the linuz image and copy it to /boot.

    Since most distributions include a "safe bootup option", I don't usually backup my current kernel, but instead copy the new one over the current one. Not the greatest idea, and I know I'll regret it some day.

Tell others about this article:
Click here to submit this page to Stumble It