Hate fancy HTML and CSS? View this guide in plain text!

Liberating Void Linux

Void Linux is a great operating system that is similar to that of
Arch Linux. Though it is very different.

Void Linux is a nearly libre OS. It has a separate non-free repo,
but like Fedora, is distributed with non-free firmware.

Warning! Currently this guide's solution is to leave an unresolved dependency with
the base-system meta package and the wifi-firmware meta package. If you are uncomfortable with this,
please wait until a method that does not leave unresolved dependencies exists. So far my system has
been stable with this, but your mileage may vary.

If this is your first time using a libre kernel/firmware, you may want to test your hardware with a
Trisquel live iso. Some of your harware may not work to your expectations and you should be sure
you want to proceed.

Downloading a libre kernel

The first step is downloading a libre kernel.
There are many choices, old and new. I would recommend the latest
LTS (long term support) kernel just for stability reasons.

I used the 4.9.168-gnu release.
Once you find the version you want, download the file that is around 80M
or bigger. Remember to verify the signature to make sure you download
has not been compromised or corrupted.

Then extract the tar.

Compiling the kernel

Now comes the difficult part with many choices and waiting.
First cd into the directory.

cd linux-4.9.168

Then you are going to configure your kernel. If you are unsure about configuring
a kernel for your system you can either find a guide for your hardware, or you can
use the default config. Just be sure that if you are on a 32bit system that you are
compiling a 32bit kernel. Don't forget to save.

make O=./build/kernel menuconfig

Now you are going to compile the kernel. You may be missing some tools needed to compile
but it will tell you what you need. This may take a while.

make O=./build/kernel

Now that you are done compiling, you need to make install the kernel.
This process is much shorter than compiling.

sudo make O=./build/kernel modules_install install


Installing the kernel

Before we start moving files over. You should have your kernels full version name
on hand as you will need it to follow Void's naming scheme and to generate the
initramfs. With this command, the text to the right of version is the full version name
of the kernel.

file build/kernel/arch/x86/boot/bzImage

Next we will be copying some files and our kernel into the boot directory.
You will need to be root for the rest of the guide.
You will need to replace instances of VERSION with your version name.

cp build/kernel/arch/x86/boot/bzImage /boot/vmlinuz-VERSION

cp build/kernel/System.map /boot/System.map-VERSION

cp build/kernel/.config /boot/config-VERSION

Next we will generate the initramfs for the kernel.

mkinitrd /boot/initramfs-VERSION.img VERSION

At this point the kernel is installed. To be safe we are going to test the kernel before
removing the non-free kernels and firmware. You are going to need to run this command.
If your version of the kernel and initramfs shows up in the list, it has been detected
successfully.

update-grub


Testing the kernel and removing non-free bits

You should now be able to reboot into the libre kernel. If it works you may now
start removing the non-free bits. There are a couple things that need to be removed.
The firmware packages and the default kernel. As the warning at the top of the page states
running the following command will leave an unresolved dependency for the base-system
meta package and the wifi-firmware meta package
.
Note, before removing the non-free packages you may want to make sure that devices like wireless
adapters are either supported by the kernel you are using, or that you have way of installing any libre
firmware after.

xbps-remove -RF linux-firmware-amd linux-firmware-intel linux-firmware-network linux-firmware-nvidia linux \

ipw2100-firmware ipw2200-firmware intel-ucode

update-grub

Now if you don't have to install any further firmware, you have completed the guide and should have a libre
kernel and firmware on Void Linux. Enjoy!