Difference between revisions of "Kernel/Arch Build System"

From ArchWiki
Jump to navigation Jump to search
(hups, wrong button... adapted to new PKGBUILD)
m (hilite for pkgbase=linux)
Line 16: Line 16:
==Modifying the PKGBUILD==
==Modifying the PKGBUILD==
Modify the PKGBUILD of the official linux package.
Modify {{ic|1=pkgbase=linux}} for your custom package name.
===Changing pkgbase===
Modify pkgbase=linux for your custom package name.

Revision as of 14:58, 29 September 2012

zh-CN:Kernels/Compilation/Arch Build System The Arch Build System can be used to build a custom kernel based on the official linux package. This compilation method can automate the entire process, and is based on a very well tested package. You can edit the PKGBUILD to use a custom kernel configuration or add additional patches.

Getting the Ingredients

# pacman -S abs base-devel

First of all, you need a clean kernel to start your customization from. Fetch the kernel package files from ABS:

$ ABSROOT=. abs core/linux

Then, get any other file you need (e.g. custom configuration files, patches, etc.) from the respective sources.

Modifying the PKGBUILD

Modify pkgbase=linux for your custom package name.


Tip: Running compilation jobs simultaneously can reduce compilation time significantly on multi-core systems.

You can now proceed to compile you kernel by the usual command makepkg If you have chosen an interactive program for configuring the kernel parameters (like menuconfig), you need to be there during the compilation.

Note: A kernel needs some time to be compiled. 1h is not unusual.


After the makepkg, you can have a look at the linux.install file. You will see that some variables have changed. Now, you only have to install the package as usual with pacman (or equivalent program):

# pacman -U <kernel_package>

Boot Loader

Now, the folders and files for your custom kernel have been created, e.g. /boot/vmlinuz-linux-test. To test your kernel, update your bootloader (/boot/grub/menu.lst for GRUB) and add new entries ('default' and 'fallback') for your custom kernel. That way, you can have both the stock kernel and the custom one to choose from.