Request for Kernel Compiling info. Please read.
-
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.
-
Chad,
Hope this can be used to update the wiki.
[B]How to Build a Custom Kernel for FOG Server using Ubuntu 12.04[/B]
First, make sure you have [B]G++ (GNU C++ compiler) and QT4 (Qt 4 Designer) [/B]installed through the Ubuntu software center.
Next, pick a Linux kernel you want to use to compile the kernel at [URL=‘http://www.kernel.org’]www.kernel.org[/URL]. (Used linux-3.10-rc2.tar.xz for this document; [url]https://www.kernel.org/pub/linux/kernel/v3.x/testing/linux-3.10-rc2.tar.xz[/url]) Download the file to the ‘home/user/Downloads/’ directory. (default)
Then, download the Fog installation package installer. (Current version 0.32;[url]http://sourceforge.net/projects/freeghost/files/FOG/fog_0.32/fog_0.32.tar.gz/download[/url]) 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][FONT=Tahoma]tar -xvf /home/user/Downloads/fog_0.32.tar.gz[/FONT][/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][FONT=Tahoma]/home/username/Downloads/fog_0.32/kernel/core.config /usr/src/kernels/linux-3.10-rc2/.config[/FONT][/B]To use [B]Kitchen Sink[/B] use the following command:
[B]sudo cp [/B][B][FONT=Tahoma]/home/username/Downloads/fog_0.32/kernel/kitchensink.config /usr/src/kernels/linux-3.10-rc2/.config[/FONT][/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)
[IMG]http://i.imgur.com/a49MUxh.jpg?1[/IMG]
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][FONT=Tahoma]sudo make ARCH=i386 bzImage[/FONT][/B][FONT=Tahoma]For 32-bit systems:[/FONT]
[B][FONT=Tahoma]sudo make bzImage[/FONT][/B][FONT=Tahoma]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.[/FONT]
[FONT=Tahoma]Now that you have created a custom kernel you will need to copy/cut the file to your FOG server.[/FONT]
[FONT=Tahoma]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)[/FONT][FONT=Tahoma]The directory where you should paste the new kernel is /tftpboot/fog/kernel/ on the FOG server.[/FONT]
[FONT=Tahoma]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.[/FONT]
[B][I][FONT=Tahoma]Written by Ozzy[/FONT][/I][/B]
-
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?
-
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:
[IMG]http://docs.slackware.com/_media/slackbook:make-menuconfig-w.png[/IMG]
Greetz X23
-
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
-
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,
latest core.config:
[url]http://freeghost.svn.sourceforge.net/viewvc/freeghost/trunk/kernel/core.config[/url]Greetz X23
-
Thanks for this great guide Ozzy, I used it to create a custom kernel for my VMWare server using SCSI drives!!!
-
[quote=“Ozzy, post: 12320, member: 3595”]Chad,
Hope this can be used to update the wiki.
[B]How to Build a Custom Kernel for FOG Server using Ubuntu 12.04[/B]
First, make sure you have [B]G++ (GNU C++ compiler) and QT4 (Qt 4 Designer) [/B]installed through the Ubuntu software center.
Next, pick a Linux kernel you want to use to compile the kernel at [URL=‘http://www.kernel.org’]www.kernel.org[/URL]. (Used linux-3.10-rc2.tar.xz for this document; [url]https://www.kernel.org/pub/linux/kernel/v3.x/testing/linux-3.10-rc2.tar.xz[/url]) Download the file to the ‘home/user/Downloads/’ directory. (default)
Then, download the Fog installation package installer. (Current version 0.32;[url]http://sourceforge.net/projects/freeghost/files/FOG/fog_0.32/fog_0.32.tar.gz/download[/url]) 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][FONT=Tahoma]tar -xvf /home/user/Downloads/fog_0.32.tar.gz[/FONT][/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][FONT=Tahoma]/home/username/Downloads/fog_0.32/kernel/core.config /usr/src/kernels/linux-3.10-rc2/.config[/FONT][/B]To use [B]Kitchen Sink[/B] use the following command:
[B]sudo cp [/B][B][FONT=Tahoma]/home/username/Downloads/fog_0.32/kernel/kitchensink.config /usr/src/kernels/linux-3.10-rc2/.config[/FONT][/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)
[IMG]http://i.imgur.com/a49MUxh.jpg?1[/IMG]
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][FONT=Tahoma]sudo make ARCH=i386 bzImage[/FONT][/B][FONT=Tahoma]For 32-bit systems:[/FONT]
[B][FONT=Tahoma]sudo make bzImage[/FONT][/B][FONT=Tahoma]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.[/FONT]
[FONT=Tahoma]Now that you have created a custom kernel you will need to copy/cut the file to your FOG server.[/FONT]
[FONT=Tahoma]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)[/FONT][FONT=Tahoma]The directory where you should paste the new kernel is /tftpboot/fog/kernel/ on the FOG server.[/FONT]
[FONT=Tahoma]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.[/FONT]
[B][I][FONT=Tahoma]Written by Ozzy[/FONT][/I][/B][/quote]
Awesome walk threw!!! I was able to build a custom kernel and it worked great. Thanks!
-
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!