The my-x200 package – README file

A Debian/Devuan service dedicated to Thinkpads X200

Robert Alessi

License and Disclamer

my-x200 - A Debian/Devuan service dedicated to Thinkpads X200 Copyright (C) 2021 Robert Alessi alessi@robertalessi.net

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Overview

my-x200 is a simple script primarily designed to make the distinctive whining noise of Thinkpads X200 disappear. But it can also be used on other laptops.

It is written to be used on Devuan GNU+Linux but it should work on other Debian-based distributions.

Installation

  1. Clone this repository locally.
  2. Do make debian.
  3. Install the generated my-x200 .deb package as root with dpkg -i.
  4. Edit /etc/default/my-x200.

Alternatively, a .deb file ready to be installed and its associated .dsc source package file are provided in this repository. Once these two files and the corresponding two source files .orig.tar.gz and debian.tar.xz are downloaded in the same directory, it is advisable to verify the signature like so:—

  1. Download the my-x200 master tarball: http://git.robertalessi.net/my-x200/snapshot/my-x200-master.tar.gz
  2. Import the developer’s public PGP key, like so: gpg --recv-keys 8085C8C7
  3. Verify the signature: dscverify --keyring ~/.gnupg/pubring.gpg my-x200_<ver>.dsc (Replace <ver> with the actual release number.)

For a good GPG cheat sheet, see here.

Configuration

Once installed, my-x200 is configured by editing /etc/default/my-x200.

It is also possible to leave /etc/default/my-200 untouched. In this case, my-x200 can source its configuration from one or more *.conf files written in a specific directory /etc/default/my-x200.d/ which is to be created. This is the recommended method for these files cannot be affected by subsequent updates.

Noise Removal

Set the variable is_thinkpad_x200 to yes (which is the default value). The default frequency rate should work. It may be changed by modifying the value of PWMFREQ_RATE.

Privacy Settings

/etc/default/my-x200 also provides a “Privacy Settings” section: if enable_privacy is set to true, then the wired internet interface that may or may not be connected to the internet will have its MAC address spoofed at startup. (The wireless interfaces must also be spoofed, but this can be handled by wpa_supplicant: see below.) Additionally, my-x200 will delete /var/lib/dhcpcd/duid, and use /proc/sys/kernel/random/boot_id to generate a new DUID-LLT-based file with an updated timestamp. A new DUID is generated each time the computer is started.

It must be noted that when enable_privacy is set to true my-x200 turns off the wifi radio at computer startup and each time it is put to sleep. The wifi radio has to be turned on or turned back on manually by pressing Fn-F5.

Backup

Finally my-x200 has the ability to backup essential files or directories—for instance to a backup disk mounted inside the dock. Of course, the backup process is triggered on certain conditions only:

  1. The option must be enabled in the /etc/default/my-x200 file.
  2. The disk must be mounted.
  3. An (empty) dobackup file must be present in the backup directory.

Then, once these conditions are met, the backup process is triggered whenever the service is stopped.

The command rc-update that is used below refers to openrc. Other init systems use other commands. Please adapt.

It is advisable to use my-x200 in conjunction with wpa_supplicant and dhcpcd only. In addition, wpagui and dhcpcd-gtk are also recommended to be able to configure the network from systray applets. If so, wicd may be disabled: as root, simply do rc-update del wicd.

wpa_supplicant

For this to work properly, it is important to have these lines in /etc/wpa_supplicant/wpa_supplicant.conf:

ctrl_interface=DIR=/run/wpa_supplicant GROUP=netdev
update_config=1
mac_addr=1
preassoc_mac_addr=1

(For additional security, do (as root) chmod 700 /etc/wpa_supplicant)

dhcpcd

And these settings in /etc/dhcpcd.conf:

hostname "localhost"
hostname_short

/etc/network/interfaces

Finally, /etc/network/interfaces should look like this:—

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet manual

# wlan interface
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

Do Not Use

  1. NetworkManager
  2. acpi-support (but acpi-support-base is fine and needed)
  3. Avahi

To disable avahi, do (as root):

rc-update del avahi-daemon
chmod -x /etc/network/if-up.d/avahi-daemon

Usage

In addition to the usual arguments, namely start, stop, restart and force-reload, /etc/init.d/my-x200 accepts two further arguments, as follows:—

  1. /etc/init.d/my-x200 refresh to reset the frequency rate of the screen to the default value. This is to be used in the hopefully rare cases when the noise becomes perceptible again. Unprivileged users may perform this action by pressing the ThinkVantage button.
  2. /etc/init.d/my-x200 initbackup. If backuping be set as described above, /etc/init.d/my-x200 initbackup can be used to trigger a backup round immediately, that is without having to shut down the system for the first backup round to happen.

Further Information

More information in my-x200 initd file: http://git.robertalessi.net/my-x200/tree/my-x200.confd