aboutsummaryrefslogtreecommitdiff
path: root/about.html
blob: 5e0c362248406b33c6d5eb1fe253a4e70faefb0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
<head>
  <meta charset="utf-8" />
  <meta name="generator" content="pandoc" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
  <meta name="author" content="Robert Alessi" />
  <title>The my-x200 package – README file</title>
  <style type="text/css">
      code{white-space: pre-wrap;}
      span.smallcaps{font-variant: small-caps;}
      span.underline{text-decoration: underline;}
      div.column{display: inline-block; vertical-align: top; width: 50%;}
  </style>
</head>
<body>
<header>
<h1 class="title">The my-x200 package – README file</h1>
<p class="subtitle">A Debian/Devuan service dedicated to Thinkpads X200</p>
<p class="author">Robert Alessi</p>
</header>
<nav id="TOC">
<ul>
<li><a href="#license-and-disclamer">License and Disclamer</a></li>
<li><a href="#overview">Overview</a></li>
<li><a href="#installation">Installation</a></li>
<li><a href="#configuration">Configuration</a><ul>
<li><a href="#noise-removal">Noise Removal</a></li>
<li><a href="#privacy-settings">Privacy Settings</a></li>
<li><a href="#backup">Backup</a></li>
<li><a href="#recommended-settings">Recommended Settings</a><ul>
<li><a href="#wpa_supplicant"><code>wpa_supplicant</code></a></li>
<li><a href="#dhcpcd"><code>dhcpcd</code></a></li>
<li><a href="#etcnetworkinterfaces"><code>/etc/network/interfaces</code></a></li>
</ul></li>
<li><a href="#do-not-use">Do Not Use</a></li>
</ul></li>
<li><a href="#usage">Usage</a></li>
<li><a href="#further-information">Further Information</a></li>
</ul>
</nav>
<h1 id="license-and-disclamer">License and Disclamer</h1>
<p><code>my-x200</code> - A Debian/Devuan service dedicated to Thinkpads X200 Copyright (C) 2021 Robert Alessi <a href="mailto:alessi@robertalessi.net">alessi@robertalessi.net</a></p>
<p>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.</p>
<p>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.</p>
<p>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.</p>
<h1 id="overview">Overview</h1>
<p><code>my-x200</code> 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.</p>
<p>It is written to be used on <a href="https://www.devuan.org/">Devuan GNU+Linux</a> but it should work on other Debian-based distributions.</p>
<h1 id="installation">Installation</h1>
<ol type="1">
<li>Clone this repository locally.</li>
<li>Do <code>make debian</code>.</li>
<li>Install the generated <code>my-x200</code> <code>.deb</code> package as root with <code>dpkg -i</code>.</li>
<li>Edit <code>/etc/default/my-x200</code>.</li>
</ol>
<p>Alternatively, a <code>.deb</code> file ready to be installed and its associated <code>.dsc</code> source package file are provided in this repository. Once these two files and the corresponding two source files <code>.orig.tar.gz</code> and <code>debian.tar.xz</code> are downloaded in the same directory, it is advisable to verify the signature like so:—</p>
<ol type="1">
<li>Download the <code>my-x200</code> master tarball: <a href="http://git.robertalessi.net/my-x200/snapshot/my-x200-master.tar.gz" class="uri">http://git.robertalessi.net/my-x200/snapshot/my-x200-master.tar.gz</a></li>
<li>Import the developer’s <a href="https://pgp.ocf.berkeley.edu/pks/lookup?search=0x1773e9248085c8c7">public PGP key</a>, like so: <code>gpg --recv-keys 8085C8C7</code></li>
<li>Verify the signature: <code>dscverify --keyring ~/.gnupg/pubring.gpg my-x200_&lt;ver&gt;.dsc</code> (Replace <code>&lt;ver&gt;</code> with the actual release number.)</li>
</ol>
<p>For a good GPG cheat sheet, see <a href="https://guides.library.illinois.edu/data_encryption/gpgcheatsheet">here</a>.</p>
<h1 id="configuration">Configuration</h1>
<p>Once installed, <code>my-x200</code> is configured by editing <a href="http://git.robertalessi.net/my-x200/tree/my-x200.confd"><code>/etc/default/my-x200</code></a>.</p>
<p>It is also possible to leave <code>/etc/default/my-200</code> untouched. In this case, <code>my-x200</code> can source its configuration from one or more <code>*.conf</code> files written in a specific directory <code>/etc/default/my-x200.d/</code> which is to be created. This is the recommended method for these files cannot be affected by subsequent updates.</p>
<h2 id="noise-removal">Noise Removal</h2>
<p>Set the variable <code>is_thinkpad_x200</code> to <code>yes</code> (which is the default value). The default frequency rate should work. It may be changed by modifying the value of <code>PWMFREQ_RATE</code>.</p>
<h2 id="privacy-settings">Privacy Settings</h2>
<p><code>/etc/default/my-x200</code> also provides a “Privacy Settings” section: if <code>enable_privacy</code> is set to <code>true</code>, 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 <code>wpa_supplicant</code>: see below.) Additionally, <code>my-x200</code> will delete <code>/var/lib/dhcpcd/duid</code>, and use <code>/proc/sys/kernel/random/boot_id</code> to generate a new DUID-LLT-based file with an updated timestamp. A new DUID is generated each time the computer is started.</p>
<p>It must be noted that when <code>enable_privacy</code> is set to <code>true</code> <code>my-x200</code> 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 <code>Fn-F5</code>.</p>
<h2 id="backup">Backup</h2>
<p>Finally <code>my-x200</code> 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:</p>
<ol type="1">
<li>The option must be enabled in the <code>/etc/default/my-x200</code> file.</li>
<li>The disk must be mounted.</li>
<li>An (empty) <code>dobackup</code> file must be present in the backup directory.</li>
</ol>
<p>Then, once these conditions are met, the backup process is triggered whenever the service is stopped.</p>
<h2 id="recommended-settings">Recommended Settings</h2>
<blockquote>
<p>The command <code>rc-update</code> that is used below refers to <code>openrc</code>. Other init systems use other commands. Please adapt.</p>
</blockquote>
<p>It is advisable to use my-x200 in conjunction with <code>wpa_supplicant</code> and <code>dhcpcd</code> only. In addition, <code>wpagui</code> and <code>dhcpcd-gtk</code> are also recommended to be able to configure the network from systray applets. If so, <code>wicd</code> may be disabled: as root, simply do <code>rc-update del wicd</code>.</p>
<h3 id="wpa_supplicant"><code>wpa_supplicant</code></h3>
<p>For this to work properly, it is important to have these lines in <code>/etc/wpa_supplicant/wpa_supplicant.conf</code>:</p>
<pre><code>ctrl_interface=DIR=/run/wpa_supplicant GROUP=netdev
update_config=1
mac_addr=1
preassoc_mac_addr=1</code></pre>
<p>(For additional security, do (as root) <code>chmod 700 /etc/wpa_supplicant</code>)</p>
<h3 id="dhcpcd"><code>dhcpcd</code></h3>
<p>And these settings in <code>/etc/dhcpcd.conf</code>:</p>
<pre><code>hostname &quot;localhost&quot;
hostname_short</code></pre>
<h3 id="etcnetworkinterfaces"><code>/etc/network/interfaces</code></h3>
<p>Finally, <code>/etc/network/interfaces</code> should look like this:—</p>
<pre><code># 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</code></pre>
<h2 id="do-not-use">Do Not Use</h2>
<ol type="1">
<li>NetworkManager</li>
<li>acpi-support (but acpi-support-base is fine and needed)</li>
<li>Avahi</li>
</ol>
<p>To disable <code>avahi</code>, do (as root):</p>
<pre><code>rc-update del avahi-daemon
chmod -x /etc/network/if-up.d/avahi-daemon</code></pre>
<h1 id="usage">Usage</h1>
<p>In addition to the usual arguments, namely <code>start</code>, <code>stop</code>, <code>restart</code> and <code>force-reload</code>, <code>/etc/init.d/my-x200</code> accepts two further arguments, as follows:—</p>
<ol type="1">
<li><code>/etc/init.d/my-x200 refresh</code> 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 <code>ThinkVantage</code> button.</li>
<li><code>/etc/init.d/my-x200 initbackup</code>. If backuping be set as described above, <code>/etc/init.d/my-x200 initbackup</code> 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.</li>
</ol>
<h1 id="further-information">Further Information</h1>
<p>More information in <code>my-x200</code> initd file: <a href="http://git.robertalessi.net/my-x200/tree/my-x200.confd" class="uri">http://git.robertalessi.net/my-x200/tree/my-x200.confd</a></p>
</body>
</html>