The Notebook Review forums were hosted by TechTarget, who shut down them down on January 31, 2022. This static read-only archive was pulled by NBR forum users between January 20 and January 31, 2022, in an effort to make sure that the valuable technical information that had been posted on the forums is preserved. For current discussions, many NBR forum users moved over to NotebookTalk.net after the shutdown.
Problems? See this thread at archive.org.

    Compiling your own kernel

    Discussion in 'Linux Compatibility and Software' started by Thomas, May 27, 2008.

  1. Thomas

    Thomas McLovin

    Reputations:
    1,988
    Messages:
    5,253
    Likes Received:
    0
    Trophy Points:
    205
    Does anyone use this? I'm interested and I might do it.
     
  2. bmwrob

    bmwrob Notebook Virtuoso

    Reputations:
    4,591
    Messages:
    2,128
    Likes Received:
    0
    Trophy Points:
    55
    I tried with Gentoo - too much trouble unless you've got more time, more determination, and way more intelligence than I. LOL
     
  3. Thomas

    Thomas McLovin

    Reputations:
    1,988
    Messages:
    5,253
    Likes Received:
    0
    Trophy Points:
    205
    LOL, I think it would be fun. ;)
     
  4. The_Observer

    The_Observer 9262 is the best:)

    Reputations:
    385
    Messages:
    2,662
    Likes Received:
    0
    Trophy Points:
    55
    It's definitely not easy :)
     
  5. deflex

    deflex Notebook Enthusiast

    Reputations:
    2
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    5
    It is fun, and it's a great satisfaction when you do it. Years ago, it was necessary if you wanted to use your... for example... sound card . Today is unnecessary except some rare cases. Sorry for my bad english.

    EDIT: It's useful to optimize your system, having a compact, custom kernel without unnecessary modules it's always a good idea.
     
  6. Thomas

    Thomas McLovin

    Reputations:
    1,988
    Messages:
    5,253
    Likes Received:
    0
    Trophy Points:
    205
    I hear it's a lot faster.
    Also, I have 3,000 post :)
     
  7. jeffsmythe

    jeffsmythe Notebook Geek

    Reputations:
    97
    Messages:
    98
    Likes Received:
    0
    Trophy Points:
    15
    Today there is little need to compile your own kernel (depending on distro). It really is not difficult though.

    What are the advantages of a self-compiled kernel? In reality for desktops and notebooks with lots of RAM (i.e. more than 512MB), not too much in terms of speed and/or memory use, but you can make the kernel slightly faster by compiling in the drivers you require, and you can make the kernel slightly smaller by not compiling drivers/features you don't need. The result is a (slightly) faster system in most cases, with (slightly) less memory consumption by the kernel.

    One thing that can be very useful is tuning the system latency for your purposes. You can have a highly pre-emptable kernel which is well suited for desktops and near-real-time activities like video playback, or you can setup for server-type loads which run better without pre-emption. You can tweak almost *anything* you want, but the need really depends on what your machine is and how you expect to use it.

    Assuming you have a stable gcc 4.X.X installed, you need to do only the following things:
    1. configure the kernel. (make menuconfig)
    2. compile the kernel. (make)
    3. Install the kernel to your /boot partition/directory. (make install)
    4. Install the kernel modules. (make modules_install)
    5. Configure grub/lilo to use the new kernel. (use an editor)

    It is a REALLY BAD idea to overwrite your old kernel in /boot! Don't do it. You can point grub/lilo to multiple kernel images so that if your new compiled kernel panics, it's simple to go back to an old one.
     
  8. jeffsmythe

    jeffsmythe Notebook Geek

    Reputations:
    97
    Messages:
    98
    Likes Received:
    0
    Trophy Points:
    15
    self-follow-up: The make menuconfig part is perhaps the only difficult part. It requires quite a bit of time the first time through to make sure you have all of the (hundreds!) of config options set correctly. The whole process often becomes iterative as you forget to include an ethernet driver, framebuffer support, etc. etc. etc, and only discover after rebooting to try out your new kernel. Another reason to NOT overwrite your old kernel!
     
  9. jas

    jas Notebook Evangelist

    Reputations:
    697
    Messages:
    622
    Likes Received:
    5
    Trophy Points:
    31
    Every time the Gentoo kernel sources (gentoo-sources) are updated means recompiling the kernel for my system. It's pretty easy although the first time I did it, it took extra reading and forum searching before I had a good kernel .config for my system. I like being able to pick and choose the kernel support I want, and it's a great way to learn more about how the linux system is configured. But the real reason I do it is to get the latest software updates on my system soon after the updates are released.

    Good Luck..
     
  10. Thomas

    Thomas McLovin

    Reputations:
    1,988
    Messages:
    5,253
    Likes Received:
    0
    Trophy Points:
    205
    So, are there any advantage, is the speed improvement noticeable?
     
  11. jas

    jas Notebook Evangelist

    Reputations:
    697
    Messages:
    622
    Likes Received:
    5
    Trophy Points:
    31
    I can't attest to any speed difference because I've always compiled my own kernels. I've always used Gentoo. If there is a speed difference I can't imagine that it's a big one. My guess would be if you're looking for Linux speed, compiling your own kernel might not be a big boost, unless you use the opportunity to strip out everything else you absolutely don't need. (I do the opposite with my laptop)

    Good Luck..
     
  12. Patrick

    Patrick Formerly beat spamers with stiks

    Reputations:
    2,284
    Messages:
    2,383
    Likes Received:
    93
    Trophy Points:
    66
    Whenever I recompile the kernel, i strip out everything that my laptop does not have. It gives it a little speed boost.
     
  13. Thomas

    Thomas McLovin

    Reputations:
    1,988
    Messages:
    5,253
    Likes Received:
    0
    Trophy Points:
    205
    Good to know.
    Anyone know If I can do fw-cutter via the command line in Hardy?
    I find that much easier.
     
  14. jas

    jas Notebook Evangelist

    Reputations:
    697
    Messages:
    622
    Likes Received:
    5
    Trophy Points:
    31
    I'm not sure what you're asking. The bcm43xx-fwcutter program is used to extract the firmware from different closed source Windows drivers, for a Broadcom 43xx WiFi hardware chipset. You run the program once against your Windows Broadcom driver and it extracts the firmware and you store it in a location like the /lib/firmware directory. The Linux bcm43xx driver module depends on this firmware and loads it, when you load the module.

    Other than your original installation, you should only run the firmware cutter program again when you're updating the firmware, and you have a new Windows driver you want to extract the firmware from. Other than that, cut the firmware once, store the firmware in the appropriate directory on your system, and then you only need to load the bcm43xx module when your system starts up. You don't need issue any command from the command line.

    Good Luck..
     
  15. Thomas

    Thomas McLovin

    Reputations:
    1,988
    Messages:
    5,253
    Likes Received:
    0
    Trophy Points:
    205
    I mean, you have do install fw-cutter form the CLI, can I install the .deb package and then set it up via the command line? I hear the .deb package doesn't work in hardy though...
     
  16. jas

    jas Notebook Evangelist

    Reputations:
    697
    Messages:
    622
    Likes Received:
    5
    Trophy Points:
    31
    You do have to run bcm43xx-fwcutter from the command line once the program is installed because as far as I can tell there's no GUI for it. Again this "firmware cutting", only needs to be done once, when you are initially installing support for the WiFi chipset, as I mentioned previously. In terms of installing it under Ubuntu, you probably know better than I, since I don't use Ubuntu. There is a program details page here, that links to an i386 deb installation file here, but if it won't work, you'll probably need to install from source.

    Good Luck..
     
  17. Thomas

    Thomas McLovin

    Reputations:
    1,988
    Messages:
    5,253
    Likes Received:
    0
    Trophy Points:
    205
    I know, there is a GUI in Ubuntu, but I want to do it the CLI way.
    Also, I have my own distro, if I included the firmware in it already, would that have no problem functioning on non bcm43xx cards?
     
  18. jas

    jas Notebook Evangelist

    Reputations:
    697
    Messages:
    622
    Likes Received:
    5
    Trophy Points:
    31
    You need to check whether you can include the firmware in your distribution. There might be legal reasons why you can't, or shouldn't, include it. BTW, this firmware is specific to Broadcom WiFi hardware. It's not loaded or used by any other WiFi hardware.

    Good Luck..
     
  19. Thomas

    Thomas McLovin

    Reputations:
    1,988
    Messages:
    5,253
    Likes Received:
    0
    Trophy Points:
    205
    OK, I will check on that.
    I know its propriety, but does anyone know why it isn't included?
     
  20. Patrick

    Patrick Formerly beat spamers with stiks

    Reputations:
    2,284
    Messages:
    2,383
    Likes Received:
    93
    Trophy Points:
    66
    Legal reasons.
     
  21. theZoid

    theZoid Notebook Savant

    Reputations:
    1,338
    Messages:
    5,202
    Likes Received:
    22
    Trophy Points:
    206
    If it's because of Broadcom, that's a pretty good reason to avoid their product if you ask me. That's the only language they understand.
     
  22. jas

    jas Notebook Evangelist

    Reputations:
    697
    Messages:
    622
    Likes Received:
    5
    Trophy Points:
    31
    Because it's proprietary software that's licensed for use, from the proprietor, (Broadcom). The way these things typically work, is that in order to use the software, the end user needs to be notified that the firmware component is governed by a Broadcom license, and they need to be provided with a copy of the license terms prior to downloading, or using, the software. If you wanted to legally distribute the Broadcom firmware yourself to end users, you would likely need to be authorized by Broadcom, as an Independent Software Vendor, and have some sort of contract from Broadcom to do so. So you see, it's much easier to distribute the firmware cutter program and have Broadcom users cut their own Windows firmware drivers, for use under Linux, than to try and do anything else legally.

    BTW, in terms of Intel, the wireless drivers themselves are licensed under the GPL v.2, but each of the wireless adapters requires a corresponding microcode or firmware image to be loaded in order to function. The microcode for the ipw3945 driver (ieee80211 based) also requires the use of a user space regulatory daemon. All of those binaries are distributed as binaries under a proprietary, free to redistribute (but not modify), license. In regards to Atheros WiFi hardware, the madwifi project is also trying to switch from using the proprietary HAL binary, to an open one, with the most recent driver work. Other examples of proprietary software often used with Linux, are the nVidia drivers. So it's something we in the Linux community live with today, but it shouldn't stop us from asking for full GPL support from the companies we buy our products from.

    Good Luck..
     
  23. Thomas

    Thomas McLovin

    Reputations:
    1,988
    Messages:
    5,253
    Likes Received:
    0
    Trophy Points:
    205
    OK, well, my distro has had some luck.
    The new guy who gave us a new site ships PCs with Linux(and possibly laptops).
    He will preinstall my distro if it is stable. :) And get us codecs and the firmware license.
     
  24. theZoid

    theZoid Notebook Savant

    Reputations:
    1,338
    Messages:
    5,202
    Likes Received:
    22
    Trophy Points:
    206
    Thanks for clearing that up, jas. Yes, they need to know they've lost sales due to linux problems. It's scary to me, because lack of decent hardware drivers could bring down linux.
     
  25. jisaac

    jisaac Notebook Deity

    Reputations:
    306
    Messages:
    1,141
    Likes Received:
    0
    Trophy Points:
    55
    Thomas, what are you using to build ur distro, linux from scratch?
     
  26. Thomas

    Thomas McLovin

    Reputations:
    1,988
    Messages:
    5,253
    Likes Received:
    0
    Trophy Points:
    205
    No, its based on Linux Mint.
    I'm using Remastersys.