Advertisement

I run Ubuntu Intrepid 8.10 on Dual Core 2 laptop with 4 GB of memory. The default kernel supplied by Ubuntu doesn’t support the 4GB memory, I could choose to run the server kernel but I also want to take advantage of the Core2 support in the kernel so I took it upon myself to compile a custom kernel.
Unfortunately the Ubuntu developers thought it was better to change the way kernel is build in Intrepid and the official Ubuntu How to compile a kernel on the Wiki isn’t set up for Intrepid yet. Most of the stuff I had to discover myself and to make sure I remember for the next time, but also to help benefit others for when they want to compile their own custom kernel, I decided to write it all down.

Updated: Nov 7, 2008

I’ll be doing everything as root.
First we need to install some applications so we can do the compilation:

apt-get install fakeroot build-essential
apt-get install crash kexec-tools makedumpfile
apt-get build-dep linux

Create a directory where you would like to build your kernel, this directory will hold the kernel source in a sub directory and all the deb files will end up in this folder. I choose /d1/packaging/kernel as I package other software as well. All the commands I type will be done from this directory.

Getting the source

There are a couple of ways to get the kernel source from Ubuntu, using apt-get which this article is using or by using git. If you prefer to use git follow my other article I have written.
To get the source of your current running kernel, in my case it’s 2.6.27-7

apt-get build-dep linux-image-$(uname -r)
apt-get source linux-image-$(uname -r)

The source code is installed in the directory linux-2.6.27.

Creating a new config

I’ll be using the method of creating a new flavor, this adds a bit more work but you can always compile the original kernels. Now for the fun stuff, editing the config so it fits my needs. I won’t go into detail which settings I changed, if somebody is interested I certainly can give that information. I use the current running config as my base. I create a copy of the kernel source to edit the config file.

cp linux-2.6-27 linux -r
cd linux
cp /boot/config-$(uname -r) .
make menuconfig

When you’re done we make a backup of the config file.

mv .config ../config.core2
cd ..

Getting ready for compilation

Because we are going to be creating a new flavor based on a existing flavor (generic in my case) we need to create some extra files. During compilation the process checks the previous release for some settings, as we’re creating a local flavor it doesn’t exist in the source, so we’re creating it. My previous version is 2.6.27-7.13.

cd linux-2.6.27
cp debian/abi/2.6.27-7.13/i386/generic debian/abi/2.6.27-7.13/i386/core2
cp debian/abi/2.6.27-7.13/i386/generic.modules debian/abi/2.6.27-7.13/i386/core2.modules
cp ../config.core2 debian/config/i386/

We also need to edit some files

  • debian/scripts/misc/getabis
  • debian/rules.d/i386.mk
  • debian/control.stub
  • debian/control

In the next few parts I’ll explain what you need to change

File: debian/scripts/misc/getabis

Search for the line:

getall i386 generic server

Change it in:

getall i386 generic server core2

File: debian/rules.d/i386.mk

Search for the line:

flavours        = generic server

Change it in:

flavours        = generic server core2

Files: debian/control.stub and debian/control

For both files we need to copy three sections:

  • Package: linux-image-2.6.27-7-generic
  • Package: linux-headers-2.6.27-7-generic
  • Package: linux-image-debug-2.6.27-7-generic

A section is defined from the line Package to the next line starting with Package.

In the copied sections we need to replace “generic” with “core2″ on all the lines that start with Package.

Compilation

It’s finally time for compiling.

CONCURRENCY_LEVEL=2 NOEXTRAS=1 skipabi=true skipmodule=true fakeroot debian/rules binary-core2

Because I have a Dual Core I want to utilize both processors by setting the CONCURRENCY_LEVEL. Set this to the amount of processors you have, if you have only one, just skip it completely. No matter grab yourself some coffee while we’re compiling.

Installation

After the compilation is finished we’ll have two deb files in the parent directory. To install the files

dpkg -i linux-image-2.6.27-7-core2_2.6.27-7.14_i386.deb
dpkg -i linux-headers-2.6.27-7-core2_2.6.27-7.14_i386.deb

Check your bootloader if the newly installed kernel is the default one, for grub edit the file /boot/grub/menu.lst

