Building a Custom Kernel
Building a Custom Kernel
In FOG the kernel and the boot file system are separate and interchangeable, this makes it easier to upgrade a kernel without modifying the boot file system. This also means that all drivers in the kernel are build into the kernel instead of being compiled as modules. In our example we will be compiling the kernel on Fedora 9.
- Install the required packages to build the kernel with:
- RHEL/Fedora/CentOS/.rpm other: (need confirmation that this is all the packages required?!?, may also need qt-devel and a few others)
yum groupinstall "Development Tools"
- Ubuntu/Debian/.deb other:
sudo apt-get install qt3-dev-tools libqt3-mt-dev
- Download the latest kernel source (which in this case is version 220.127.116.11):
- Extract the tar file:
tar -zxvf linux-18.104.22.168.tar.gz
- Copy the .config file from the fog release package which is located in the Fog Setup ./kernel directory:
cp /opt/fog-setup/fog_0.29/kernel/kitchensink.config /usr/src/linux-22.214.171.124/.config
- Start configuring the kernel:
- RedHat forks:
- Ubuntu/Debian, etc:
- This will run the kernel configuration tool, you will need to navigate around it a little to get a feel for it as there are many options. Placing a check mark in a box will include it in the kernel, and unchecking an item will remove it from the kernel.
- To add or remove drivers from the kernel you will need to go to Device Drivers, and network drivers are in Network Device Support.
- Important: All settings required by fog are already in the kernel, when you are done making changes click save and close the application.
- Now you need to build the kernel:
- or possibly just:
- This could take 10 minutes, depending on the speed of your machine and how many options you checked.
- Backup your FOG kernel, and copy the new kernel image to your TFTP kernel folder, probably under /tftpboot:
sudo cp /tftpboot/fog/kernel/bzImage /tftpboot/fog/kernel/backup/bzImage_YYYYMMDDHHMMSS
- Of course, you can name your backup anything you want, that is simply the name convention used by FOG
sudo cp /usr/src/linux-126.96.36.199/arch/x86/boot/bzImage /tftpboot/fog/kernel/bzImage
- And, you're done! Try booting a client with your new kernel to test it. Repeat steps 5-7 above if you need to make any changes. If you are happy with your configuration, you can save the configuration by backing up the .config file located in the boot of the kernel source directory.
When building on x86_64 systems you may need to specify that you are building for an x86 target architecture.
make ARCH=i386 menuconfig
make ARCH=i386 bzImage