[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 |
|
---|
[ba902838] | 129 | <screen><userinput>sed -i "s:blkid/::" $(grep -rl "blkid/blkid.h") &&
|
---|
[4b7fe82] | 130 | patch -Np1 -i ../systemd-&systemd-version;-compat-patch; &&
|
---|
[e280697] | 131 |
|
---|
| 132 | ./configure --prefix=/usr \
|
---|
| 133 | --sysconfdir=/etc \
|
---|
| 134 | --localstatedir=/var \
|
---|
| 135 | --with-rootprefix= \
|
---|
| 136 | --with-rootlibdir=/lib \
|
---|
| 137 | --enable-split-usr \
|
---|
[4b7fe82] | 138 | --docdir=/usr/share/doc/systemd-&systemd-version; &&
|
---|
[e280697] | 139 |
|
---|
[4b7fe82] | 140 | make</userinput></screen>
|
---|
[e280697] | 141 |
|
---|
[4b7fe82] | 142 | <para>First prevent a few broken test cases from being run:</para>
|
---|
[e280697] | 143 |
|
---|
[ba902838] | 144 | <screen><userinput>sed -i s:test/udev-test.pl::g Makefile</userinput></screen>
|
---|
[e280697] | 145 |
|
---|
[4b7fe82] | 146 | <note>
|
---|
[e280697] | 147 | <para>For full test coverage, the test suite should be run
|
---|
[60b5b0b] | 148 | from a system booted using systemd.
|
---|
| 149 | </para>
|
---|
| 150 | </note>
|
---|
[4b7fe82] | 151 |
|
---|
| 152 | <para>To test the results, issue: <command>make -k check</command>.</para>
|
---|
| 153 |
|
---|
[60b5b0b] | 154 | <warning>
|
---|
[4b7fe82] | 155 | <para>Installing the package will override all systemd components installed in LFS,
|
---|
| 156 | so it is advised that the re-installation is done in a rescue mode with no programs except basic
|
---|
[60b5b0b] | 157 | systemd ones running. To enter rescue mode with systemd, issue this as the <systemitem class="username">root</systemitem>
|
---|
| 158 | from a VT console:
|
---|
| 159 | </para>
|
---|
| 160 | </warning>
|
---|
[4b7fe82] | 161 |
|
---|
[ba902838] | 162 | <screen role="root"><userinput>systemctl start rescue.target</userinput></screen>
|
---|
[e280697] | 163 |
|
---|
[4b7fe82] | 164 | <para>Now re-install as the <systemitem class="username">root</systemitem>
|
---|
[e280697] | 165 | user:</para>
|
---|
| 166 |
|
---|
[0ea8be75] | 167 | <screen role="root">
|
---|
| 168 |
|
---|
| 169 | <userinput>make install</userinput></screen>
|
---|
[e280697] | 170 |
|
---|
[4b7fe82] | 171 | <para>Move NSS myhostname library to <filename class="directory">/lib</filename>
|
---|
| 172 | as the <systemitem class="username">root</systemitem> user:</para>
|
---|
| 173 |
|
---|
[ba902838] | 174 | <screen role="root"><userinput>mv -v /usr/lib/libnss_myhostname.so.2 /lib</userinput></screen>
|
---|
[e280697] | 175 |
|
---|
[4b7fe82] | 176 | <para>Remove an unnecessary directory as the as the <systemitem class="username">root</systemitem> user:</para>
|
---|
[e280697] | 177 |
|
---|
[ba902838] | 178 | <screen role="root"><userinput>rm -rfv /usr/lib/rpm</userinput></screen>
|
---|
[e280697] | 179 |
|
---|
[4b7fe82] | 180 | <para>Remove a reference to a non-existent group as the <systemitem class="username">root</systemitem> user:</para>
|
---|
[e280697] | 181 |
|
---|
[ba902838] | 182 | <screen role="root"><userinput>sed -i "s:0775 root lock:0755 root root:g" /usr/lib/tmpfiles.d/legacy.conf</userinput></screen>
|
---|
[e280697] | 183 |
|
---|
[4b7fe82] | 184 | <note>
|
---|
| 185 | <para> If libxslt was present, the man pages were also installed by make install.
|
---|
| 186 | If not, the old man pages will remain and there's no need to reinstall
|
---|
| 187 | them since the same version of systemd was used. The same goes for the sysv compatibility links.
|
---|
| 188 | </para>
|
---|
| 189 | </note>
|
---|
[e280697] | 190 |
|
---|
[60b5b0b] | 191 | <warning>
|
---|
[4b7fe82] | 192 | <para>WARNING do NOT run the systemd-machine-id-setup command again,
|
---|
| 193 | UUID was generated once and as its name says,
|
---|
| 194 | it should be unique. Generating a new one might result in broken logs from
|
---|
[e280697] | 195 | journald and who knows what else.
|
---|
| 196 | </para>
|
---|
[60b5b0b] | 197 | </warning>
|
---|
| 198 |
|
---|
| 199 | <note>
|
---|
[4b7fe82] | 200 | <para>If libgcrypt was present at build time, make sure you move both libgpg-error and
|
---|
| 201 | libgcrypt versioned libraries to /lib so that they are
|
---|
[60b5b0b] | 202 | available in case of separate /usr by
|
---|
| 203 | issuing the following commands as the <systemitem class="username">root</systemitem>
|
---|
[4b7fe82] | 204 | user:
|
---|
[60b5b0b] | 205 |
|
---|
[ba902838] | 206 | <screen role="root"><userinput>mv -v /usr/lib/libgcrypt.so.* /usr/lib/libgpg-error.so.* /lib &&
|
---|
[0ea8be75] | 207 | ln -sfv ../../lib/$(readlink /usr/lib/libgcrypt.so) /usr/lib/libgcrypt.so &&
|
---|
[4b7fe82] | 208 | ln -sfv ../../lib/$(readlink /usr/lib/libgpg-error.so) /usr/lib/libgpg-error.so</userinput></screen></para></note>
|
---|
[e280697] | 209 |
|
---|
[0ea8be75] | 210 | <para>If the pam_systemd.so PAM module was built, the system-sesion
|
---|
[4b7fe82] | 211 | PAM file needs to be modified and a new file needs to be created in order
|
---|
[e280697] | 212 | for systemd-logind to work correctly. Create the configuration file by
|
---|
| 213 | issuing the following commands as the <systemitem class="username">root</systemitem>
|
---|
| 214 | user:
|
---|
| 215 | </para>
|
---|
[0ea8be75] | 216 |
|
---|
[e280697] | 217 | <screen role="root"><userinput>
|
---|
| 218 |
|
---|
| 219 | cat > /etc/pam.d/system-session << "EOF"
|
---|
| 220 | # Begin Systemd addition
|
---|
[4b7fe82] | 221 |
|
---|
[e280697] | 222 | session optional pam_loginuid.so
|
---|
| 223 | session optional pam_systemd.so
|
---|
| 224 | # End Systemd addition
|
---|
| 225 | EOF &&
|
---|
| 226 |
|
---|
| 227 | cat > /etc/pam.d/systemd-user << "EOF"
|
---|
| 228 | # Begin /etc/pam.d/systemd-user
|
---|
| 229 |
|
---|
| 230 | account required pam_access.so
|
---|
| 231 | account include system-account
|
---|
| 232 |
|
---|
| 233 | session required pam_env.so
|
---|
| 234 | session required pam_limits.so
|
---|
| 235 | session include system-session
|
---|
| 236 |
|
---|
| 237 | auth required pam_deny.so
|
---|
| 238 | password required pam_deny.so
|
---|
| 239 |
|
---|
| 240 | # End /etc/pam.d/systemd-user
|
---|
| 241 | EOF</userinput></screen>
|
---|
| 242 |
|
---|
[4b7fe82] | 243 | <para>At this point it would be a nice idea to reboot, or rather restart the
|
---|
[e280697] | 244 | systemd components in case of new dependencies as the <systemitem class="username">root</systemitem>
|
---|
| 245 | user:</para>
|
---|
| 246 |
|
---|
[ba902838] | 247 | <screen role="root"><userinput>systemctl daemon-reexec &&
|
---|
[0ea8be75] | 248 | systemctl restart systemd-logind systemd-journald systemd-udevd</userinput></screen>
|
---|
| 249 |
|
---|
[e280697] | 250 | </sect2>
|
---|
| 251 |
|
---|
[4b7fe82] | 252 | <sect2 role="commands">
|
---|
| 253 | <title>Command Explanations</title>
|
---|
| 254 |
|
---|
| 255 | <para>
|
---|
| 256 | <parameter>--with-root*</parameter>: These switches ensure that core programs and
|
---|
| 257 | shared libraries are installed in the subdirectories
|
---|
| 258 | of the root partition.
|
---|
| 259 | </para>
|
---|
| 260 |
|
---|
| 261 | <para>
|
---|
| 262 | <parameter>--enable-split-usr</parameter>: This switch ensures that systemd will work on
|
---|
| 263 | systems where /bin, /lib and /sbin directories are not
|
---|
| 264 | symlinks to their /usr counterparts.
|
---|
| 265 | </para>
|
---|
| 266 |
|
---|
| 267 | </sect2>
|
---|
| 268 |
|
---|
[e280697] | 269 | <sect2 role="content">
|
---|
| 270 | <title>Contents</title>
|
---|
[4b7fe82] | 271 |
|
---|
| 272 | <para>
|
---|
[4d66725] | 273 | A list of the installed files, along with their short descriptions can be
|
---|
[b575134] | 274 | found at <ulink url="http://www.linuxfromscratch.org/lfs/view/systemd/chapter06/systemd.html#contents-systemd"/>.
|
---|
[4b7fe82] | 275 | </para>
|
---|
[e280697] | 276 | </sect2>
|
---|
| 277 |
|
---|
| 278 | </sect1>
|
---|