Reboot and enjoy your newly installed kernel.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Ma.gnolia
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
Tags: 8.10, custom kernel, Git, how to, howto, Intrepid, Linux, linux kernel, Ubuntu
78 Responses to “How to compile a custom kernel for Ubuntu Intrepid”
  1. syko21 says:

    Did you need to recompile the l-r-m or l-u-m modules for this or did they continue to work?

  2. Peter says:

    I don’t use the restricted modules myself and the ubuntu modules aren’t available.
    I’m pretty sure you will have to compile them like previous releases of Ubuntu.

  3. munkee says:

    Why use the 32-bit kernel, while the 64-bit one can support 4Gb without the need to recompile?

  4. slashdevdsp says:

    You can find easier dependency/compilation/installation of kernel here, without touching/editing most of the files you describe above.
    http://www.howtoforge.com/kernel_compilation_ubuntu

    cheers

  5. Peter says:

    munkee:
    Besides the 4GB I also changed some other options, like processor optimization, for my kernel and I also heard of problems with other software if you run 64bit, but I don’t know for sure.

  6. Peter says:

    slashdevdsp:
    That describes compiling a vanilla kernel on Ubuntu, not the Ubuntu kernel. The use of make-kpkg also prevents you from compiling multiple flavors at once and according to the Ubuntu wiki it’s also the old-fashioned way.

  7. slashdevdsp says:

    i am pretty sure u can download the ubuntu-kernel source and build it, no different from building a vanilla kernel according to the howtoforge website, and I dont get the point of multiple flavours if you are going to be running it on a single machine, as I dont see myself booting to an optimised kernel just for playing games(one of the flavours) as for embedded devices it might make sense for evaluation. and from my understanding you can just wrap the whole thing in a script with different config files loaded from make menuconfig and using make oldconfig to reuse the base config for the new/ubuntu kernel.

  8. slashdevdsp says:

    ohh and could you point me to ubuntu wiki about compiling kernels, its been a while since i have compiled stuff

  9. Peter says:

    slashdevsp:
    In a business environment it comes in very handy to be able to compile multiple flavors. “Different” kernels for different machines, 64bit + 32bit for example, xen kernels, rt kernels etc.
    Why do you want the wiki page, just follow my instructions ;-) It’s right here: https://help.ubuntu.com/community/Kernel/Compile

  10. slashdevdsp says:

    thanks for the info, i usually compile release kernels with ubuntu base configs althought i do compile them using cross compilers for my fpga boards, I could try to compile different flavours for my fpga board with varying different options at the same time :) and thanks for the wiki link… damn i need to compile new kernels now again gah

  11. Omid says:

    did you mean “cp .config ../config.core2″ to make backup? you wrote “mv”

  12. Peter says:

    It wasn’t a typo, it doesn’t really matter if you do a mv or cp. I usually delete the linux directory after I have build my kernel.
    A few steps later you do a cp of the config.core2 to the building directory and that way you have a backup of the config file.
    In all honesty I prefer to use git to get the kernel source now-a-days, for instructions on using git to build a custom kernel see this article here: http://blog.avirtualhome.com/2008/10/28/how-to-compile-a-custom-kernel-for-ubuntu-intrepid-using-git/

  13. Scot McPherson says:

    You can mv the .config. menuconfig will just create a new one. THe difference is that your .config will help you with non-default defaults already chosen. Without a .config file, you might as well be compiling a vanilla kernel and will have to chose every options yourself (and pray you got them right if you are new to linux kernel compiling).

  14. Eduardo says:

    It keeps telling me that my kernel is not clean, I am using linux 2.6.27-7.15, Any idea why??

  15. Peter says:

    Re: Eduardo
    Does it say you have to do make mrproper?

    If so it probably means you are trying to compile your kernel in the same directory as where you ran make menuconfig.

  16. Rob says:

    When I run sudo apt-get install linux-kernel-devel fakeroot build-essential I get this error:

    E: Couldn’t find package linux-kernel-devel

    Any ideas?

  17. Peter says:

    Re: Rob

    Thanks for reporting it should state:
    apt-get install fakeroot build-essential
    apt-get install crash kexec-tools makedumpfile
    apt-get build-dep linux

    I changed the document accordingly

  18. livio says:

    But this is an horrible way to build a kernel!
    do not exit procedure simple?
    Developer don’t write a guide?
    is very strange… developper don’t like user custom compilation kernel?

    the old debian way use the linux-source with patch debian (or ubuntu)
    why use this complicate procedure to build your kernel?
    You have benefit for that?
    For example i like to compile a kernel amd64
    if i compile with the debian way the linux source i have a kernel_name.i386.deb , why this?
    With your procedure is possible to obtain an amd64 kernel?
    And what is the difference?

    Tank you

  19. Peter says:

    Re: livio:

    You can compile a AMD64 version for sure, you just have to update the right files, in short it means replacing all i386 with amd64 at the step Getting ready for compilation

    The benefits of this procedure is that it allows you to keep the original configuration and you could essentially create several different flavors for different system configurations.
    As I mentioned previously in the comments:
    In a business environment it comes in very handy to be able to compile multiple flavors. “Different” kernels for different machines, 64bit + 32bit for example, xen kernels, rt kernels etc.

    I don’t know why you get a i386 kernel when you use the old-fashioned Debian way, but I do think it’s a good reason not to use that method and use the above method.

  20. livio says:

    I suppose i found the point:

    The normal linux-source is a base kernel of distro (is old an 2.6.27-2 is the kernel of cd installation) and is a kernel vanilla + ubuntu patch
    You compile with your config with old style debian way.

    The kernel source for linux-image is the source of current (in use) kernel provided by git.
    This kernel is “for developer”, have all config: x86, amd64 ecc ecc
    BUT for exemple in my case:
    i have kernel installed from ubuntu amd64 distro:
    Linux 2.6.27-7-generic #1 SMP Tue Nov 4 19:33:06 UTC 2008 x86_64 GNU/Linux
    this is equal to config (+ config.generic) present in amd64 directory of git kernel.

    A this point it is possible to build with old debian way the kernel present on git,
    the autobuild method is preferable to use only by developer for build of plus image with only one build operation or for flavour creator.

  21. Krazzykule says:

    Hi!
    I have just finished compiling my kernel, but when I try to install it, it stops and says me it cannot install nvidia(177.80) module. It is the first time I configure the kernel and maybe I made any mistakes when configuring the kernel, What do you think it could be?

    Thanks

  22. Peter says:

    Re: Krazzykule

    What kernel version did you have and what version did you compile and try to install?

  23. Hello,
    When I try to do make config, it returned me an error in ubuntu 8.10 linux 2.6.27-7-generic:

    ***Unable to find the ncurses library or the required header files.
    *** make menuconfig requires the ncurses library

    ***Install ncurses (nacurses-devel) and try again.

    But, when i tried to install ncurses-devel using apt get , it says
    could not find package ncurse-devel.

    it would be easier for newbies like me, if you had included the steps for it also

  24. Peter says:

    @Manish
    I apologize Manish, to install ncurses you’ll need the libncurses5 and libncurses5-dev

  25. @Peter

    Thanks Peter. It went fine after installing libncurses5-dev.

  26. pachamama says:

    Nice Howto but still my kernel will not compile.
    I got the error:

    makedumpfile -g /home/pachamama/src/linux-2.6.27/debian/linux-image-2.6.27-9-bieszkola/boot/vmcoreinfo-2.6.27-9-bieszkola -x /home/pachamama/src/linux-2.6.27/debian/build/build-bieszkola/vmlinux
    get_debug_info: Can’t create a handle for a new debug session.

    makedumpfile Failed.
    make: *** [install-bieszkola] Fehler 1

    I dried already different ways, at last with:

    AUTOBUILD=1 NOEXTRAS=1 skipabi=true skipmodule=true skipdbg=true fakeroot debian/rules binary-bieszkola

    Maybe you’ve an idea?!

  27. Peter says:

    @pachamama
    I’m sorry, I’ve been trying to find more info about your error message but unfortunately there isn’t much out there, in fact this site pops up in 1st place when searching for “Can’t create a handle for a new debug session”

    The only thing I can think of to do is to start over again and use the Git method (http://blog.avirtualhome.com/2008/10/28/how-to-compile-a-custom-kernel-for-ubuntu-intrepid-using-git/)

  28. Krazzykule says:

    Hello:

    I’m sorry but I forgot to post telling my success. But after installing the kernel and starting y realize it is slower than using the generic.
    I compiled version 2.6.27-7-generic for a Intel Quad Core Q9300.
    Can you help me to improve it?

    Thanks

  29. ya, I felt the same too. The transfer of data from USB to hard disk was slow. And the network interfaces were not working as well.

  30. Peter says:

    @Krazzykule and Manish

    What settings in the kernel configuration did you change?

  31. natros says:

    @pachamama

    you have this error because you have removed the debug option from kernel configuration (which in my tests make it faster). just comment the two lines in debian/rules.d/2-binary-arch.mk that have the makedumpfile command.

  32. Amnon Feiner says:

    I went through the entire process, and I cannot find
    linux-image-2.6.27-7-core2_2.6.27-7.14_i386.deb
    or
    linux-headers-2.6.27-7-core2_2.6.27-7.14_i386.deb
    I see them being created in the end of compilation.

  33. Peter says:

    @Amnon
    It’s in the directory higher as where you compiled the kernel.
    Example: Compilation in /home/amnon/kernel/linux-2.6
    The deb files are in /home/amnon/kernel

  34. Amnon Feiner says:

    did a search for
    find / -name *.deb, nowhere to be found, they are not listed. I am missing something :-( .

  35. Peter says:

    @Amnon,

    Not sure what to make of it. Do you have enough free diskspace for the deb files?

  36. ancjr says:

    followed the directions to the letter, substituting “athlon-xp” for “core2″ where appropriate:


    LD [M] drivers/video/vermilion/vmlfb.o
    LD [M] drivers/video/vermilion/crvml.o
    CC [M] drivers/video/sis/sis_accel.o
    CC [M] drivers/video/sis/init.o
    CC [M] drivers/video/sis/init301.o
    CC [M] drivers/video/sis/initextlfb.o
    LD [M] drivers/video/sis/sisfb.o
    make[1]: *** [sub-make] Error 2
    make[1]: Leaving directory `/root/linux-2.6.27′
    make: *** [/root/linux-2.6.27/debian/stamps/stamp-build-athlon-xp] Error 2

    not familiar with ubuntu, so i am completely lost here.

  37. Peter says:

    @ancjr

    What changes did you make in the kernel config?

  38. Krazzykule says:

    I changed lots of things. Is there any file which show it?
    I can’t remember.

  39. ancjr says:

    @peter

    All changes were made under processor type & features. From memory: I turned off SMP, changed processor family to Athlon/k7, deselected generic x86 support, turned off the various laptop options and changed the timer freq from 250 to 300hz.

    Thanks for your help!

  40. Peter says:

    @ancjr

    You could deselect the Sis video driver if you don’t have use
    Device Drivers -> Graphics support -> Support for frame buffer devices -> SiS/XGI display support

    If you do / (slash) in make menuconfig and search for SIS it shows you what other options it depends on
    Symbol: FB_SIS_300
    Prompt: SiS 300 series support
    Defined at drivers/video/Kconfig:1487
    Depends on: HAS_IOMEM && FB_SIS

    You can search for HAS_IOMEM and FB_SIS to see if they are selected as well.

    I hope this helps a bit

  41. ancjr says:

    @Peter

    Ok, I got it to work after removing many unneeded modules/options. I also went ahead and did the git method from your other article. I started with a fresh install of Ubuntu and needed to install git-core, libncurses5, libncurses5-dev and edit debian/rules.d/2-binary-arch.mk as per natros’ suggestion.

    Now, let’s see if it boots! ;)

  42. Peter says:

    @anjcr

    I’m glad it worked out for you. I’m sure it will boot ;)
    I’ll edit the page to add the files git-core, libncurses5, libncurses5-dev. Thanks for reporting

  43. David says:

    When I attempt to do the “fakeroot debian/rules binary-core2″ I get a message, “no rule to make target binary-core2. Stop.” I think I have done everything you said, but somehow something is missing. Can you guide me to what?

  44. Peter says:

    @David

    Check the files

    * debian/scripts/misc/getabis
    * debian/rules.d/i386.mk
    * debian/control.stub
    * debian/control

    for typo’s, especially the i386.mk file.

  45. David says:

    I’m sorry, Peter, but I double checked all the files. I didn’t find a typo anywhere; at least all the core2 substitutions are there. Sometimes a finger flick causes a typo elsewhere, but if so I didn’t catch it.

  46. Peter says:

    @David

    Are you compiling a kernel for i386 or AMD64?

  47. David says:

    Peter, I hope this doesn’t show up twice — I just haven’t seen my response. I am compiling for i386. I am in the directory linux-2.6.27 while issuing the command, and have followed all your instructions as far as I can understand them. I’m running on Ubuntu Intrepid, on an HP Pavilion dv7 with dual processor (and I did include your “concurrency level” command).

    Thanks so much for helping me!

    • Peter says:

      @David

      Sorry it seemed my anti-spam plugin thought you were a spammer, time to disable that thing again.
      Here’s what I could do for you. If you tar up the debian directory and send it to me, I can see what happens here.
      I’ll send you an email so you have mine to send it to.

  48. Peter says:

    @David

    The file config.core2 in the directory debian/config/i386 is missing.
    I deleted my file in my kernel compliation setup and get the same error.

  49. andy says:

    having the same problem as David. I made sure that i copied the config.core2 and with no luck
    /usr/bin/fakeroot: line 164: debian/rules: No such file or directory
    persists

    i am compiling for i386

    • Peter says:

      It looks like you have a different error as Dan.
      In your case the file debian/rules can’t be found.
      When you start compiling make sure you are in the same directory as where the subdirectory debian exists.
      In the example it would be linux-2.6.27.

      • andy says:

        make: *** No rule to make target `binary-core2′. Stop.

        Sorry ! forgot to check that I was in right directory. Here is the new error that showed up.

        by the way, in the guide where you edit control.stub and control. did you mean copy the package entry and append them to end of the file, and changing generic to core2?

        • Peter says:

          Yes that’s what I meant.

          Double check the files

          * debian/scripts/misc/getabis
          * debian/rules.d/i386.mk
          * debian/control.stub
          * debian/control

          And make sure there are no typo’s in the core2 part.
          If this isn’t the case please send a tar of the debian directory and send it to me. I’ll send you an email right now.

  50. JRobbo says:

    Hi Peter,

    Excellent guide, thanks very much for posting. Can you please tell me what I need to change to enable the 32-bit kernal to use the full 4GB installed in my machine please? I had a look at the config file in /boot, and it already had CONFIG_HIGHMEM=y, but Ubuntu only recognises 3GB of the 4GB installed, so I guess there are other things that I need to change as well?

    Again, many thanks for posting this, good stuff!

    John

    • Peter says:

      John,

      You have to select 64GB memory to enable the full 4GB.
      The easiest way to select it is by make menuconfig
      Processor type and features ->High Memory Support

  51. Mads Madsen says:

    If you get the error:
    “make: *** No rule to make target `binary-core2′. Stop.”
    Please verify that the config.core2 is present inside the debian/config/ directory, for some reason I did’t get the copied over probaly.

    Btw. great guide! :)

  52. Mjrwingnut says:

    when I typed in ” sudo apt-get build-dep linux”

    this is what I got:

    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    E: You must put some ’source’ URIs in your sources.list

    Do I need to add some repositories to my sources.list?

    • Peter says:

      Yes you do.
      This is how to do add them:
      System -> Administration -> Software Sources

      In the tab: Ubuntu Software place a checkmark by sources. Click close -> Click Reload.

  53. Ethan says:

    Hi Peter,
    When I’m trying to compile the kernel, i get the following error:
    “/usr/src/linux-2.6.27 is not clean, please run ‘make mrproper’ i the ‘/usr/src/linux-2.6.27′ directory.

    I noticed you mentioned that this kinda error occurs when trying to compile kernel in the same directory as where you ran make menuconfig. But I “make menuconfig” in “/usr/src/linux” and try to compile the kernel at “/usr/src/linux-2.6.27″ as instructed in the guide. Why I still get this error? Where am I supposed to compile the kernel then?

    Actually, I’m a bit confused about this part of the guide. You first “cp linux-2.6-27 linux -r” and then “make menuconfig” with in /usr/src/linux. After that, you modify all the files in “/usr/src/linux-2.6.27″. I’m a newb and could you please explain a bit what exactly is doing here?

    Thanks

    • Peter says:

      I’m not sure why you get the not clean error message.

      Make sure you copy the Linux 2.6.27 directory and only do the configuration in the Linux directory. In your case my guess is you have the following two directories in /usr/src, linux-2.6.27 and linux. You might have other directories but they are not related to this guide.

      I copy the Linux 2.6.27 directory to Linux as a working directory. When you are done with the configuration you copy the config file to the parent directory and
      copy the configuration file you created to the directory Linux 2.6.27. It also provides you with a backup of your configuration.

      • Ethan says:

        You are right, peter. I have two directories in /usr/src: linux and linux-2.6.27. I followed the following steps:

        1. I ran “make menuconfig” in “/usr/src/linux”.

        2. After I configured, I “cp /usr/src/linux/.config /usr/src/config.core2″.

        3. Then “cd /usr/src/linux-2.6.27″. Modified all the files as instructed.

        4. Run the following command within “/usr/src/linux-2.6.27″:
        “CONCURRENCY_LEVEL=2 NOEXTRAS=1 skipabi=true skipmodule=true fakeroot debian/rules binary-core2″

        Then I got the following error:
        “/usr/src/linux-2.6.27 is not clean, please run ‘make mrproper’ i the ‘/usr/src/linux-2.6.27′ directory.”

        Did I make any mistakes among above steps?

    • Robert says:

      Go to your source dir and do the following ( worked for me on 8.04 Hardy ):

      cp -R debian ../
      make mrproper
      cp -R ../debian ./
      fakeroot debian/rules clean

  54. MjrWingnut says:

    What repositories should I add?

    • Peter says:

      You don’t have to add repositories, all you have to do is add the sources of the official Ubuntu repositories.
      This is how to do add them:
      System -> Administration -> Software Sources

      In the tab: Ubuntu Software you place a check mark by sources.
      Click close -> Click Reload.

  55. Chris says:

    How do you get the linux-image-debug package to build? I’m only getting the image and headers packages, not the debug package.

    I’m trying to get the crash utility to work, which needs the vmlinux file — hoping that gets built as part of the debug package. Any tips?

    Or, any tips on getting the crash utility to work on ubuntu intrepid, in general?

    • Peter says:

      vmlinux is a part of the debug package.
      To create the debug deb you will have to do the following

      sudo mkdir /CurrentlyBuilding

      Now do the normal compilation.

      When the compilation is done you will have to rename the debug package. By default the debug package is renamed so it won’t end up in Ubuntu’s repository. Instead of having the extension deb, the extension is ddeb. So rename it back to deb and you can install the package.

      Note that if you have the directory /CurrentlyBuilding and you do not want to build the debug package to be build add skipdbg=true to the compilation command:
      CONCURRENCY_LEVEL=2 NOEXTRAS=1 skipabi=true skipmodule=true skipdbg=true fakeroot debian/rules binary-core2

  56. trlkly says:

    Just had a thought. Have you talked to the Ubuntu developers about maybe including a package that includes your kernel “fix”? More and more people are using 4G+ memory and/or dual core in their computers.

    Even better would be if the installer could detect you needed it and install the “fixed” kernel…

    • Peter says:

      No I haven’t talked to the Ubuntu developers.
      I agree with the 4GB+ memory part, that should just be part of the generic kernel, right now it’s only part of the server kernel. And it doesn’t make a difference on how your computer operates if you don’t have 4GB of memory. Unlike having a processor specific kernel.

      The other thing is that if you start making different kernels for different hardware, like processors, you’ll end up with a whole bunch of kernels and they already took out the debug kernel image because it took to long to create it.
      And in all honesty I think the average person running Ubuntu on their desktop won’t even notice a difference between running a generic and a processor specific kernel, I know I don’t.

      Right now they have a generic, server and virtual kernel and I do believe that is the right way to go right now. Sometimes they also have a RT kernel, but the RT patches aren’t available for the kernel version Intrepid is running.

  57. bixejo says:

    Hi Peter,

    Thank you very much for this rocking howto.

    I’ve followed your instructions to create a customized flavour kernel (I set “kmon2″ as the flavour name).

    Everything went ok, but near to the end (I guess, after more than 3 hours compiling) I got the following error:

    ===========
    salsa20_i586 / salsa20_generic : salsa20
    padlock_sha / sha1_generic : sha1
    padlock_aes / aes_generic : aes
    padlock_sha / sha256_generic : sha256
    make: *** [install-kmon2] Error 1
    ===========

    I don’t know too much about this, but sounds to me like it’s trying to install the kernel rather of generating .deb files, and then I get this error as I did run it with “fakeroot” as you suggested, and not with “sudo”.

    I don’t get either .deb files for the kernel and headers.

    Any advice? Thank you very much again, and congrats for your excellent work.

    –Bixejo

  58. Pierre says:

    Hi Peter,

    thanks for your work of putting this up, worked like a charm for me !!

    I wanted NVidia acceleration *and* the full 4G RAM visibility with PAE,
    which is not available in the default ubuntu-desktop kernel.
    So I followed your tutorial to make my own kernel, starting from
    the default kernel after update (”2.6.27-11-generic”).

    In the make menuconfig I only added “High Memory Support” for 64GB
    in “Processor type and features” … created my own flavour named pae64g …
    compiled in a vmware virtual machine (70 minutes …)

    And after installation and reboot on the new kernel, the full 4G visible in ‘top’ !
    And the NVidia driver (menu System, Administration, Hardware Drivers)
    accepted to install itself on the custom kernel without any problem.

    Cheers,
    Pierre

  59. Ryan Egesdahl says:

    To the person above who had problems with the ‘makedumpfile’ part, and to all others with a similar problem, there is an environment variable you can pass to debian/rules that bypasses the command without having to edit any files:

    no_dumpfile=true

    Apparently, someone already thought of this problem.

  60. Robert says:

    I just did a build of the unmodified generic flavor and while my .deb is a reasonable 18.5MB my build generated 2.5GB of intermediate files and a bunch of additional .debs:

    linux-headers-lum-2.6.24-24-386_2.6.24-24.39_i386.deb
    linux-headers-lum-2.6.24-24-generic_2.6.24-24.39_i386.deb
    linux-headers-lum-2.6.24-24-server_2.6.24-24.39_i386.deb
    linux-image-debug-2.6.24-24-generic_2.6.24-24.53_i386.deb

    Why does it generate these 4 extra debs?

    I’m doing this for 8.04 Hardy but don’t think that should make a difference.

    • Peter says:

      It looks like you didn’t tell the compiler what flavor to build. To build the generic I believe you would say binary-generic.

      • Robert says:

        Sorry I wasn’t clear. I built both

        linux-headers-2.6.24-24-generic_2.6.24-24.53_i386.deb
        linux-image-2.6.24-24-generic_2.6.24-24.53_i386.deb

        I just got those other .deb *in addition* to the two above generic .debs.

  61. Robert says:

    Is there a guide to building a linux-ubuntu-modules flavour to go along with the custom kernel? I’m going to need some of the firmware and module from that package in my initramfs for my laptop to work properly. I’ve tried making similar alterations to what’s done for the kernel flavour but quite frankly I’m shooting in the dark with this debian build system.

  62. kaendesmut says:

    Hi: In other ‘kernel-compiling’ tutorials and books, the authors doesn’t recomend almost any operation under root privileges. Why do you make all as root? Is there any difference?

    • Peter says:

      There’s not a difference. Building it is non-root will work as well. There isn’t a really a reason why I build as root in this article.

      I personally never understood why most authors don’t want you to do stuff as root. As long as you are careful not much can go wrong.
      The things you need be root for is the installation of packages, the first few steps as well as the final step of installing the newly compiled kernel.

  63.  
Pingbacks and Trackbacks
  1.  
Leave a Reply