How to build your own kernel on Slackware Linux

With all the noise lately about Dirty COW (CVE-2016-5195) and the lack of patched kernels from Slackware’s “Benevolent Dictator for Life”, I decided it was time to roll up the sleeves and get it done. Since Slackware doesn’t have a “sophisticated” build system and all that grease, it’s a trivial matter to step up to the plate and take responsibility for your own system. I’ll be using “vanilla-kernelversion” as my tag for the kernel and initrd. Also notice that I build my kernels as a normal user.

Download and verify the kernel source

Create a directory for building the new kernel:

mkdir ~/kernel; cd ~/kernel

Download the kernel source and signature from


Decompress the archive:

unxz linux-4.4.27.tar.xz

Verify the .tar archive against the signature (this will fail as I don’t have the public key yet):

gpg2 --verify linux-4.4.27.tar.sign

Notice the “key ID” from the output of the previous step and download it from a key server:

gpg2 --keyserver hkp:// --recv-keys 6092693E

Verify the .tar archive against the signature again and look for the “Good signature” message:

gpg2 --verify linux-4.4.27.tar.sign

Extract the tarball if everything checked out:

tar -xvf linux-4.4.27.tar

Enter the kernel source directory and clean the kernel tree:

cd linux-4.4.27
make clean && make mrproper

Configuring and compiling the kernel

There is obviously no reason to configure a brand new kernel from scratch when already running a generic stock Slackware kernel. Make sure you’re still in the kernel source directory and issue the following command to copy the running kernel configuration:

zcat /proc/config.gz > .config

For simplicity, I want all new configuration options to be set to their defaults. By using “olddefconfig” you’ll automatically chose the defaults without any manual handling:

make olddefconfig

To speed up the compiling, make sure to run make with the “-j” option (number of cores+1):

make -j9

Compiling kernel modules and installation

Everything from this point and onward is done as root. Switch to the root user and reenter the kernel source directory.
Proceed to install the kernel modules:

make modules_install

Copy the kernel to the boot directory and rename it (the location of the kernel image is the same for x86_64 and x86):

cp arch/x86/boot/bzImage /boot/vmlinuz-vanilla-4.4.27

Copy the to the boot directory and rename it:

cp /boot/

Copy the kernel .config to the boot directory and rename it:

cp .config /boot/config-vanilla-4.4.27

Enter the boot directory:

cd /boot

Delete the old link:


Create a new link:

ln -s

Initrd and LILO

I need to create an initial ramdisk to boot my kernel so I’ll use the mkinitrd command to create one. I’ll leave it to Slackware to identify which modules are needed by running with the “-k” parameter to specify the new kernel version. To avoid wiping my existing initrd I’ll name it initrd-vanilla-4.4.27. I’ll use the output from the generator to create the initrd (remember to modify the initrd name):

/usr/share/mkinitrd/ -k 4.4.27
# Don't go copying the next line, that's an example.  
mkinitrd -c -k 4.4.27 -f ext4 -r /dev/sda2 -m jbd2:mbcache:ext4 -u -o /boot/initrd-vanilla-4.4.27.gz

To boot the new kernel, it needs to be added to LILO. Make sure to not remove the entry specifying your running Slackware kernel. If the new kernel doesn’t run, it’s practical to boot into a working one.

nano /etc/lilo.conf

Create a new entry for the new kernel (I’m using mine as default but that’s optional):

default = Vanilla  

image = /boot/vmlinuz-vanilla-4.4.27
  root = /dev/sda2
  initrd = /boot/initrd-vanilla-4.4.27.gz
  label = Vanilla

Finally, run the lilo command and it’s all done.


But I’m using ELILO

Me too, replace the LILO section with this part: Configuring ELILO with a generic kernel on Slackware 14.2

Downtime and kernel upgrade to patch “Dirty COW”

I’ve just performed a kernel upgrade on my Raspberry Pi 3 to patch CVE-2016-5195 aka “Dirty COW”. Privilege escalation vulnerabilities in the Linux kernel always gets my heart rate going, so I decided to immediately get the latest kernel (4.4.26) and firmware for this server.

The tool I’m using for kernel and firmware updates is rpi-update by Hexxeh. Usually I would first deploy updates to my RPi based build boxes for testing, but desperate times call for desperate measures. Anyhow, I’ve not noticed any regressions or other issues so far, but with bleeding edge there’s always a risk.

Rpi-update is intended for use with Raspbian but I’ve been using it on Slackware ARM for 18 months without issues. Still, before going down this path make sure it’ll work with your distribution. For all you IoT owners out there, it’s time to take some responsibility and start patching.

rpi-update on Slackware ARM
Rpi-update on Slackware ARM installing the latest kernel and firmware.

How much traffic does a Slackware review get in 2016

It has been 90 days since the release of Slackware 14.2 so I figured this might be a good time to quickly review some numbers from my server logs and take a peak in the Google Search Console. This server and Google Search Console both provide 90 days of data.

A short disclaimer: This is an informal survey and I make no claims to the extent that my numbers reflect the current public interest in the Slackware Linux distribution. Slackware has dedicated user and developer community and claims to the opposite should be laid to rest with the 14.2 release.

Google search - Is Slackware dead

Whenever I try a Google search prediction with the phrase “Is Slackware…” Google’s autocomplete function always seems to believe the appropriate suggestion to be “dead”.
With that chilling effect in mind, lets have a look at the actual numbers.

Google Search Console

If you’re not familiar with Google Search Console please note that “search analytics” only gives you data associated with your own site. That means you’ll only see clicks or impressions for queries where your site appeared in search results. In short, these numbers wont necessarily reflect any interest in Slackware beyond this limited scope.

Slackware 14.2 - Search Analytics
Queries containing “Slackware 14.2” for the period Jul 2 – Sep 29

As shown on the image above, the query “slackware 14.2 review” resulted in my site being listed 1156 times (impressions) and collected 519 clicks. I also received some traffic from other Slackware 14.2 related searches giving me a total of 801 clicks.

The traffic is modest to put it politely, but I do suspect the low numbers are a result of people relaying on Youtube for their GNU/Linux reviews. I’ve seen some good coverage on Slackware on Youtube so lets stick with that theory.

Analyzing server logs

I don’t use any analytics service on this site, so I’ll only have limited coverage parsed directly from my server logs. The server uses the NCSA extended/combined log format:

"%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\""

Having the referer and user-agent fields permits me to identify which external site (if any) the traffic originated from, and the user-agent permits me to identify bots. I keep traffic data for three months before the logs are automatically purged. To analyse relevant traffic I’ll be importing the server logs (while excluding bots) into a local Piwik installation as it’s to much of a hassle to write regexes to give me the information I want. Since I don’t have any client-side visitor data, I’ll focus on pageviews and referrers for the Slackware 14.2 review page.

Slackware 14.2 review - Pageviews for the period Jul 2 – Sep 29
The Slackware 14.2 review received 6030 pageviews during the period Jul 2 – Sep 29

Compared to the results from Google Search Console, it paints a more nuanced picture regarding the interest in the review. Organic search only accounts for 20% while website traffic makes up for 60% of the pageviews. As shown on the image above, a lot of traffic originates from Distrowatch which referred a total of 2071 visitors (and counting).

Happy slacking!