Installing Slackware on a Libreboot with a GNU GRUB payload

Preface, I just got a Librebooted Thinkpad x200 from a friend. I originally planned to install OpenBSD on the machine but soon realised the Qualcomm wifi card was not supported. So I went back to the drawing board and eventually landed on Slackware Linux. It really has a charm to it, being one of the only mainstream Linux distributions without a true package manager. I will admit, I am a Slackware noob, but I find the operating system very intriguing, and was very excited to install it. It also has a unique installation on a GRUB payload Librebooted system you need to do a few things differently than you would have on a normal system, or different OS.

Install Slackware

Assuming you've flashed a usb stick with the newest version of Slackware, you can plug it into your device then boot. Now, mash the delete key until you see the base GRUB screen. Press `u` to scan usb devices for isolinux. If everything went right you should see a few options:

You'll want to select kms.s unless your system is a single core (then select huge.s). Now you'll be dropped into the live environment of Slackware! We can partition our disks with fdisk or cfdisk for a basic install, use GPT with a 2GB swap, and the remaining partitioned for the system. It should look something like:

Now we have to mount sda2 to the /mnt directory so Slackware installs the system properly. Run the following:


mount /dev/sda2 /mnt

Now you can continue with the basic install by executing the setup command. Once you've finished the Slackware install (it's really easy) reboot your system and move onto the next section.

Configuring your GRUB Config

Your system should blow up with errors at this point, and you'll be dropped back to the GRUB menu where we pressed `u` to scan the usb. Now we have to boot back into the system via the GRUB command line. Press `c` and run the following commands:


set root=(ahci0,gpt2) 
linux /boot/vmlinuz iomem=relaxed resume=/dev/sda1 root=/dev/sda2 acpi_osi="Linux" vt.default_utf8=1 rfkill.default_state=0 video=1280x800 ro
initrd /boot/initrd.gz
boot

NOTE: You may need to specify root to a different device depending on your setup. For me its ahci0 at gpt2 which can sort of be translated to `my harddrive at partition 2`. You'll want to also change the video flag to your resolution.

Now that we're back in Slackware, lets make sure we never have to drop down to the GRUB command line ever again. Using an editor of your choice create a Libreboot configuration file: /boot/grub/libreboot_grub.cfg. Add the following to.


default=0 
timeout=5
menuentry "Slackware Linux" --class gnu-linux {
set root=(ahci0,gpt2)
linux /boot/vmlinuz iomem=relaxed resume=/dev/sda1 root=/dev/sda2 acpi_osi="Linux" vt.default_utf8=1 rfkill.default_state=0 video=1280x800 ro
if [ -e "/boot/initrd.gz" ]; then
initrd /boot/initrd.gz
fi
}

Now you can reboot your system to double check if GRUB detects your config. If it does you're all good! If not, back to the drawing board. Thanks for reading, and keep on keeping on.

Related links



Checkout the source code for this site on github.

All opinions expressed on this website are that of my own, they do not reflect those of my employer(s); future, past, or present.