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
|
<!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>
<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>
<h2 id="configuration">Configuration</h2>
<p>Once installed, <code>my-x200</code> is configured by editing <code>/etc/default/my-x200</code>.</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 change 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 wpa_supplicant: 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>
<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>
<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 <code>my-x200</code> master tarball: <></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_<ver>.dsc</code> (Replace <code><ver></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>
<h2 id="use-and-recommended-configuration">Use and recommended configuration</h2>
<blockquote>
<p>The command <code>rc-update</code> that is used below refer 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 "localhost"
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>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>
<h2 id="further-information">Further Information</h2>
<p>More information in <code>my-x200</code> initd file: <a href="https://git.robertalessi.net/my-x200/tree/my-x200.confd" class="uri">https://git.robertalessi.net/my-x200/tree/my-x200.confd</a></p>
</body>
</html>
|