I have a really old ThinkPad X61 laptop which I keep mostly for collection. Recently I decided to install Void Linux on it to try this distribution and see how it will work for me and how it will work on a such outdated hardware in general. I encountered a few difficulties not related to hardware which I would like to document here in case I will try to reproduce a similar setup somewhere in the future.

It did not make much sense to install modern desktop environment on a laptop with 1024x768 screen resolution. Besides, I usually prefer tiling window managers, so it was a natural choice to use sway with a minimal installation.

udiskie

udiskie is a convenient front-end for removable disks manager. It has long been a part of my desktop environment and I sometimes use it from scripts. udiskie requires permissions for some polkit actions which are usually configured by desktop environment. As I decided to not use any, I had to customize polkit settings myself and created /etc/polkit-1/rules.d/70-udiskie.rules file with the following content:

polkit.addRule(function(action, subject) {
  var YES = polkit.Result.YES;
  var permission = {
    // 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];
  }
});

These rules are set for a group named storage, so user should be added to this group after creating the rules file.

See Wiki page for more details on setting up permissions.

pam_env

I have a few helper scripts which are symlinked into /usr/local/bin directory and used from other programs via their configuration files or key bindings. For example, one of such scripts is used by tmux status line to display battery charge. After setting up Void Linux it turned out that these scripts does not work as I expected. I checked obvious permission and path issues, but the actual issue was with the PATH environment variable.

$ ps -e | grep tmux
 1008 pts/0    00:00:00 tmux: client
 1014 ?        00:00:00 tmux: server
$ cat /proc/1008/environ | tr '\000' '\n' | grep PATH
PATH=/usr/bin:/usr/sbin

All these helper scripts were not visible for running processes because they were not included to the path environment variable.

The environment variables are set by PAM module called pam_env and it has its own configuration file which can be used to set or unset required variables. Secondary configuration file mentioned in the manual is /etc/environment, so I added there a string as follows:

#
# This file is parsed by pam_env module
#
# Syntax: simple "KEY=VAL" pairs on separate lines
#
PATH=/usr/bin:/usr/sbin:/usr/local/sbin:/usr/local/bin:/sbin:/bin

After new login tmux was able to use the script as its environment variable contained a required path to scripts:

mk@x61:~$ cat /proc/1001/environ | tr '\000' '\n' | grep PATH
PATH=/usr/bin:/usr/sbin:/usr/local/sbin:/usr/local/bin:/sbin:/bin

And its status line started to work as expected.