[e280697] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
| 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
[4b7fe82] | 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
[e280697] | 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 |
|
---|
| 7 | <!ENTITY systemd-download-http "http://www.freedesktop.org/software/systemd/systemd-&systemd-version;.tar.xz">
|
---|
| 8 | <!ENTITY systemd-download-ftp " ">
|
---|
| 9 | <!ENTITY systemd-md5sum "eac4f9fc5bd18a0efc3fc20858baacf3">
|
---|
| 10 | <!ENTITY systemd-size "2.7 MB">
|
---|
[4b7fe82] | 11 | <!ENTITY systemd-buildsize "23 MB">
|
---|
| 12 | <!ENTITY systemd-time "0.3 SBU">
|
---|
[e280697] | 13 | ]>
|
---|
| 14 |
|
---|
| 15 | <sect1 id="systemd" xreflabel="systemd">
|
---|
| 16 | <?dbhtml filename="systemd.html"?>
|
---|
| 17 |
|
---|
[4b7fe82] | 18 | <sect1info>
|
---|
[e280697] | 19 | <othername>$LastChangedBy$</othername>
|
---|
| 20 | <date>$Date$</date>
|
---|
| 21 | </sect1info>
|
---|
| 22 |
|
---|
| 23 | <title>Systemd-&systemd-version;</title>
|
---|
| 24 |
|
---|
| 25 | <indexterm zone="systemd">
|
---|
[4b7fe82] | 26 | <primary sortas="a-systemd"></primary>
|
---|
| 27 | </indexterm>
|
---|
[e280697] | 28 |
|
---|
| 29 | <sect2 role="package">
|
---|
[4b7fe82] | 30 | <title>Introduction to Systemd</title>
|
---|
[e280697] | 31 |
|
---|
[4b7fe82] | 32 | <para>This part contains instructions on how to build systemd package with
|
---|
[60b5b0b] | 33 | more features and why some features are required.
|
---|
| 34 | </para>
|
---|
[e280697] | 35 |
|
---|
[4b7fe82] | 36 | &lfs75_checked;
|
---|
[e280697] | 37 |
|
---|
| 38 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
[0ea8be75] | 39 |
|
---|
| 40 |
|
---|
[4b7fe82] | 41 | <warning>
|
---|
[60b5b0b] | 42 | <para>
|
---|
[4b7fe82] | 43 | It is important that you use the _same_ version of systemd as it was used in LFS build.
|
---|
[60b5b0b] | 44 | </para>
|
---|
[4b7fe82] | 45 | </warning>
|
---|
[0ea8be75] | 46 |
|
---|
| 47 |
|
---|
[e280697] | 48 | <itemizedlist spacing="compact">
|
---|
| 49 | <listitem>
|
---|
| 50 | <para>Download (HTTP): <ulink url="&systemd-download-http;"/></para>
|
---|
| 51 | </listitem>
|
---|
| 52 | <listitem>
|
---|
| 53 | <para>Download (FTP): <ulink url="&systemd-download-ftp;"/></para>
|
---|
| 54 | </listitem>
|
---|
| 55 | <listitem>
|
---|
| 56 | <para>Download MD5 sum: &systemd-md5sum;</para>
|
---|
| 57 | </listitem>
|
---|
| 58 | <listitem>
|
---|
| 59 | <para>Download size: &systemd-size;</para>
|
---|
| 60 | </listitem>
|
---|
| 61 | <listitem>
|
---|
| 62 | <para>Estimated disk space required: &systemd-buildsize;</para>
|
---|
| 63 | </listitem>
|
---|
| 64 | <listitem>
|
---|
| 65 | <para>Estimated build time: &systemd-time;</para>
|
---|
| 66 | </listitem>
|
---|
| 67 | </itemizedlist>
|
---|
| 68 |
|
---|
[0ea8be75] | 69 |
|
---|
[4b7fe82] | 70 | <bridgehead renderas="sect3">Systemd Dependencies</bridgehead>
|
---|
[e280697] | 71 |
|
---|
| 72 | <bridgehead renderas="sect4">Required</bridgehead>
|
---|
| 73 | <para role="required">
|
---|
| 74 | <xref linkend="glib2"/>,
|
---|
[4b7fe82] | 75 | <xref linkend="gobject-introspection"/>, and
|
---|
[60b5b0b] | 76 | <xref linkend="linux-pam"/>
|
---|
[e280697] | 77 | </para>
|
---|
| 78 |
|
---|
| 79 | <bridgehead renderas="sect4">Optional Dependencies</bridgehead>
|
---|
| 80 | <para role="optional">
|
---|
[4b7fe82] | 81 | <xref linkend="libgcrypt"/> (see note below)
|
---|
| 82 | </para>
|
---|
| 83 |
|
---|
| 84 | <bridgehead renderas="sect4">Optional for rebuilding manual pages</bridgehead>
|
---|
| 85 | <para role="optional">
|
---|
| 86 | <xref linkend="libxslt"/>,
|
---|
| 87 | <xref linkend="DocBook"/>,
|
---|
| 88 | <xref linkend="docbook-xsl"/>, and
|
---|
| 89 | <xref linkend="gtk-doc"/> (for rebuilding UDev API docs)
|
---|
[e280697] | 90 | </para>
|
---|
| 91 |
|
---|
| 92 | <bridgehead renderas="sect4">Optional Runtime Dependencies</bridgehead>
|
---|
| 93 | <para role="optional">
|
---|
| 94 | <xref linkend="pciutils"/> and
|
---|
| 95 | <xref linkend="usbutils"/>
|
---|
| 96 | </para>
|
---|
| 97 |
|
---|
[60b5b0b] | 98 | <note>
|
---|
| 99 | <para>
|
---|
| 100 | Having the first two packages at build time results in:
|
---|
| 101 |
|
---|
| 102 | libgudev-1.0.so in /usr/lib, /usr/include/gudev-1.0 directory, GUdev-1.0.
|
---|
[4b7fe82] | 103 | {typelib,gir} GObject-Introspection bindings in /usr/lib/girepository-1.0
|
---|
[60b5b0b] | 104 | and /usr/share/gir-1.0 respectively.
|
---|
| 105 |
|
---|
| 106 | Since GLib2 has a dependency on Python, systemd Python bindings were also installed in:
|
---|
| 107 |
|
---|
| 108 | /usr/lib/python2.7/site-packages/systemd
|
---|
| 109 |
|
---|
| 110 | Having the Linux-PAM package at build time results in:
|
---|
| 111 |
|
---|
| 112 | pam_systemd.so in /lib/security, a PAM module used to register logins/logouts with systemd-logind component.
|
---|
[4b7fe82] | 113 |
|
---|
[60b5b0b] | 114 | This is required by anything that now requires ConsoleKit (desktops, mostly), as well as some other software.
|
---|
| 115 | </para>
|
---|
| 116 | </note>
|
---|
| 117 |
|
---|
[e280697] | 118 | <para condition="html" role="usernotes">User Notes:
|
---|
| 119 | <ulink url="&blfs-wiki;/systemd"/></para>
|
---|
| 120 |
|
---|
| 121 | </sect2>
|
---|
| 122 |
|
---|
| 123 | <sect2 role="installation">
|
---|
[0ea8be75] | 124 |
|
---|
[4b7fe82] | 125 | <title>Installation of Systemd</title>
|
---|
[e280697] | 126 |
|
---|
[4b7fe82] | 127 | <para>First, re-build systemd:</para>
|
---|
[e280697] | 128 |
|
---|
[0ea8be75] | 129 | <screen><userinput>
|
---|
| 130 |
|
---|
| 131 | sed -i "s:blkid/::" $(grep -rl "blkid/blkid.h") &&
|
---|
[4b7fe82] | 132 | patch -Np1 -i ../systemd-&systemd-version;-compat-patch; &&
|
---|
[e280697] | 133 |
|
---|
| 134 | ./configure --prefix=/usr \
|
---|
| 135 | --sysconfdir=/etc \
|
---|
| 136 | --localstatedir=/var \
|
---|
| 137 | --with-rootprefix= \
|
---|
| 138 | --with-rootlibdir=/lib \
|
---|
| 139 | --enable-split-usr \
|
---|
[4b7fe82] | 140 | --docdir=/usr/share/doc/systemd-&systemd-version; &&
|
---|
[e280697] | 141 |
|
---|
[4b7fe82] | 142 | make</userinput></screen>
|
---|
[e280697] | 143 |
|
---|
[4b7fe82] | 144 | <para>First prevent a few broken test cases from being run:</para>
|
---|
[e280697] | 145 |
|
---|
[0ea8be75] | 146 | <screen><userinput>
|
---|
| 147 |
|
---|
| 148 | sed -i s:test/udev-test.pl::g Makefile</userinput></screen>
|
---|
[e280697] | 149 |
|
---|
[4b7fe82] | 150 | <note>
|
---|
[e280697] | 151 | <para>For full test coverage, the test suite should be run
|
---|
[60b5b0b] | 152 | from a system booted using systemd.
|
---|
| 153 | </para>
|
---|
| 154 | </note>
|
---|
[4b7fe82] | 155 |
|
---|
| 156 | <para>To test the results, issue: <command>make -k check</command>.</para>
|
---|
| 157 |
|
---|
[60b5b0b] | 158 | <warning>
|
---|
[4b7fe82] | 159 | <para>Installing the package will override all systemd components installed in LFS,
|
---|
| 160 | so it is advised that the re-installation is done in a rescue mode with no programs except basic
|
---|
[60b5b0b] | 161 | systemd ones running. To enter rescue mode with systemd, issue this as the <systemitem class="username">root</systemitem>
|
---|
| 162 | from a VT console:
|
---|
| 163 | </para>
|
---|
| 164 | </warning>
|
---|
[4b7fe82] | 165 |
|
---|
[0ea8be75] | 166 | <screen role="root">
|
---|
| 167 |
|
---|
| 168 | <userinput>systemctl start rescue.target</userinput></screen>
|
---|
[e280697] | 169 |
|
---|
[4b7fe82] | 170 | <para>Now re-install as the <systemitem class="username">root</systemitem>
|
---|
[e280697] | 171 | user:</para>
|
---|
| 172 |
|
---|
[0ea8be75] | 173 | <screen role="root">
|
---|
| 174 |
|
---|
| 175 | <userinput>make install</userinput></screen>
|
---|
[e280697] | 176 |
|
---|
[4b7fe82] | 177 | <para>Move NSS myhostname library to <filename class="directory">/lib</filename>
|
---|
| 178 | as the <systemitem class="username">root</systemitem> user:</para>
|
---|
| 179 |
|
---|
[0ea8be75] | 180 | <screen role="root">
|
---|
| 181 |
|
---|
| 182 | <userinput>mv -v /usr/lib/libnss_myhostname.so.2 /lib</userinput></screen>
|
---|
[e280697] | 183 |
|
---|
[4b7fe82] | 184 | <para>Remove an unnecessary directory as the as the <systemitem class="username">root</systemitem> user:</para>
|
---|
[e280697] | 185 |
|
---|
[0ea8be75] | 186 | <screen role="root">
|
---|
| 187 |
|
---|
| 188 | <userinput>rm -rfv /usr/lib/rpm</userinput></screen>
|
---|
[e280697] | 189 |
|
---|
[4b7fe82] | 190 | <para>Remove a reference to a non-existent group as the <systemitem class="username">root</systemitem> user:</para>
|
---|
[e280697] | 191 |
|
---|
[0ea8be75] | 192 | <screen role="root">
|
---|
| 193 |
|
---|
| 194 | <userinput>sed -i "s:0775 root lock:0755 root root:g" /usr/lib/tmpfiles.d/legacy.conf</userinput></screen>
|
---|
[e280697] | 195 |
|
---|
[4b7fe82] | 196 | <note>
|
---|
| 197 | <para> If libxslt was present, the man pages were also installed by make install.
|
---|
| 198 | If not, the old man pages will remain and there's no need to reinstall
|
---|
| 199 | them since the same version of systemd was used. The same goes for the sysv compatibility links.
|
---|
| 200 | </para>
|
---|
| 201 | </note>
|
---|
[e280697] | 202 |
|
---|
[60b5b0b] | 203 | <warning>
|
---|
[4b7fe82] | 204 | <para>WARNING do NOT run the systemd-machine-id-setup command again,
|
---|
| 205 | UUID was generated once and as its name says,
|
---|
| 206 | it should be unique. Generating a new one might result in broken logs from
|
---|
[e280697] | 207 | journald and who knows what else.
|
---|
| 208 | </para>
|
---|
[60b5b0b] | 209 | </warning>
|
---|
| 210 |
|
---|
| 211 | <note>
|
---|
[4b7fe82] | 212 | <para>If libgcrypt was present at build time, make sure you move both libgpg-error and
|
---|
| 213 | libgcrypt versioned libraries to /lib so that they are
|
---|
[60b5b0b] | 214 | available in case of separate /usr by
|
---|
| 215 | issuing the following commands as the <systemitem class="username">root</systemitem>
|
---|
[4b7fe82] | 216 | user:
|
---|
[60b5b0b] | 217 |
|
---|
[0ea8be75] | 218 | <screen role="root"><userinput>
|
---|
| 219 |
|
---|
| 220 | mv -v /usr/lib/libgcrypt.so.* /usr/lib/libgpg-error.so.* /lib &&
|
---|
| 221 | ln -sfv ../../lib/$(readlink /usr/lib/libgcrypt.so) /usr/lib/libgcrypt.so &&
|
---|
[4b7fe82] | 222 | ln -sfv ../../lib/$(readlink /usr/lib/libgpg-error.so) /usr/lib/libgpg-error.so</userinput></screen></para></note>
|
---|
[e280697] | 223 |
|
---|
[0ea8be75] | 224 | <para>If the pam_systemd.so PAM module was built, the system-sesion
|
---|
[4b7fe82] | 225 | PAM file needs to be modified and a new file needs to be created in order
|
---|
[e280697] | 226 | for systemd-logind to work correctly. Create the configuration file by
|
---|
| 227 | issuing the following commands as the <systemitem class="username">root</systemitem>
|
---|
| 228 | user:
|
---|
| 229 | </para>
|
---|
[0ea8be75] | 230 |
|
---|
[e280697] | 231 | <screen role="root"><userinput>
|
---|
| 232 |
|
---|
| 233 | cat > /etc/pam.d/system-session << "EOF"
|
---|
| 234 | # Begin Systemd addition
|
---|
[4b7fe82] | 235 |
|
---|
[e280697] | 236 | session optional pam_loginuid.so
|
---|
| 237 | session optional pam_systemd.so
|
---|
| 238 | # End Systemd addition
|
---|
| 239 | EOF &&
|
---|
| 240 |
|
---|
| 241 | cat > /etc/pam.d/systemd-user << "EOF"
|
---|
| 242 | # Begin /etc/pam.d/systemd-user
|
---|
| 243 |
|
---|
| 244 | account required pam_access.so
|
---|
| 245 | account include system-account
|
---|
| 246 |
|
---|
| 247 | session required pam_env.so
|
---|
| 248 | session required pam_limits.so
|
---|
| 249 | session include system-session
|
---|
| 250 |
|
---|
| 251 | auth required pam_deny.so
|
---|
| 252 | password required pam_deny.so
|
---|
| 253 |
|
---|
| 254 | # End /etc/pam.d/systemd-user
|
---|
| 255 | EOF</userinput></screen>
|
---|
| 256 |
|
---|
[4b7fe82] | 257 | <para>At this point it would be a nice idea to reboot, or rather restart the
|
---|
[e280697] | 258 | systemd components in case of new dependencies as the <systemitem class="username">root</systemitem>
|
---|
| 259 | user:</para>
|
---|
| 260 |
|
---|
[0ea8be75] | 261 | <screen role="root">
|
---|
| 262 |
|
---|
| 263 | <userinput>systemctl daemon-reexec &&
|
---|
| 264 | systemctl restart systemd-logind systemd-journald systemd-udevd</userinput></screen>
|
---|
| 265 |
|
---|
[e280697] | 266 | </sect2>
|
---|
| 267 |
|
---|
[4b7fe82] | 268 | <sect2 role="commands">
|
---|
| 269 | <title>Command Explanations</title>
|
---|
| 270 |
|
---|
| 271 | <para>
|
---|
| 272 | <parameter>--with-root*</parameter>: These switches ensure that core programs and
|
---|
| 273 | shared libraries are installed in the subdirectories
|
---|
| 274 | of the root partition.
|
---|
| 275 | </para>
|
---|
| 276 |
|
---|
| 277 | <para>
|
---|
| 278 | <parameter>--enable-split-usr</parameter>: This switch ensures that systemd will work on
|
---|
| 279 | systems where /bin, /lib and /sbin directories are not
|
---|
| 280 | symlinks to their /usr counterparts.
|
---|
| 281 | </para>
|
---|
| 282 |
|
---|
| 283 | </sect2>
|
---|
| 284 |
|
---|
[e280697] | 285 | <sect2 role="content">
|
---|
| 286 | <title>Contents</title>
|
---|
[4b7fe82] | 287 |
|
---|
| 288 | <para>
|
---|
[4d66725] | 289 | A list of the installed files, along with their short descriptions can be
|
---|
| 290 | found at <ulink url="http://www.linuxfromscratch.org/lfs/view/&lfs-version;/chapter06/systemd.html#contents-systemd"/>.
|
---|
[4b7fe82] | 291 | </para>
|
---|
[e280697] | 292 | </sect2>
|
---|
| 293 |
|
---|
| 294 | </sect1>
|
---|