Install Void Linux with kernel 5.2 (and optional dm-crypt LUKS disk encryption - no LVM - on a GPD MicroPC)
Probably you’ll be better off with the official docs which base installation on an easy-to-use wizard. This guide is adapted to my special needs, but you can follow it if you please or need; I’ll mark special those parts –like this– and close –/like this–. Everything after a
# is a comment, the
> symbols means that you should fill that field with custom data.
In the grub screen type
nomodeset fbcon=rotate:1 to the line where you can see
vmlinuz (not after \) then press
You can also rotate the screen by running
echo 1 | tee /sys/class/graphics/fbcon/rotate after the system has been initialized, but you still need
nomodeset because of screen drivers.
Login with user
root and password
bash to get a proper interactive shell.
Set your keymap layout with
loadkeys <layout> (as I’m a latino using a US keyboard I do use
Partition your disk with
dto delete partitions
nto create new partitions
tto change partition types
Wto write changes
delete all partitions, create a
new partition of
260M and set
EFI System, then create a
new partition with the rest of available space (default).
Format and mount root
(I’m assuming your hard drive is /dev/sda, you can check with
mkfs.fat -F 32 /dev/sda1 mkfs.ext4 /dev/sda2 # this and next line not needed if you want LUKS encryption mount /dev/sda2 /mnt
Prepare the drive. I think this is not needed if your disk was encryped before and the passphrase was not compromised.
cryptsetup open --type plain -d /dev/urandom /dev/sda2 cryptroot # open partition # Wipe all information safely. It's optional but recommended. It will take a while, wait until it throws "no space left on device" error. dd if=/dev/zero of=/dev/mapper/cryptroot status=progress [bs=1M] cryptsetup close cryptroot # close it
Encrypt. I use a keyfile, but you can use a password by ommiting the key file related instructions.
You can generate a 256 bytes random keyfile with
openssl rand 256 > keyfile or make it more human-readable by appending
-base after rand, be sure to save a copy of it!
It is wise to have more than one password / keyfile saved in different devices, so you don’t lose access if you lose your password device. You have been warned.
Some people think that you should have a password and a keyfile to be safe. I say passwords we are able to memorize are not trustable. Be sure to keep your secret keyfiles with you or on a safe place and don’t leave your drive in your laptop when you are not using it.
cryptsetup -v --type luks1 luksFormat /dev/sda2 <keyfile> # initialize luks cryptsetup -v luksAddKey /dev/sda2 --key-file <first-keyfile> <new-keyfile> # optionally add other keys cryptsetup open /dev/sda2 cryptroot --key-file <keyfile> # open the now encrypted disk mkfs.ext4 /dev/mapper/cryptroot # format it mount /dev/mapper/cryptroot /mnt
mkdir /mnt/boot mount /dev/sda1 /mnt/boot
Connect through wifi
wpa_passphrase "<NetworkName>" "<network-password>" > /etc/wpa_supplicant/<NetworkName>.conf wpa_supplicant -i <wireless-interface> -B -c /etc/wpa_supplicant/<NetworkName>.conf sv reload dhcpcd # just in case
Install the system. I could use base-system, but MicroPC needs the newest firmware. This installs almost everything in base-system.
xbps-install -Sy -R http://mirror.clarkson.edu/voidlinux/current -r /mnt base-voidstrap usbutils wpa_supplicant wifi-firmware ethtool acpid libgcc linux5.2 linux5.2-headers linux-firmware-intel linux-firmware-network dracut cryptsetup grub-x86_64-efi
Copy your wireless connection
cat /etc/wpa_supplicant/<NetworkName>.conf >> /mnt/etc/wpa_supplicant/wpa_supplicant.conf
Chroot into your new installation
mount -t proc /proc /mnt/proc mount --rbind /dev /mnt/dev mount --rbind /sys /mnt/sys chroot /mnt /bin/bash
Setup the basics
passwd root echo <your-hostname> > /etc/hostname useradd <your-user> passwd <your-user> # Uncomment first line starting with %wheel on /etc/sudoers usermod -a -G wheel <your-user> # Set your TIMEZONE and KEYMAP on /etc/rc.conf echo "LANG=<langcode>_<COUNTRYCODE>.UTF-8" > /etc/locale.conf # Uncomment '<langcode>_<COUNTRYCODE>.UTF-8 UTF-8' on /etc/default/libc-locales xbps-reconfigure -f glibc-locales
Append your partitions to
printf "UUID=$(lsblk /dev/mapper/cryptroot -o UUID | tail -1)\t/\text4\tdefaults\t0\t1\n" >> /etc/fstab printf "UUID=$(lsblk /dev/sda1 -o UUID | tail -1)\t/boot\tvfat\tdefaults\t0\t2\n" >> /etc/fstab
rd.auto=1 if you use LUKS, plus
rd.luks.key=/<keyfile> if you use a keyfile to
grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id="GRUB" grub-mkconfig -o /boot/grub/grub.cfg
echo 'add_drivers+=" vfat "' > /etc/dracut.conf.d/drivers.conf # for keyfiles on fat drives echo 'add_dracutmodules+=" crypt "' > /etc/dracut.conf.d/dracutmodules.conf # for LUKS
It’s recommended to
echo 'hostonly=yes' > /etc/dracut.conf.d/hostonly.conf so it loads only required config, but this breaks my installation (
codepage cp437 not found, related to fs-FAT, and keyboard becomes unresponsive). Let me know if you find out how to load the proper configuration on a MicroPC!
Setup your init ram disk
xbps-reconfigure -f linux5.2
Installation is ready to go,
Felix Freeman < sir a-rro-ba hacktivista pun-to com > releases this document on 2019 under the CC0 terms.
Love, peace and freedom to you and the world we share.