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 "4fba71838a9ba0db6f140418eddbe2b7">
|
---|
10 | <!ENTITY upower-size "128 KB">
|
---|
11 | <!ENTITY upower-buildsize "4.9 MB (add 1.3 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 | &lfs113_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"/>,
|
---|
76 | <xref linkend="libusb"/>, and
|
---|
77 | <xref linkend="polkit"/>
|
---|
78 | </para>
|
---|
79 |
|
---|
80 | <bridgehead renderas="sect4">Optional (Required if building GNOME)</bridgehead>
|
---|
81 | <para role="optional">
|
---|
82 | <xref linkend="gobject-introspection"/>
|
---|
83 | </para>
|
---|
84 |
|
---|
85 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
86 | <para role="optional">
|
---|
87 | <xref linkend="gtk-doc"/>,
|
---|
88 | <xref linkend="libxslt"/>,
|
---|
89 | <xref linkend="docbook-xsl"/>,
|
---|
90 | <xref linkend="pygobject3"/>,
|
---|
91 | <xref linkend="python-dbusmock"/>,
|
---|
92 | <xref linkend="umockdev"/> (for part of the test suite), and
|
---|
93 | <ulink url="https://libimobiledevice.org/">libimobiledevice</ulink>
|
---|
94 | </para>
|
---|
95 |
|
---|
96 | </sect2>
|
---|
97 |
|
---|
98 | <sect2 role="kernel" id="upower-kernel" revision="systemd">
|
---|
99 | <!-- With UPower-0.9.11's hardening of the systemd unit file,
|
---|
100 | User Namespace Support (CONFIG_USER_NS) is now required. Without this,
|
---|
101 | you will get "ERROR 213/USER" out of a 'systemctl start upower'. -->
|
---|
102 | <title>Kernel Configuration</title>
|
---|
103 |
|
---|
104 | <para>
|
---|
105 | Enable the following options in the kernel configuration and recompile the
|
---|
106 | kernel if necessary:
|
---|
107 | </para>
|
---|
108 |
|
---|
109 | <screen><literal>General Setup --->
|
---|
110 | [*] Namespaces support ---> [CONFIG_NAMESPACES]
|
---|
111 | [*] User namespace [CONFIG_USER_NS]</literal></screen>
|
---|
112 |
|
---|
113 | <indexterm zone="upower upower-kernel">
|
---|
114 | <primary sortas="d-upower">upower</primary>
|
---|
115 | </indexterm>
|
---|
116 | </sect2>
|
---|
117 |
|
---|
118 | <sect2 role="installation">
|
---|
119 | <title>Installation of UPower</title>
|
---|
120 |
|
---|
121 | <para>
|
---|
122 | First, remove an unneeded dependency from a test:
|
---|
123 | </para>
|
---|
124 |
|
---|
125 | <screen><userinput>sed '/parse_version/d' -i src/linux/integration-test.py</userinput></screen>
|
---|
126 |
|
---|
127 | <para>
|
---|
128 | Install <application>UPower</application> by running the following
|
---|
129 | commands:
|
---|
130 | </para>
|
---|
131 |
|
---|
132 | <screen revision="sysv"><userinput>mkdir build &&
|
---|
133 | cd build &&
|
---|
134 |
|
---|
135 | meson setup .. \
|
---|
136 | --prefix=/usr \
|
---|
137 | --buildtype=release \
|
---|
138 | -Dgtk-doc=false \
|
---|
139 | -Dman=false \
|
---|
140 | -Dsystemdsystemunitdir=no \
|
---|
141 | -Dudevrulesdir=/usr/lib/udev/rules.d &&
|
---|
142 | ninja</userinput></screen>
|
---|
143 |
|
---|
144 | <screen revision="systemd"><userinput>mkdir build &&
|
---|
145 | cd build &&
|
---|
146 | meson setup .. \
|
---|
147 | --prefix=/usr \
|
---|
148 | --buildtype=release \
|
---|
149 | -Dgtk-doc=false \
|
---|
150 | -Dman=false &&
|
---|
151 | ninja</userinput></screen>
|
---|
152 |
|
---|
153 | <!-- On my system with LANG=zh_CN.UTF-8, one test attempted to compare
|
---|
154 | Chinese error message with English references and failed.
|
---|
155 | LC_ALL=C fixes the problem. -->
|
---|
156 | <para>
|
---|
157 | To test the results, issue: <command>LC_ALL=C ninja test</command>. Some
|
---|
158 | checks may not pass due to missing files. Test suite should be run from
|
---|
159 | a local GUI session started with dbus-launch.
|
---|
160 | </para>
|
---|
161 |
|
---|
162 | <para>
|
---|
163 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
164 | </para>
|
---|
165 |
|
---|
166 | <screen role="root"><userinput>ninja install</userinput></screen>
|
---|
167 |
|
---|
168 | </sect2>
|
---|
169 |
|
---|
170 | <sect2 role="commands">
|
---|
171 | <title>Command Explanations</title>
|
---|
172 |
|
---|
173 | <para>
|
---|
174 | <parameter>-Dgtk-doc=false</parameter>: Prevents building the
|
---|
175 | documentation. Remove this if you have <application>GTK-Doc</application>
|
---|
176 | installed and wish to build the documentation.
|
---|
177 | </para>
|
---|
178 |
|
---|
179 | <para>
|
---|
180 | <parameter>-Dman=false</parameter>: Prevents building the
|
---|
181 | manual pages. Remove this if you have <xref linkend='libxslt'/> and
|
---|
182 | <xref linkend='docbook-xsl'/> installed and wish to build the manual
|
---|
183 | pages.
|
---|
184 | </para>
|
---|
185 |
|
---|
186 | <para revision="sysv">
|
---|
187 | <parameter>-Dsystemdsystemunitdir=no</parameter>: Removes
|
---|
188 | the dependency on <application>systemd</application>.
|
---|
189 | </para>
|
---|
190 |
|
---|
191 | <para revision="sysv">
|
---|
192 | <parameter>-Dudevrulesdir=/usr/lib/udev/rules.d</parameter>: Tells
|
---|
193 | the build system where to install <application>udev</application>
|
---|
194 | rules because the information is missing in
|
---|
195 | <filename>/usr/lib/pkgconfig/libudev.pc</filename>
|
---|
196 | </para>
|
---|
197 |
|
---|
198 | </sect2>
|
---|
199 |
|
---|
200 | <sect2 role="configuration" revision="systemd">
|
---|
201 |
|
---|
202 | <title>Configuring UPower</title>
|
---|
203 | <!-- timer statistics have been removed from kernel (since 4.11)
|
---|
204 | I do not know if there is a replacement. See
|
---|
205 | https://patchwork.kernel.org/patch/9561519
|
---|
206 | and https://bugs.freedesktop.org/show_bug.cgi?id=100626
|
---|
207 |
|
---|
208 | <para>
|
---|
209 | To use the command <command>upower -w</command> for information about
|
---|
210 | processor wakeups (this command is used by <phrase revision="sysv">
|
---|
211 | <ulink url="&gnome-download-http;/gnome-power-manager/">gnome-power-manager</ulink></phrase><phrase revision="systemd"><xref linkend="gnome-power-manager"/></phrase>)
|
---|
212 | you need to enable CONFIG_TIMER_STATS. This is achieved in
|
---|
213 | <command>make menuconfig</command> by going to the 'kernel-hacking'
|
---|
214 | menu and selecting 'Collect kernel timers statistics'.
|
---|
215 | </para>
|
---|
216 | -->
|
---|
217 | <sect3 id="upower-init">
|
---|
218 | <title>Systemd Unit</title>
|
---|
219 |
|
---|
220 | <para>
|
---|
221 | To start the <command>UPower</command> service at boot,
|
---|
222 | enable the previously installed systemd unit by
|
---|
223 | running the following command as the
|
---|
224 | <systemitem class="username">root</systemitem> user:
|
---|
225 | </para>
|
---|
226 |
|
---|
227 | <indexterm zone="upower upower-init">
|
---|
228 | <primary sortas="f-upower">upower</primary>
|
---|
229 | </indexterm>
|
---|
230 |
|
---|
231 | <screen role="root"><userinput>systemctl enable upower</userinput></screen>
|
---|
232 |
|
---|
233 | </sect3>
|
---|
234 |
|
---|
235 | </sect2>
|
---|
236 |
|
---|
237 | <sect2 role="content">
|
---|
238 | <title>Contents</title>
|
---|
239 |
|
---|
240 | <segmentedlist>
|
---|
241 | <segtitle>Installed Program<!--
|
---|
242 | See below... <phrase revision="systemd">s</phrase>--></segtitle>
|
---|
243 | <segtitle>Installed Libraries</segtitle>
|
---|
244 | <segtitle>Installed Directories</segtitle>
|
---|
245 |
|
---|
246 | <seglistitem>
|
---|
247 | <seg>
|
---|
248 | upower
|
---|
249 | <!-- <phrase revision="systemd"> and upowerd</phrase>
|
---|
250 | Upowerd should not be listed, as it is in /usr/libexec, and is not supposed
|
---|
251 | to be run by a user. Furthermore, upowerd is also in sysv, and there is no
|
---|
252 | reason so single out systemd here. -->
|
---|
253 | </seg>
|
---|
254 | <seg>
|
---|
255 | libupower-glib.so
|
---|
256 | </seg>
|
---|
257 | <seg>
|
---|
258 | /etc/UPower,
|
---|
259 | /usr/include/libupower-glib, and
|
---|
260 | /var/lib/upower
|
---|
261 | </seg>
|
---|
262 | </seglistitem>
|
---|
263 | </segmentedlist>
|
---|
264 |
|
---|
265 | <variablelist>
|
---|
266 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
267 | <?dbfo list-presentation="list"?>
|
---|
268 | <?dbhtml list-presentation="table"?>
|
---|
269 |
|
---|
270 | <varlistentry id="upower-prog">
|
---|
271 | <term><command>upower</command></term>
|
---|
272 | <listitem>
|
---|
273 | <para>
|
---|
274 | is the <application>UPower</application> command line tool
|
---|
275 | </para>
|
---|
276 | <indexterm zone="upower upower-prog">
|
---|
277 | <primary sortas="b-upower">upower</primary>
|
---|
278 | </indexterm>
|
---|
279 | </listitem>
|
---|
280 | </varlistentry>
|
---|
281 | <!-- See above
|
---|
282 | <varlistentry id="upowerd" revision="systemd">
|
---|
283 | <term><command>upowerd</command></term>
|
---|
284 | <listitem>
|
---|
285 | <para>
|
---|
286 | is the <application>UPower</application> Daemon. It provides the
|
---|
287 | org.freedesktop.UPower service on the system message bus.
|
---|
288 | </para>
|
---|
289 | <indexterm zone="upower upowerd">
|
---|
290 | <primary sortas="b-upowerd">upowerd</primary>
|
---|
291 | </indexterm>
|
---|
292 | </listitem>
|
---|
293 | </varlistentry>-->
|
---|
294 |
|
---|
295 | <varlistentry id="libupower-glib">
|
---|
296 | <term><filename class="libraryfile">libupower-glib.so</filename></term>
|
---|
297 | <listitem>
|
---|
298 | <para>
|
---|
299 | contains the <application>UPower</application> API functions
|
---|
300 | </para>
|
---|
301 | <indexterm zone="upower libupower-glib">
|
---|
302 | <primary sortas="c-libupower-glib">libupower-glib.so</primary>
|
---|
303 | </indexterm>
|
---|
304 | </listitem>
|
---|
305 | </varlistentry>
|
---|
306 |
|
---|
307 | </variablelist>
|
---|
308 |
|
---|
309 | </sect2>
|
---|
310 |
|
---|
311 | </sect1>
|
---|