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/buildmount /dev/sda1 /mnt/build/boot/efimount -o bind /dev /mnt/build/devmount -o bind /sys /mnt/build/sysmount -t proc /proc /mnt/build/procchroot /mnt/build /bin/bashOnce in the chroot it's possible to use all the Void Linux commands.
Create the config for Dracut
echo 'add_dracutmodules+=" resume "' >> /etc/dracut.confecho 'tmpdir=/tmp' >> /etc/dracut.confdracut --force --hostonly --kver 6.6.38_1 [your kernel version will vary]OR
dracut --regenerate-alldracut.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-ucodexbps-install iucode-toolCreate
/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.confwpa_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/serviceln -s /etc/sv/dhcpcd /var/serviceInstall requirements for EFI booting
xbps-install efibootmgrxbps-install efitoolsxbps-install efitools-efixbps-install dosfstoolsThe system requires a 512M EFI partition.
Fdisk layout and disk prep for EFI boot:
fdisk -lDevice 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-intelGrub
xbps-install grub-utilsxbps-install grub-x86_64-efixbps-install grub-terminusgrub-mkconfig -o /boot/grub/grub.cfggrub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=void_grub --boot-directory=/boot --recheckInstall 'x' window system and miscellaneous utilities.
xbps-install xorgxbps-install xinitxbps-install lightdmxbps-install xfce4xbps-install xorg-input-driversxbps-install xfce4-alsa-pluginxbps-install libxfce4utilxbps-install alsa-ucm-confxbps-install sof-firmwarexbps-install laptop-modeDisk Management Service, version 2:
xbps-install udisks2Web browser:
xbps-install firefoxOffice apps:
xbps-install libreofficeScreen grabber:
xbps-install flameshotUnzip (archive) utility:
xbps-install 7zipxbps-install xarchiverInstall and enable the elogind service
xbps-install elogindln -s /etc/sv/elogind /var/serviceInstall Signal desktop messaging if required
xbps-install signal-desktopInstall Fonts
xbps-install google-fonts-ttfxbps-install xorg-fontsxbps-install ttf-ubuntu-font-familyxbps-install ttf-opensansxbps-install ttf-bitstream-veraxbps-install liberation-fonts-ttfxbps-install dejavu-fonts-ttfxbps-install fonts-adobe-*xbps-install font-adobe-*xbps-install font-adobe-100dpixbps-install font-adobe-75dpixbps-install font-adobe-source-serif-proxbps-install puttyxbps-install terminus-fontInstall the fan utility for certain Dell laptops
xbps-install i8kutilsInstall and configure required apps for automounting USB disks
xbps-install udevilxbps-install udiskiexbps-install xdg-utilsI 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 polkitdAdd 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/serviceCopy the default xinitrc to your home directory
cp /etc/X11/xinit/xinitrc ~/.xinitrcEdit the xinitrc you just copied to your home directory
Comment
twm & and replace with exec startxfce4EDIT: 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 xpdfSpeech-dispatcher is required for text to speech in the web browser and other apps
xbps-install speech-dispatcherCleanup and check installation
xbps-reconfigure -faAudio
ln -s /etc/sv/alsa /var/serviceFix 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 brightnessctlCreate 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/serviceFix 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/serviceThis 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