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