Void Linux laptop installation
Posted by on 2024-07-12 12:04:59:
I recently installed Void Linux on my laptop (Dell Latitude 7480), and these are the steps I took.
I started with the rootfs from a working headless system that I created from another Void box I have - so I won't detail the initial installation process here.
NOTE: This is a work in progress and I will update it to add any changes or additions I make.
I did this in a chroot environment, having booted from the SystemRecovery USB stick (my source rootfs booted from legacy bios).
mount /dev/sda2 /mnt/build
mount /dev/sda1 /mnt/build/boot/efi
mount -o bind /dev /mnt/build/dev
mount -o bind /sys /mnt/build/sys
mount -t proc /proc /mnt/build/proc
chroot /mnt/build /bin/bash
Once in the chroot it's possible to use all the Void Linux commands.
Create the config for Dracut
echo 'add_dracutmodules+=" resume "' >> /etc/dracut.conf
echo 'tmpdir=/tmp' >> /etc/dracut.conf
dracut --force --hostonly --kver 6.6.38_1 [your kernel version will vary]
OR
dracut --regenerate-all
dracut.conf
add_dracutmodules+=" resume " tmpdir=/tmp
Note the spaces on either side of the keyword " resume " above.
To enable the resume feature, you also need to add the swap partition ID to the kernel command line.
Edit
/etc/defaultgrub
and add the line below: (NOTE: the "=UUID=" is not an error)GRUB_CMDLINE_LINUX_DEFAULT="... resume=UUID="
You can get the UUID of your swap partition using:
ls -l /dev/disk/by-uuid
where you can match the UUID to the swap partition - it's also possible to use blkid
.Find the swap partition by running
fdisk -l /dev/sda
which will list the partitions and their types.This change requires grub.conf to be regenerated, which is performed in a step further down the page.
Install Intel Microcode
xbps-install intel-ucode
xbps-install iucode-tool
Create
/etc/dracut.conf.d/intel_ucode.conf
and add the following line:early_microcode="yes"
Get WiFi working (not required if connecting via Ethernet)
Create your encrypted passphrase and associated SSID in wpa_supplicant.conf
wpa_passphrase your-ESSID your-passphrase | sudo tee /etc/wpa_supplicant.conf
wpa_supplicant.conf
# Default configuration file for wpa_supplicant.conf(5). ctrl_interface=/run/wpa_supplicant ctrl_interface_group=wheel eapol_version=1 ap_scan=1 fast_reauth=1 update_config=1 # Add here your networks. network={ ssid="your_ssid" #psk="your_key" psk= }
Activate the services
ln -s /etc/sv/wpa_supplicant /var/service
ln -s /etc/sv/dhcpcd /var/service
Install requirements for EFI booting
xbps-install efibootmgr
xbps-install efitools
xbps-install efitools-efi
xbps-install dosfstools
The system requires a 512M EFI partition.
Fdisk layout and disk prep for EFI boot:
fdisk -l
Device Start End Sectors Size Type /dev/sda1 2048 1050623 1048576 512M EFI System /dev/sda2 1050624 498116607 497065984 237G Linux filesystem /dev/sda3 498116608 500117503 2000896 977M Linux swap
Create /etc/fstab
# /etc/fstab: static file system information. # # Use 'blkid' to print the universally unique identifier for a # device; this may be used with UUID= as a more robust way to name devices # that works even if disks are added and removed. See fstab(5). # ## UUID=5CE9-86CA /boot/efi vfat rw,noatime 0 0 UUID=b55f52a3-310a-43dc-a161-42ffd7bb4bbb / ext4 rw,noatime,data=ordered 0 0 UUID=40c670d5-a662-483e-9d01-1362d68dde87 none swap sw tmpfs /tmp tmpfs defaults,nosuid,nodev 0 0 #
Firmware
xbps-install linux-firmware-intel
Grub
xbps-install grub-utils
xbps-install grub-x86_64-efi
xbps-install grub-terminus
grub-mkconfig -o /boot/grub/grub.cfg
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=void_grub --boot-directory=/boot --recheck
Install 'x' window system and miscellaneous utilities.
xbps-install xorg
xbps-install xinit
xbps-install lightdm
xbps-install xfce4
xbps-install xorg-input-drivers
xbps-install xfce4-alsa-plugin
xbps-install libxfce4util
xbps-install alsa-ucm-conf
xbps-install sof-firmware
xbps-install laptop-mode
Disk Management Service, version 2:
xbps-install udisks2
Web browser:
xbps-install firefox
Office apps:
xbps-install libreoffice
Screen grabber:
xbps-install flameshot
Unzip (archive) utility:
xbps-install 7zip
xbps-install xarchiver
Install and enable the elogind service
xbps-install elogind
ln -s /etc/sv/elogind /var/service
Install Signal desktop messaging if required
xbps-install signal-desktop
Install Fonts
xbps-install google-fonts-ttf
xbps-install xorg-fonts
xbps-install ttf-ubuntu-font-family
xbps-install ttf-opensans
xbps-install ttf-bitstream-vera
xbps-install liberation-fonts-ttf
xbps-install dejavu-fonts-ttf
xbps-install fonts-adobe-*
xbps-install font-adobe-*
xbps-install font-adobe-100dpi
xbps-install font-adobe-75dpi
xbps-install font-adobe-source-serif-pro
xbps-install putty
xbps-install terminus-font
Install the fan utility for certain Dell laptops
xbps-install i8kutils
Install and configure required apps for automounting USB disks
xbps-install udevil
xbps-install udiskie
xbps-install xdg-utils
I created a script (automount.sh) to automatically start udiskie and devmon at login:
Add this to your session startup
#!/bin/bash # /usr/bin/udiskie --automount & /usr/bin/devmon --sync --exec-on-drive "notify-send -t 9000 --urgency=normal \"%l\" \"Connected device\"" &
Install polkitd and add the configuration below
xbps-install polkitd
Add the following to
vi /etc/polkit-1/rules.d/50-udiskie.rules
polkit.addRule(function(action, subject) { var YES = polkit.Result.YES; var permission = { // required for udisks1: "org.freedesktop.udisks.filesystem-mount": YES, "org.freedesktop.udisks.luks-unlock": YES, "org.freedesktop.udisks.drive-eject": YES, "org.freedesktop.udisks.drive-detach": YES, // required for udisks2: "org.freedesktop.udisks2.filesystem-mount": YES, "org.freedesktop.udisks2.encrypted-unlock": YES, "org.freedesktop.udisks2.eject-media": YES, "org.freedesktop.udisks2.power-off-drive": YES, // required for udisks2 if using udiskie from another seat (e.g. systemd): "org.freedesktop.udisks2.filesystem-mount-other-seat": YES, "org.freedesktop.udisks2.filesystem-unmount-others": YES, "org.freedesktop.udisks2.encrypted-unlock-other-seat": YES, "org.freedesktop.udisks2.encrypted-unlock-system": YES, "org.freedesktop.udisks2.eject-media-other-seat": YES, "org.freedesktop.udisks2.power-off-drive-other-seat": YES }; if (subject.isInGroup("storage")) { return permission[action.id]; } });
Enable the polkitd service
ln -s /etc/sv/polkitd /var/service
Copy the default xinitrc to your home directory
cp /etc/X11/xinit/xinitrc ~/.xinitrc
Edit the xinitrc you just copied to your home directory
Comment
twm &
and replace with exec startxfce4
EDIT: I recently installed Void on my desktop and this step wasn't required.
#!/bin/sh userresources=$HOME/.Xresources usermodmap=$HOME/.Xmodmap sysresources=/etc/X11/xinit/.Xresources sysmodmap=/etc/X11/xinit/.Xmodmap # merge in defaults and keymaps if [ -f $sysresources ]; then xrdb -merge $sysresources fi if [ -f $sysmodmap ]; then xmodmap $sysmodmap fi if [ -f "$userresources" ]; then xrdb -merge "$userresources" fi if [ -f "$usermodmap" ]; then xmodmap "$usermodmap" fi # start some nice programs if [ -d /etc/X11/xinit/xinitrc.d ] ; then for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do [ -x "$f" ] && . "$f" done unset f fi # twm & exec startxfce4 #xclock -geometry 50x50-1+1 & #xterm -geometry 80x50+494+51 & #xterm -geometry 80x20+494-0 & exec xterm -geometry 80x66+0+0 -name login
Install a PDF viewer
xbps-install xpdf
Speech-dispatcher is required for text to speech in the web browser and other apps
xbps-install speech-dispatcher
Cleanup and check installation
xbps-reconfigure -fa
Audio
ln -s /etc/sv/alsa /var/service
Fix poor fonts in Firefox
ln -s /usr/share/fontconfig/conf.avail/70-no-bitmaps.conf /etc/fonts/conf.d/
Brightness (store brightness levels across reboots)
xbps-install brightnessctl
Create the required files in /etc/sv/brightness as per below
run
#!/bin/sh # Restore saved brightness for each card, if any. for card in $(find /sys/class/backlight/ -type l); do card=$(basename $card) storage_file="/var/cache/backlight/${card}-brightness-old" if [ -r "$storage_file" ]; then cp "$storage_file" "/var/cache/backlight/${card}_brightness" fi done brightness=`cat /var/cache/backlight/${card}-brightness-old` brightnessctl -d $card set $brightness exec chpst -b brightnessctl pause
finish
#!/bin/sh [ -d '/var/cache/backlight/' ] || mkdir -p '/var/cache/backlight' [ -w '/var/cache/backlight/' ] || chmod 755 '/var/cache/backlight/' # Save current brightness of each card. for card in `find /sys/class/backlight/ -type l`; do card=$(basename $card) curr_brightness=`brightnessctl get -m -d $card` echo $curr_brightness > "/var/cache/backlight/${card}_brightness" cp "/var/cache/backlight/${card}_brightness" "/var/cache/backlight/${card}_brightness-old" done
Make the service active:
ln -s /etc/sv/brightness /var/service
Fix mousepad
vi /etc/X11/xorg.conf.d/40-libinput.conf
Section "InputClass" Identifier "libinput touchpad catchall" MatchIsTouchpad "on" MatchDevicePath "/dev/input/event*" Driver "libinput" Option "Tapping" "on" Option "NaturalScrolling" "true" Option "ClickMethod" "clickfinger" Option "TappingButtonMap" "lrm" Option "DisableWhileTyping" "true" EndSection
Audio
On my laptop, the brightness controls (FN+F10/F11) worked fine but the volume controls didn't work at all (I'm using ALSA not Pulseaudio).
So I had to go to 'Settings' / ' Keyboard' and map the keys as follows: (just click add, enter the command and you are prompted for the key sequence)
# command to increase volume by 3% amixer -q sset Master 3%+ # command to decrease volume by 3% amixer -q sset Master 3%- # command to mute/unmute amixer -q sset Master toggle
Add your user to various groups
gpasswd -a your_username plugdev gpasswd -a your_username disk gpasswd -a your_username input gpasswd -a your_username storage gpasswd -a your_username audio gpasswd -a your_username video gpasswd -a your_username users gpasswd -a your_username media gpasswd -a your_username scanner
Graphical login
Test your 'X' configuration by running
startx
after you have logged in as your user (not root).Once you are happy that it's working as expected, you can enable the graphical login.
Logout of your 'X' session and login as root (console) and enable 'lightdm' -
ln -s /etc/sv/lightdm /var/service
This should start 'X' automatically and you should be prompted to login.
I had some issues with the fan on my Dell Laptop. I found this Arch Linux Wiki entry useful to resolve the issues I had - obviously other laptops will require different apps - the Wiki covers this too.
Links
Void Linux packages
Void Linux documentation
Tags: Linux , Void Linux , Xorg , XFCE4 , laptop
Return to home page: Home