1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
5 | %general-entities;
|
---|
6 |
|
---|
7 | <!ENTITY upower-download-http "https://gitlab.freedesktop.org/upower/upower/-/archive/v&upower-version;/upower-v&upower-version;.tar.bz2">
|
---|
8 | <!ENTITY upower-download-ftp " ">
|
---|
9 | <!ENTITY upower-md5sum "bfd6e3275e61d7e097b53eb2b216fffa">
|
---|
10 | <!ENTITY upower-size "136 KB">
|
---|
11 | <!ENTITY upower-buildsize "6.5 MB (add 1.1 MB for tests)">
|
---|
12 | <!ENTITY upower-time "less than 0.1 SBU (using parallelism=4, add 0.6 SBU for tests)">
|
---|
13 | ]>
|
---|
14 |
|
---|
15 | <sect1 id="upower" xreflabel="UPower-&upower-version;">
|
---|
16 | <?dbhtml filename="upower.html"?>
|
---|
17 |
|
---|
18 |
|
---|
19 | <title>UPower-&upower-version;</title>
|
---|
20 |
|
---|
21 | <indexterm zone="upower">
|
---|
22 | <primary sortas="a-UPower">UPower</primary>
|
---|
23 | </indexterm>
|
---|
24 |
|
---|
25 | <sect2 role="package">
|
---|
26 | <title>Introduction to UPower</title>
|
---|
27 |
|
---|
28 | <para>
|
---|
29 | The <application>UPower</application> package provides an interface for
|
---|
30 | enumerating power devices, listening to device events and querying history
|
---|
31 | and statistics. Any application or service on the system can access the
|
---|
32 | org.freedesktop.UPower service via the system message bus.
|
---|
33 | </para>
|
---|
34 |
|
---|
35 | &lfs120_checked;
|
---|
36 |
|
---|
37 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
38 | <itemizedlist spacing="compact">
|
---|
39 | <listitem>
|
---|
40 | <para>
|
---|
41 | Download (HTTP): <ulink url="&upower-download-http;"/>
|
---|
42 | </para>
|
---|
43 | </listitem>
|
---|
44 | <listitem>
|
---|
45 | <para>
|
---|
46 | Download (FTP): <ulink url="&upower-download-ftp;"/>
|
---|
47 | </para>
|
---|
48 | </listitem>
|
---|
49 | <listitem>
|
---|
50 | <para>
|
---|
51 | Download MD5 sum: &upower-md5sum;
|
---|
52 | </para>
|
---|
53 | </listitem>
|
---|
54 | <listitem>
|
---|
55 | <para>
|
---|
56 | Download size: &upower-size;
|
---|
57 | </para>
|
---|
58 | </listitem>
|
---|
59 | <listitem>
|
---|
60 | <para>
|
---|
61 | Estimated disk space required: &upower-buildsize;
|
---|
62 | </para>
|
---|
63 | </listitem>
|
---|
64 | <listitem>
|
---|
65 | <para>
|
---|
66 | Estimated build time: &upower-time;
|
---|
67 | </para>
|
---|
68 | </listitem>
|
---|
69 | </itemizedlist>
|
---|
70 |
|
---|
71 | <bridgehead renderas="sect3">UPower Dependencies</bridgehead>
|
---|
72 |
|
---|
73 | <bridgehead renderas="sect4">Required</bridgehead>
|
---|
74 | <para role="required">
|
---|
75 | <xref linkend="libgudev"/> and
|
---|
76 | <xref linkend="libusb"/>
|
---|
77 | </para>
|
---|
78 |
|
---|
79 | <bridgehead renderas="sect4">Optional (Required if building GNOME)</bridgehead>
|
---|
80 | <para role="optional">
|
---|
81 | <xref linkend="gobject-introspection"/>
|
---|
82 | </para>
|
---|
83 |
|
---|
84 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
85 | <para role="optional">
|
---|
86 | <xref linkend="gtk-doc"/>,
|
---|
87 | <xref linkend="libxslt"/>,
|
---|
88 | <xref linkend="docbook-xsl"/>,
|
---|
89 | <xref linkend="pygobject3"/>,
|
---|
90 | <xref linkend="python-dbusmock"/>,
|
---|
91 | <xref linkend="umockdev"/> (for part of the test suite), and
|
---|
92 | <ulink url="https://libimobiledevice.org/">libimobiledevice</ulink>
|
---|
93 | </para>
|
---|
94 |
|
---|
95 | </sect2>
|
---|
96 |
|
---|
97 | <sect2 role="kernel" id="upower-kernel" revision="systemd">
|
---|
98 | <!-- With UPower-0.9.11's hardening of the systemd unit file,
|
---|
99 | User Namespace Support (CONFIG_USER_NS) is now required. Without this,
|
---|
100 | you will get "ERROR 213/USER" out of a 'systemctl start upower'. -->
|
---|
101 | <title>Kernel Configuration</title>
|
---|
102 |
|
---|
103 | <para>
|
---|
104 | Enable the following options in the kernel configuration and recompile the
|
---|
105 | kernel if necessary:
|
---|
106 | </para>
|
---|
107 |
|
---|
108 | <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
|
---|
109 | href="upower-systemd-kernel.xml"/>
|
---|
110 |
|
---|
111 | <indexterm zone="upower upower-kernel">
|
---|
112 | <primary sortas="d-upower">upower</primary>
|
---|
113 | </indexterm>
|
---|
114 | </sect2>
|
---|
115 |
|
---|
116 | <sect2 role="installation">
|
---|
117 | <title>Installation of UPower</title>
|
---|
118 |
|
---|
119 | <para>
|
---|
120 | First, remove an unneeded dependency from a test:
|
---|
121 | </para>
|
---|
122 |
|
---|
123 | <screen><userinput>sed '/parse_version/d' -i src/linux/integration-test.py</userinput></screen>
|
---|
124 |
|
---|
125 | <para>
|
---|
126 | Install <application>UPower</application> by running the following
|
---|
127 | commands:
|
---|
128 | </para>
|
---|
129 |
|
---|
130 | <screen revision="sysv"><userinput>mkdir build &&
|
---|
131 | cd build &&
|
---|
132 |
|
---|
133 | meson setup .. \
|
---|
134 | --prefix=/usr \
|
---|
135 | --buildtype=release \
|
---|
136 | -Dgtk-doc=false \
|
---|
137 | -Dman=false \
|
---|
138 | -Dsystemdsystemunitdir=no \
|
---|
139 | -Dudevrulesdir=/usr/lib/udev/rules.d &&
|
---|
140 | ninja</userinput></screen>
|
---|
141 |
|
---|
142 | <screen revision="systemd"><userinput>mkdir build &&
|
---|
143 | cd build &&
|
---|
144 | meson setup .. \
|
---|
145 | --prefix=/usr \
|
---|
146 | --buildtype=release \
|
---|
147 | -Dgtk-doc=false \
|
---|
148 | -Dman=false &&
|
---|
149 | ninja</userinput></screen>
|
---|
150 |
|
---|
151 | <!-- On my system with LANG=zh_CN.UTF-8, one test attempted to compare
|
---|
152 | Chinese error message with English references and failed.
|
---|
153 | LC_ALL=C fixes the problem. -->
|
---|
154 | <!-- Headphone hotplug (bluetooth and AUX) was tested and seems to work
|
---|
155 | okay even with the test faliures. Maybe it's wants headphones plugged
|
---|
156 | in during the test? Regardless, it can be safely ignored. -->
|
---|
157 | <para>
|
---|
158 | To test the results, issue: <command>LC_ALL=C ninja test</command>. Some
|
---|
159 | checks may not pass due to missing files. Test suite should be run from
|
---|
160 | a local GUI session started with dbus-launch. 2 tests relating to the
|
---|
161 | headphone hotplug feature are known to fail, these can be safely ignored
|
---|
162 | as the headphone functionality does still work.
|
---|
163 | </para>
|
---|
164 |
|
---|
165 | <para>
|
---|
166 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
167 | </para>
|
---|
168 |
|
---|
169 | <screen role="root"><userinput>ninja install</userinput></screen>
|
---|
170 |
|
---|
171 | </sect2>
|
---|
172 |
|
---|
173 | <sect2 role="commands">
|
---|
174 | <title>Command Explanations</title>
|
---|
175 |
|
---|
176 | <para>
|
---|
177 | <parameter>-Dgtk-doc=false</parameter>: Prevents building the
|
---|
178 | documentation. Remove this if you have <application>GTK-Doc</application>
|
---|
179 | installed and wish to build the documentation.
|
---|
180 | </para>
|
---|
181 |
|
---|
182 | <para>
|
---|
183 | <parameter>-Dman=false</parameter>: Prevents building the
|
---|
184 | manual pages. Remove this if you have <xref linkend='libxslt'/> and
|
---|
185 | <xref linkend='docbook-xsl'/> installed and wish to build the manual
|
---|
186 | pages.
|
---|
187 | </para>
|
---|
188 |
|
---|
189 | <para revision="sysv">
|
---|
190 | <parameter>-Dsystemdsystemunitdir=no</parameter>: Removes
|
---|
191 | the dependency on <application>systemd</application>.
|
---|
192 | </para>
|
---|
193 |
|
---|
194 | <para revision="sysv">
|
---|
195 | <parameter>-Dudevrulesdir=/usr/lib/udev/rules.d</parameter>: Tells
|
---|
196 | the build system where to install <application>udev</application>
|
---|
197 | rules because the information is missing in
|
---|
198 | <filename>/usr/lib/pkgconfig/libudev.pc</filename>
|
---|
199 | </para>
|
---|
200 |
|
---|
201 | </sect2>
|
---|
202 |
|
---|
203 | <sect2 role="configuration" revision="systemd">
|
---|
204 |
|
---|
205 | <title>Configuring UPower</title>
|
---|
206 | <!-- timer statistics have been removed from kernel (since 4.11)
|
---|
207 | I do not know if there is a replacement. See
|
---|
208 | https://patchwork.kernel.org/patch/9561519
|
---|
209 | and https://bugs.freedesktop.org/show_bug.cgi?id=100626
|
---|
210 |
|
---|
211 | <para>
|
---|
212 | To use the command <command>upower -w</command> for information about
|
---|
213 | processor wakeups (this command is used by <phrase revision="sysv">
|
---|
214 | <ulink url="&gnome-download-http;/gnome-power-manager/">gnome-power-manager</ulink></phrase><phrase revision="systemd"><xref linkend="gnome-power-manager"/></phrase>)
|
---|
215 | you need to enable CONFIG_TIMER_STATS. This is achieved in
|
---|
216 | <command>make menuconfig</command> by going to the 'kernel-hacking'
|
---|
217 | menu and selecting 'Collect kernel timers statistics'.
|
---|
218 | </para>
|
---|
219 | -->
|
---|
220 | <sect3 id="upower-init">
|
---|
221 | <title>Systemd Unit</title>
|
---|
222 |
|
---|
223 | <para>
|
---|
224 | To start the <command>UPower</command> service at boot,
|
---|
225 | enable the previously installed systemd unit by
|
---|
226 | running the following command as the
|
---|
227 | <systemitem class="username">root</systemitem> user:
|
---|
228 | </para>
|
---|
229 |
|
---|
230 | <indexterm zone="upower upower-init">
|
---|
231 | <primary sortas="f-upower">upower</primary>
|
---|
232 | </indexterm>
|
---|
233 |
|
---|
234 | <screen role="root"><userinput>systemctl enable upower</userinput></screen>
|
---|
235 |
|
---|
236 | </sect3>
|
---|
237 |
|
---|
238 | </sect2>
|
---|
239 |
|
---|
240 | <sect2 role="content">
|
---|
241 | <title>Contents</title>
|
---|
242 |
|
---|
243 | <segmentedlist>
|
---|
244 | <segtitle>Installed Program<!--
|
---|
245 | See below... <phrase revision="systemd">s</phrase>--></segtitle>
|
---|
246 | <segtitle>Installed Libraries</segtitle>
|
---|
247 | <segtitle>Installed Directories</segtitle>
|
---|
248 |
|
---|
249 | <seglistitem>
|
---|
250 | <seg>
|
---|
251 | upower
|
---|
252 | <!-- <phrase revision="systemd"> and upowerd</phrase>
|
---|
253 | Upowerd should not be listed, as it is in /usr/libexec, and is not supposed
|
---|
254 | to be run by a user. Furthermore, upowerd is also in sysv, and there is no
|
---|
255 | reason so single out systemd here. -->
|
---|
256 | </seg>
|
---|
257 | <seg>
|
---|
258 | libupower-glib.so
|
---|
259 | </seg>
|
---|
260 | <seg>
|
---|
261 | /etc/UPower,
|
---|
262 | /usr/include/libupower-glib, and
|
---|
263 | /var/lib/upower
|
---|
264 | </seg>
|
---|
265 | </seglistitem>
|
---|
266 | </segmentedlist>
|
---|
267 |
|
---|
268 | <variablelist>
|
---|
269 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
270 | <?dbfo list-presentation="list"?>
|
---|
271 | <?dbhtml list-presentation="table"?>
|
---|
272 |
|
---|
273 | <varlistentry id="upower-prog">
|
---|
274 | <term><command>upower</command></term>
|
---|
275 | <listitem>
|
---|
276 | <para>
|
---|
277 | is the <application>UPower</application> command line tool
|
---|
278 | </para>
|
---|
279 | <indexterm zone="upower upower-prog">
|
---|
280 | <primary sortas="b-upower">upower</primary>
|
---|
281 | </indexterm>
|
---|
282 | </listitem>
|
---|
283 | </varlistentry>
|
---|
284 | <!-- See above
|
---|
285 | <varlistentry id="upowerd" revision="systemd">
|
---|
286 | <term><command>upowerd</command></term>
|
---|
287 | <listitem>
|
---|
288 | <para>
|
---|
289 | is the <application>UPower</application> Daemon. It provides the
|
---|
290 | org.freedesktop.UPower service on the system message bus.
|
---|
291 | </para>
|
---|
292 | <indexterm zone="upower upowerd">
|
---|
293 | <primary sortas="b-upowerd">upowerd</primary>
|
---|
294 | </indexterm>
|
---|
295 | </listitem>
|
---|
296 | </varlistentry>-->
|
---|
297 |
|
---|
298 | <varlistentry id="libupower-glib">
|
---|
299 | <term><filename class="libraryfile">libupower-glib.so</filename></term>
|
---|
300 | <listitem>
|
---|
301 | <para>
|
---|
302 | contains the <application>UPower</application> API functions
|
---|
303 | </para>
|
---|
304 | <indexterm zone="upower libupower-glib">
|
---|
305 | <primary sortas="c-libupower-glib">libupower-glib.so</primary>
|
---|
306 | </indexterm>
|
---|
307 | </listitem>
|
---|
308 | </varlistentry>
|
---|
309 |
|
---|
310 | </variablelist>
|
---|
311 |
|
---|
312 | </sect2>
|
---|
313 |
|
---|
314 | </sect1>
|
---|