[1a55dac4] | 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 |
|
---|
[475d4388] | 7 | <!ENTITY upower-download-http "https://gitlab.freedesktop.org/upower/upower/-/archive/v&upower-version;/upower-v&upower-version;.tar.bz2">
|
---|
[1a55dac4] | 8 | <!ENTITY upower-download-ftp " ">
|
---|
[fe04ab5] | 9 | <!ENTITY upower-md5sum "bfd6e3275e61d7e097b53eb2b216fffa">
|
---|
| 10 | <!ENTITY upower-size "136 KB">
|
---|
| 11 | <!ENTITY upower-buildsize "6.5 MB (add 1.1 MB for tests)">
|
---|
[23adab8] | 12 | <!ENTITY upower-time "less than 0.1 SBU (using parallelism=4, add 0.6 SBU for tests)">
|
---|
[1a55dac4] | 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 |
|
---|
[b84342d6] | 28 | <para>
|
---|
[5a82b26f] | 29 | The <application>UPower</application> package provides an interface for
|
---|
[b84342d6] | 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>
|
---|
[1a55dac4] | 34 |
|
---|
[172c283] | 35 | &lfs120_checked;
|
---|
[1a55dac4] | 36 |
|
---|
| 37 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 38 | <itemizedlist spacing="compact">
|
---|
| 39 | <listitem>
|
---|
[b84342d6] | 40 | <para>
|
---|
| 41 | Download (HTTP): <ulink url="&upower-download-http;"/>
|
---|
| 42 | </para>
|
---|
[1a55dac4] | 43 | </listitem>
|
---|
| 44 | <listitem>
|
---|
[b84342d6] | 45 | <para>
|
---|
| 46 | Download (FTP): <ulink url="&upower-download-ftp;"/>
|
---|
| 47 | </para>
|
---|
[1a55dac4] | 48 | </listitem>
|
---|
| 49 | <listitem>
|
---|
[b84342d6] | 50 | <para>
|
---|
| 51 | Download MD5 sum: &upower-md5sum;
|
---|
| 52 | </para>
|
---|
[1a55dac4] | 53 | </listitem>
|
---|
| 54 | <listitem>
|
---|
[b84342d6] | 55 | <para>
|
---|
| 56 | Download size: &upower-size;
|
---|
| 57 | </para>
|
---|
[1a55dac4] | 58 | </listitem>
|
---|
| 59 | <listitem>
|
---|
[b84342d6] | 60 | <para>
|
---|
| 61 | Estimated disk space required: &upower-buildsize;
|
---|
| 62 | </para>
|
---|
[1a55dac4] | 63 | </listitem>
|
---|
| 64 | <listitem>
|
---|
[b84342d6] | 65 | <para>
|
---|
| 66 | Estimated build time: &upower-time;
|
---|
| 67 | </para>
|
---|
[1a55dac4] | 68 | </listitem>
|
---|
| 69 | </itemizedlist>
|
---|
| 70 |
|
---|
| 71 | <bridgehead renderas="sect3">UPower Dependencies</bridgehead>
|
---|
| 72 |
|
---|
| 73 | <bridgehead renderas="sect4">Required</bridgehead>
|
---|
[c341539] | 74 | <para role="required">
|
---|
[a8163a4] | 75 | <xref linkend="libgudev"/> and
|
---|
| 76 | <xref linkend="libusb"/>
|
---|
[c341539] | 77 | </para>
|
---|
| 78 |
|
---|
[4c2be438] | 79 | <bridgehead renderas="sect4">Optional (Required if building GNOME)</bridgehead>
|
---|
| 80 | <para role="optional">
|
---|
[c341539] | 81 | <xref linkend="gobject-introspection"/>
|
---|
| 82 | </para>
|
---|
[1a55dac4] | 83 |
|
---|
| 84 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
[c341539] | 85 | <para role="optional">
|
---|
[dbea07b] | 86 | <xref linkend="gtk-doc"/>,
|
---|
[d4236e0] | 87 | <xref linkend="libxslt"/>,
|
---|
| 88 | <xref linkend="docbook-xsl"/>,
|
---|
[3bb415b] | 89 | <xref linkend="pygobject3"/>,
|
---|
[63a0217] | 90 | <xref linkend="python-dbusmock"/>,
|
---|
| 91 | <xref linkend="umockdev"/> (for part of the test suite), and
|
---|
| 92 | <ulink url="https://libimobiledevice.org/">libimobiledevice</ulink>
|
---|
[c341539] | 93 | </para>
|
---|
[1a55dac4] | 94 |
|
---|
| 95 | </sect2>
|
---|
| 96 |
|
---|
[88d8c967] | 97 | <sect2 role="kernel" id="upower-kernel" revision="systemd">
|
---|
| 98 | <!-- With UPower-0.9.11's hardening of the systemd unit file,
|
---|
[c884c4b] | 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'. -->
|
---|
[88d8c967] | 101 | <title>Kernel Configuration</title>
|
---|
[8558044] | 102 |
|
---|
[88d8c967] | 103 | <para>
|
---|
| 104 | Enable the following options in the kernel configuration and recompile the
|
---|
| 105 | kernel if necessary:
|
---|
| 106 | </para>
|
---|
| 107 |
|
---|
[e7cd19a] | 108 | <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
|
---|
| 109 | href="upower-systemd-kernel.xml"/>
|
---|
[88d8c967] | 110 |
|
---|
| 111 | <indexterm zone="upower upower-kernel">
|
---|
| 112 | <primary sortas="d-upower">upower</primary>
|
---|
| 113 | </indexterm>
|
---|
| 114 | </sect2>
|
---|
[8558044] | 115 |
|
---|
[1a55dac4] | 116 | <sect2 role="installation">
|
---|
| 117 | <title>Installation of UPower</title>
|
---|
| 118 |
|
---|
[d9c3a6d5] | 119 | <para>
|
---|
[fc7f3a5] | 120 | First, remove an unneeded dependency from a test:
|
---|
[d9c3a6d5] | 121 | </para>
|
---|
| 122 |
|
---|
| 123 | <screen><userinput>sed '/parse_version/d' -i src/linux/integration-test.py</userinput></screen>
|
---|
| 124 |
|
---|
[b84342d6] | 125 | <para>
|
---|
| 126 | Install <application>UPower</application> by running the following
|
---|
| 127 | commands:
|
---|
| 128 | </para>
|
---|
[1a55dac4] | 129 |
|
---|
[91318eb] | 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 &&
|
---|
[475d4388] | 140 | ninja</userinput></screen>
|
---|
| 141 |
|
---|
[d9c3a6d5] | 142 | <screen revision="systemd"><userinput>mkdir build &&
|
---|
[475d4388] | 143 | cd build &&
|
---|
[91318eb] | 144 | meson setup .. \
|
---|
| 145 | --prefix=/usr \
|
---|
[475d4388] | 146 | --buildtype=release \
|
---|
| 147 | -Dgtk-doc=false \
|
---|
[91318eb] | 148 | -Dman=false &&
|
---|
[475d4388] | 149 | ninja</userinput></screen>
|
---|
[1a55dac4] | 150 |
|
---|
[09951b1] | 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. -->
|
---|
[fe04ab5] | 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. -->
|
---|
[f5afe1b] | 157 | <!-- On a 32-bit machine, the following test failure can be observed:
|
---|
| 158 | ======================================================================
|
---|
| 159 | FAIL: test_battery_energy_charge_mixed (__main__.Tests.test_battery_energy_charge_mixed)
|
---|
| 160 | battery which reports both current charge and energy
|
---|
| 161 |
|
---|
| 162 | self.assertEqual(self.get_dbus_dev_property(bat0_up, 'Percentage'), 40.0)
|
---|
| 163 | AssertionError: 40.00000000000001 != 40.0
|
---|
| 164 |
|
---|
| 165 | This is known upstream as https://gitlab.freedesktop.org/upower/upower/-/issues/251
|
---|
| 166 | Not sure if this is an actual problem, but it seems to start and work
|
---|
| 167 | properly -renodr -->
|
---|
| 168 |
|
---|
[b84342d6] | 169 | <para>
|
---|
[09951b1] | 170 | To test the results, issue: <command>LC_ALL=C ninja test</command>. Some
|
---|
[f5afe1b] | 171 | checks may not pass due to missing files. The test suite should be run
|
---|
| 172 | from a local GUI session started with dbus-launch. On 32-bit machines,
|
---|
| 173 | one test will fail due to rounding errors:
|
---|
| 174 | <filename>Tests.test_battery_energy_charge_mixed</filename>. On some
|
---|
[3f3aad1] | 175 | systems, two tests relating to the headphone hotplug feature are known
|
---|
[f5afe1b] | 176 | to fail. Those can be safely ignored since the functionality still works.
|
---|
[b84342d6] | 177 | </para>
|
---|
[1a55dac4] | 178 |
|
---|
[b84342d6] | 179 | <para>
|
---|
| 180 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
| 181 | </para>
|
---|
[1a55dac4] | 182 |
|
---|
[09951b1] | 183 | <screen role="root"><userinput>ninja install</userinput></screen>
|
---|
[1a55dac4] | 184 |
|
---|
| 185 | </sect2>
|
---|
| 186 |
|
---|
| 187 | <sect2 role="commands">
|
---|
| 188 | <title>Command Explanations</title>
|
---|
| 189 |
|
---|
[475d4388] | 190 | <para>
|
---|
| 191 | <parameter>-Dgtk-doc=false</parameter>: Prevents building the
|
---|
[c884c4b] | 192 | documentation. Remove this if you have <application>GTK-Doc</application>
|
---|
[475d4388] | 193 | installed and wish to build the documentation.
|
---|
| 194 | </para>
|
---|
| 195 |
|
---|
| 196 | <para>
|
---|
| 197 | <parameter>-Dman=false</parameter>: Prevents building the
|
---|
[d4236e0] | 198 | manual pages. Remove this if you have <xref linkend='libxslt'/> and
|
---|
| 199 | <xref linkend='docbook-xsl'/> installed and wish to build the manual
|
---|
| 200 | pages.
|
---|
[475d4388] | 201 | </para>
|
---|
| 202 |
|
---|
| 203 | <para revision="sysv">
|
---|
| 204 | <parameter>-Dsystemdsystemunitdir=no</parameter>: Removes
|
---|
| 205 | the dependency on <application>systemd</application>.
|
---|
| 206 | </para>
|
---|
[3990efec] | 207 |
|
---|
[475d4388] | 208 | <para revision="sysv">
|
---|
| 209 | <parameter>-Dudevrulesdir=/usr/lib/udev/rules.d</parameter>: Tells
|
---|
| 210 | the build system where to install <application>udev</application>
|
---|
[c884c4b] | 211 | rules because the information is missing in
|
---|
[475d4388] | 212 | <filename>/usr/lib/pkgconfig/libudev.pc</filename>
|
---|
| 213 | </para>
|
---|
[1a55dac4] | 214 |
|
---|
| 215 | </sect2>
|
---|
| 216 |
|
---|
[5d696ec2] | 217 | <sect2 role="configuration" revision="systemd">
|
---|
| 218 |
|
---|
| 219 | <title>Configuring UPower</title>
|
---|
| 220 | <!-- timer statistics have been removed from kernel (since 4.11)
|
---|
| 221 | I do not know if there is a replacement. See
|
---|
| 222 | https://patchwork.kernel.org/patch/9561519
|
---|
| 223 | and https://bugs.freedesktop.org/show_bug.cgi?id=100626
|
---|
[00c4d39] | 224 |
|
---|
[b84342d6] | 225 | <para>
|
---|
| 226 | To use the command <command>upower -w</command> for information about
|
---|
[01701da9] | 227 | processor wakeups (this command is used by <phrase revision="sysv">
|
---|
| 228 | <ulink url="&gnome-download-http;/gnome-power-manager/">gnome-power-manager</ulink></phrase><phrase revision="systemd"><xref linkend="gnome-power-manager"/></phrase>)
|
---|
[b84342d6] | 229 | you need to enable CONFIG_TIMER_STATS. This is achieved in
|
---|
| 230 | <command>make menuconfig</command> by going to the 'kernel-hacking'
|
---|
| 231 | menu and selecting 'Collect kernel timers statistics'.
|
---|
| 232 | </para>
|
---|
[5d696ec2] | 233 | -->
|
---|
[475d4388] | 234 | <sect3 id="upower-init">
|
---|
[1552ac8] | 235 | <title>Systemd Unit</title>
|
---|
| 236 |
|
---|
| 237 | <para>
|
---|
[ddd9384] | 238 | To start the <command>UPower</command> service at boot,
|
---|
[1552ac8] | 239 | enable the previously installed systemd unit by
|
---|
| 240 | running the following command as the
|
---|
| 241 | <systemitem class="username">root</systemitem> user:
|
---|
| 242 | </para>
|
---|
| 243 |
|
---|
| 244 | <indexterm zone="upower upower-init">
|
---|
| 245 | <primary sortas="f-upower">upower</primary>
|
---|
| 246 | </indexterm>
|
---|
| 247 |
|
---|
| 248 | <screen role="root"><userinput>systemctl enable upower</userinput></screen>
|
---|
| 249 |
|
---|
| 250 | </sect3>
|
---|
[8558044] | 251 |
|
---|
[00c4d39] | 252 | </sect2>
|
---|
[1552ac8] | 253 |
|
---|
[1a55dac4] | 254 | <sect2 role="content">
|
---|
| 255 | <title>Contents</title>
|
---|
| 256 |
|
---|
| 257 | <segmentedlist>
|
---|
[ddd9384] | 258 | <segtitle>Installed Program<!--
|
---|
| 259 | See below... <phrase revision="systemd">s</phrase>--></segtitle>
|
---|
[b35ec46c] | 260 | <segtitle>Installed Libraries</segtitle>
|
---|
[1a55dac4] | 261 | <segtitle>Installed Directories</segtitle>
|
---|
| 262 |
|
---|
| 263 | <seglistitem>
|
---|
[c341539] | 264 | <seg>
|
---|
[ddd9384] | 265 | upower
|
---|
| 266 | <!-- <phrase revision="systemd"> and upowerd</phrase>
|
---|
| 267 | Upowerd should not be listed, as it is in /usr/libexec, and is not supposed
|
---|
| 268 | to be run by a user. Furthermore, upowerd is also in sysv, and there is no
|
---|
| 269 | reason so single out systemd here. -->
|
---|
[c341539] | 270 | </seg>
|
---|
| 271 | <seg>
|
---|
| 272 | libupower-glib.so
|
---|
| 273 | </seg>
|
---|
| 274 | <seg>
|
---|
[7ded7e3] | 275 | /etc/UPower,
|
---|
[df9fb20] | 276 | /usr/include/libupower-glib, and
|
---|
[7ded7e3] | 277 | /var/lib/upower
|
---|
[c341539] | 278 | </seg>
|
---|
[1a55dac4] | 279 | </seglistitem>
|
---|
| 280 | </segmentedlist>
|
---|
| 281 |
|
---|
| 282 | <variablelist>
|
---|
| 283 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 284 | <?dbfo list-presentation="list"?>
|
---|
| 285 | <?dbhtml list-presentation="table"?>
|
---|
| 286 |
|
---|
| 287 | <varlistentry id="upower-prog">
|
---|
| 288 | <term><command>upower</command></term>
|
---|
| 289 | <listitem>
|
---|
[b84342d6] | 290 | <para>
|
---|
[4c24eb0a] | 291 | is the <application>UPower</application> command line tool
|
---|
[b84342d6] | 292 | </para>
|
---|
[1a55dac4] | 293 | <indexterm zone="upower upower-prog">
|
---|
| 294 | <primary sortas="b-upower">upower</primary>
|
---|
| 295 | </indexterm>
|
---|
| 296 | </listitem>
|
---|
| 297 | </varlistentry>
|
---|
[ddd9384] | 298 | <!-- See above
|
---|
[1552ac8] | 299 | <varlistentry id="upowerd" revision="systemd">
|
---|
| 300 | <term><command>upowerd</command></term>
|
---|
| 301 | <listitem>
|
---|
| 302 | <para>
|
---|
| 303 | is the <application>UPower</application> Daemon. It provides the
|
---|
| 304 | org.freedesktop.UPower service on the system message bus.
|
---|
| 305 | </para>
|
---|
| 306 | <indexterm zone="upower upowerd">
|
---|
| 307 | <primary sortas="b-upowerd">upowerd</primary>
|
---|
| 308 | </indexterm>
|
---|
| 309 | </listitem>
|
---|
[ddd9384] | 310 | </varlistentry>-->
|
---|
[1552ac8] | 311 |
|
---|
[1a55dac4] | 312 | <varlistentry id="libupower-glib">
|
---|
[caed4c52] | 313 | <term><filename class="libraryfile">libupower-glib.so</filename></term>
|
---|
[1a55dac4] | 314 | <listitem>
|
---|
[b84342d6] | 315 | <para>
|
---|
[4c24eb0a] | 316 | contains the <application>UPower</application> API functions
|
---|
[b84342d6] | 317 | </para>
|
---|
[1a55dac4] | 318 | <indexterm zone="upower libupower-glib">
|
---|
[c341539] | 319 | <primary sortas="c-libupower-glib">libupower-glib.so</primary>
|
---|
[1a55dac4] | 320 | </indexterm>
|
---|
| 321 | </listitem>
|
---|
| 322 | </varlistentry>
|
---|
| 323 |
|
---|
| 324 | </variablelist>
|
---|
| 325 |
|
---|
| 326 | </sect2>
|
---|
| 327 |
|
---|
| 328 | </sect1>
|
---|