Compiling Custom Linux Kernel With PAE And PF-Patch On Arch Linux

The x86 Linux kernel in the official Arch Linux repository oddly doesn’t have PAE enabled by default. So I decided to compile my own with PAE as well as -pf patch set.

WARNING: Compiling and installing your own kernel can / will take VERY LOOOONG and be DANGEROUS. There are pre-compiled PAE kernels available as well as -pf ones, if that’s only what you want. If you are a regular user who don’t want to take that risk, or even don’t know what Linux kernel is, just follow these links and enjoy your life.

So you still decided to do it manually, huh? Very brave and good choice. So let’s begin.

First let me introduce the kernel we’re going to compile. PAE (Physical Address Extension) makes it possible to use as many as 64GB of physical RAM with 32-bit kernel. PF patch set includes “-ck” patch set, BFS scheduler, BFQ I/O sched, TuxOnIce feature and UKSM patch (the last one comes from China).

1) Get PKGBUILD for “linux-pf” package from AUR. Use yaourt or download here then $ makepkg.

We can also (optionally) edit the PKGBUILD before really start using it. You can change the URL to download Linux kernel, for example to a local mirror. That’ll save you some time. Change the first line of “source” as you want and save.

2) Start compiling and building package.

 — 2.a Choosing base config:

        First you will be asked whether to use “your running kernel’s config”, “make localmodconfig” or “build an all-inclusive kernel like stock -ARCH“.

The second choice should be used with caution, because it means that you only compile the drivers you loaded now, and if you add a new device later (even a USB mouse you don’t use now), it will NOT get recognized and run by your custom kernel.

Here I recommend the last choice, though it’ll take longer than the second, it’s the best choice for most people.

— 2.b Manually config:

  Since the default config for “linux-pf” still comes with PAE (CONFIG_HIGHMEM64G) disabled, we need to alter that choice. Here we can use “make menuconfig” (you can also use GUI-based ones), and change “Process type and features” — “High Memory Support” to the 64G choice. (You can also manually modify “.config” file and change “CONFIG_HIGHMEM64G” to “y”.)

 — 2.c Wait for compiling.

If it’s not too late to say it now (which it definitely is, ha~ha), you can change “/etc/makepkg.conf” (before you start the whole thing) and make the compiling multithreaded (useful for systems with Dual/Quad core CPUs). Read the docs for how.

3) Install the compiled kernel.

There should be two packages, for kernel and its headers. After installiation, (backup your grub.cfg and) # mkinitcpio -p linux-pf , # grub-mkconfig -o /boot/grub/grub.cfg , then restart the computer to use the new kernel.


This is the first time I post here in English. Hope it is English anyway.

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注