Introduction
Don't be a Pink, get Slack! Become an ordained bhyve-Minister today by installing the oldest Linux distribution there was, is and ever will be – Slackware Linux.
Ok, now seriously: Slackware 15.0 is out since some time after a really long period of no releases (the last version, 14.2, was released in 2016), I was eager to try it out.
The installation is not straightforward, though. Slackware Linux uses a rather uncommon bootloader,
In this tutorial, I will show how to use Grub instead.
Creating the virtual machine
I am using sysutils/vm-bhyve to manage my virtual machine. For Slackware-Linux, I chose the following template, which I stored in /vm/.templates/slack.conf:
The only important things here are that we are going to use “uefi” as the loader and an EFI-frambuffer (
Let's create the VM and start the installation process:
On another console, start the VNC-client (e.g. net/vncviewer)
Disk partitioning and running the installer
The installer will ask you to choose a keyboard map, after that, it will drop you into a shell, where you need to partition the harddrive:
Here is the setup I am using for this tutorial:
The installer is ok-ish from an experienced user perspective. Just keep the following in mind for continuing the tutorial:
Post-installation steps
In the shell, you will be inside the minimal installation environment again. The actual system is mounted under /mnt. Let's chroot into that and continue our work:
Mount the EFI partition:
Install Grub: This will create an additional directory in the EFI partition, but will also install the necessary Grub-modules in /boot/grub.
For some reason,
Furthermore, the Grub-bootloader in the EFI-partition – as installed in the previous step – does not work. We will replace it with a custom one:
First, remove all stuff from the EFI-partition:
Next, create a configuration file for Grub, which configures the location where Grub can find its modules and the actual configuration file: Put the following content into the file /boot/grub/grub-embedded.cfg:
Here, two variables are set,
Using this configuration, we create the Grub bootloader image:
The result will be the file EFI/BOOT/BOOTX64.EFI inside the EFI-partition.
Finally, we create the actual Grub-configuration containing our kernels, etc.:
That should be it:
Since we are in a chroot-environment, the
Final touch
The initial ramdisk (/boot/initrd.gz) is too big for the
Don't be a Pink, get Slack! Become an ordained bhyve-Minister today by installing the oldest Linux distribution there was, is and ever will be – Slackware Linux.
Ok, now seriously: Slackware 15.0 is out since some time after a really long period of no releases (the last version, 14.2, was released in 2016), I was eager to try it out.
The installation is not straightforward, though. Slackware Linux uses a rather uncommon bootloader,
elilo, which does not work with bhyve-UEFI.In this tutorial, I will show how to use Grub instead.
Creating the virtual machine
I am using sysutils/vm-bhyve to manage my virtual machine. For Slackware-Linux, I chose the following template, which I stored in /vm/.templates/slack.conf:
Code:
loader="uefi"
cpu=4
graphics="yes"
memory=8192M
network0_type="virtio-net"
network0_switch="public"
disk0_type="virtio-blk"
disk0_name="disk0.img"
graphics="yes").Let's create the VM and start the installation process:
Code:
# vm create -t slack -s 128G slackguest
# vm install slackguest slackware64-15.0-install-dvd.iso
On another console, start the VNC-client (e.g. net/vncviewer)
Code:
# vncviewer 0.0.0.0:5900
Disk partitioning and running the installer
The installer will ask you to choose a keyboard map, after that, it will drop you into a shell, where you need to partition the harddrive:
Code:
# fdisk /dev/vda
Here is the setup I am using for this tutorial:
- Use a GPT partition (not DOS).
- First partition (/dev/vda1) is the EFI partition; 256MB should be enough.
- Second partition (/dev/vda2) is the Linux root partition; I chose 120G to leave some space for swap.
- Third partition (/dev/vda3) is the swap partition.
Code:
# setup
The installer is ok-ish from an experienced user perspective. Just keep the following in mind for continuing the tutorial:
- Activate /dev/vda3 as swap.
- When asked, coose ext4 as filesystem for the main partition /dev/vda2.
- When asked whether setup shall format the EFI parition, answer “Yes”.
- When asked whether to skip LILO installation and proceed to ELILO installation, confirm.
- When asked whether to ceate an UEFI boot entry, simply say “Yes”.
Post-installation steps
In the shell, you will be inside the minimal installation environment again. The actual system is mounted under /mnt. Let's chroot into that and continue our work:
Code:
# chroot /mnt /bin/bash
# source /etc/profile
Mount the EFI partition:
Code:
# mkdir /mnt/efi
# mount /dev/vda1 /mnt/efi
Install Grub: This will create an additional directory in the EFI partition, but will also install the necessary Grub-modules in /boot/grub.
Code:
grub-install --target=x86_64-efi --efi-directory=/mnt/efi
For some reason,
grub-install does not install a font, which is needed when booting into an EFI-framebuffer console:
Code:
cp /usr/share/grub/dejavusansmono.pf2 /boot/grub/fonts/
Furthermore, the Grub-bootloader in the EFI-partition – as installed in the previous step – does not work. We will replace it with a custom one:
First, remove all stuff from the EFI-partition:
Code:
rm -r /mnt/efi/EFI/*
Next, create a configuration file for Grub, which configures the location where Grub can find its modules and the actual configuration file: Put the following content into the file /boot/grub/grub-embedded.cfg:
Code:
set root=hd0,gpt2
set prefix=($root)/boot/grub
root and prefix. The first one tells Grub where to find the Linux kernel(s), but in Grub's own notation: “hd0” means “first hard drive in the system” and “gpt2” means second (GPT-)partition. So, hd0,gtp2 amounts to /dev/vda2, which is exactly what we want. The second variable (prefix) tell Grub where to find its modules and the main configuration file –Using this configuration, we create the Grub bootloader image:
Code:
# grub-mkimage --format=x86_64-efi --output=/mnt/efi/EFI/BOOT/BOOTX64.EFI --config=grub-embedded.cfg --compression=xz --preifx=/boot/grub part_gpt ext2
Finally, we create the actual Grub-configuration containing our kernels, etc.:
Code:
# grub-mkconfig -o /boot/grub/grub.cfg
That should be it:
Code:
# umount /mnt/efi
Since we are in a chroot-environment, the
poweroff does not work. But it is o.k. to do it from the host using the following command:
Code:
# vm poweroff slackguest
Final touch
The initial ramdisk (/boot/initrd.gz) is too big for the
huge-kernel we are using, leading to annoying “duplicate kernel symbols” warning messages on boot up. Once you have started your VM, create a new one by using the following command:
Code:
mkinitrd -c -k 5.15.19 -f ext4 -r /dev/vda2 -u -o /boot/initrd.gz