Request for Kernel Compiling info. Please read.


  • Moderator

    The wiki article on compiling custom kernels is a bit outdated and doesn’t contain all the needed information for an inexperienced user. We want people to be able to identify the instructions for the Linux they are using and follow them step-by-step. As they get more comfortable, they can begin modifying the instructions to get newer or older kernel versions or try different .config files.

    If you know how to compile a custom kernel on various flavors and versions of Linux, we need that information for the wiki. Please reply with as much information as you can about how to compile a custom kernel in your favorite Linux.

    Include pre-reqs and how to get them, dev tools, compilers, etc to get the computer setup for kernel compiling. Include instructions for getting the kernel source, copying and moving files around, getting config files, and doing the actual compile.

    Any information you have about kernel compiling for FOG is welcome.



  • Ozzy - well done, great info. Like Jaymes Driver, I used your process (slightly edited for use in command line only Ubuntu 12.04 LTS) to compile a new kernel with SCSI drivers included, for working with VMWare SAS disk virtual machines. Thanks mate :)

    P.S. add a few more screen shots and it’s good for the wiki!



  • www.kernel.org. (Used linux-3.10-rc2.tar.xz for this document; https://www.kernel.org/pub/linux/kernel/v3.x/testing/linux-3.10-rc2.tar.xz) Download the file to the ‘home/user/Downloads/’ directory. (default)

    Then, download the Fog installation package installer. (Current version 0.32;http://sourceforge.net/projects/freeghost/files/FOG/fog_0.32/fog_0.32.tar.gz/download) Make sure to download to the ‘home/user/Downloads/’ directory. (default)

    Now we will extract the files to their proper locations.

    First, extract the FOG installer to the download folder. (see below for command)
    [B]sudo [/B][B]tar -xvf /home/user/Downloads/fog_0.32.tar.gz[/B]

    Then, we will want to extract the kernel to the ‘/usr/src/kernels/’ directory. If the directory does not exist create it. You will also need to copy the tar.gz file to the kernels directory in order to extract properly. (see below for commands)
    [B]sudo mkdir /usr/src/kernels/[/B]
    [B]sudo cp /home/user/Downloads/linux-3.10-rc2.tar.xz /usr/src/kernels/[/B]
    [B]cd /usr/src/kernels/[/B]
    [B]sudo tar –xvf linux-3.10-rc2.tar.xz[/B]

    Now we can either use CORE or Kitchen Sink to create the kernel.

    To use [B]Core[/B] use the following command:
    [B]sudo cp [/B][B]/home/username/Downloads/fog_0.32/kernel/core.config /usr/src/kernels/linux-3.10-rc2/.config[/B]

    To use [B]Kitchen Sink[/B] use the following command:
    [B]sudo cp [/B][B]/home/username/Downloads/fog_0.32/kernel/kitchensink.config /usr/src/kernels/linux-3.10-rc2/.config[/B]

    Once the .config file is copied to /usr/src/kernels/ you can now run the make xconfig command.
    [B]cd /usr/src/kernels/linux-3.10-rc2[/B]
    [B]sudo make xconfig[/B]

    Now the kernel editor should pop-up after a few seconds. Here is where you will locate and select/deselect drivers you want to load to your custom kernel. (see screenshot for example)

    ""

    Once you are done with your selections just [B]save and quit[/B].

    Now you have to run one final command to write the kernel file.

    For 64-bit systems:
    [B]sudo make ARCH=i386 bzImage[/B]

    For 32-bit systems:
    [B]sudo make bzImage[/B]

    You may get a few prompts during the compile, I just used default options (enter). It will take a while (10-30 minutes) to compile the kernel so be patient.

    Now that you have created a custom kernel you will need to copy/cut the file to your FOG server.
    Go to the [B]/usr/src/kernels/linux-3.10-rc2/arch/x86/boot/[/B] directory to find the new [B]bzImage[/B] file you created. That is the file you need to import to your FOG server kernels directory in order to use it. (You can rename it or use the new kernel as the default kernel for FOG to use if you leave the name bzImage)

    The directory where you should paste the new kernel is /tftpboot/fog/kernel/ on the FOG server.

    Make sure you assign the custom kernel to the proper host in the FOG management GUI and then you should be able to Upload/Deploy. You might need to add the host manually; you’ll just need the MAC address of the NIC for the host.

    [B][I]Written by Ozzy[/I][/B][/quote]

    Awesome walk threw!!! I was able to build a custom kernel and it worked great. Thanks!


  • Developer

    Thanks for this great guide Ozzy, I used it to create a custom kernel for my VMWare server using SCSI drives!!!




  • Moderator

    When I get some time next week, I’ll go through this and verify the procedure/update the wiki. Thanks for your contributions. Keep them coming for other Distros and Versions.



  • Hi,

    @Ozzy you should mention in your tutorial that qt4 is recommended but not needed and that alternatively qt3 also works.
    Afaik qt3 is preinstalled on ubuntu. once editing it, maybe add make menuconfig and optionally make xconfig.

    Iam thinking about writing a shell script that downloads the latest kernel sources, unpack, check for requirements, check installed environment, architecture and start menu(x)config or compiling, copy ready bzImage.

    Is there a latest online version available for download for ks.config and core.config? Then i could additionally add to use a scratch config

    Greetz X23



  • Hi,

    use make menuconfig instead of make xconfig
    xconfig uses a xserver for the gui this is not really needed so just use menuconfig this works in shell.

    Here is an example how it looks like when using menuconfig:

    ""

    Greetz X23



  • Just a quick question:

    Is it possible to build a custom kernel using this HowTo, if one is using a server version of Ubuntu, which means with no GUI? Is there a command line version of the kernel editor (which would have to be a text file I guess)? Or would I really have to use a desktop version of Ubuntu?



  • Chad,

    Hope this can be used to update the wiki.

    www.kernel.org. (Used linux-3.10-rc2.tar.xz for this document; https://www.kernel.org/pub/linux/kernel/v3.x/testing/linux-3.10-rc2.tar.xz) Download the file to the ‘home/user/Downloads/’ directory. (default)

    Then, download the Fog installation package installer. (Current version 0.32;http://sourceforge.net/projects/freeghost/files/FOG/fog_0.32/fog_0.32.tar.gz/download) Make sure to download to the ‘home/user/Downloads/’ directory. (default)

    Now we will extract the files to their proper locations.

    First, extract the FOG installer to the download folder. (see below for command)
    [B]sudo [/B][B]tar -xvf /home/user/Downloads/fog_0.32.tar.gz[/B]

    Then, we will want to extract the kernel to the ‘/usr/src/kernels/’ directory. If the directory does not exist create it. You will also need to copy the tar.gz file to the kernels directory in order to extract properly. (see below for commands)
    [B]sudo mkdir /usr/src/kernels/[/B]
    [B]sudo cp /home/user/Downloads/linux-3.10-rc2.tar.xz /usr/src/kernels/[/B]
    [B]cd /usr/src/kernels/[/B]
    [B]sudo tar –xvf linux-3.10-rc2.tar.xz[/B]

    Now we can either use CORE or Kitchen Sink to create the kernel.

    To use [B]Core[/B] use the following command:
    [B]sudo cp [/B][B]/home/username/Downloads/fog_0.32/kernel/core.config /usr/src/kernels/linux-3.10-rc2/.config[/B]

    To use [B]Kitchen Sink[/B] use the following command:
    [B]sudo cp [/B][B]/home/username/Downloads/fog_0.32/kernel/kitchensink.config /usr/src/kernels/linux-3.10-rc2/.config[/B]

    Once the .config file is copied to /usr/src/kernels/ you can now run the make xconfig command.
    [B]cd /usr/src/kernels/linux-3.10-rc2[/B]
    [B]sudo make xconfig[/B]

    Now the kernel editor should pop-up after a few seconds. Here is where you will locate and select/deselect drivers you want to load to your custom kernel. (see screenshot for example)

    ""

    Once you are done with your selections just [B]save and quit[/B].

    Now you have to run one final command to write the kernel file.

    For 64-bit systems:
    [B]sudo make ARCH=i386 bzImage[/B]

    For 32-bit systems:
    [B]sudo make bzImage[/B]

    You may get a few prompts during the compile, I just used default options (enter). It will take a while (10-30 minutes) to compile the kernel so be patient.

    Now that you have created a custom kernel you will need to copy/cut the file to your FOG server.
    Go to the [B]/usr/src/kernels/linux-3.10-rc2/arch/x86/boot/[/B] directory to find the new [B]bzImage[/B] file you created. That is the file you need to import to your FOG server kernels directory in order to use it. (You can rename it or use the new kernel as the default kernel for FOG to use if you leave the name bzImage)

    The directory where you should paste the new kernel is /tftpboot/fog/kernel/ on the FOG server.

    Make sure you assign the custom kernel to the proper host in the FOG management GUI and then you should be able to Upload/Deploy. You might need to add the host manually; you’ll just need the MAC address of the NIC for the host.

    [B][I]Written by Ozzy[/I][/B]


Log in to reply
 

346
Online

38727
Users

10554
Topics

99923
Posts

Looks like your connection to FOG Project was lost, please wait while we try to reconnect.