[d1ea8a45] | 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 |
|
---|
[f60f672] | 7 | <!ENTITY systemd-download-http "http://anduin.linuxfromscratch.org/sources/other/systemd/systemd-&lfs-systemd-version;.tar.xz">
|
---|
| 8 | <!ENTITY systemd-patch-download-http "http://www.linuxfromscratch.org/patches/downloads/systemd/systemd-&lfs-systemd-version;-compat-1.patch">
|
---|
[d1ea8a45] | 9 | ]>
|
---|
| 10 |
|
---|
[a659adf] | 11 | <sect1 id="systemd" xreflabel="Systemd-&lfs-systemd-version;">
|
---|
[d1ea8a45] | 12 | <?dbhtml filename="systemd.html"?>
|
---|
| 13 |
|
---|
| 14 | <sect1info>
|
---|
| 15 | <othername>$LastChangedBy$</othername>
|
---|
| 16 | <date>$Date$</date>
|
---|
| 17 | </sect1info>
|
---|
| 18 |
|
---|
[f60f672] | 19 | <title>Systemd-&lfs-systemd-version;</title>
|
---|
[d1ea8a45] | 20 |
|
---|
| 21 | <indexterm zone="systemd">
|
---|
| 22 | <primary sortas="a-systemd">systemd</primary>
|
---|
| 23 | </indexterm>
|
---|
| 24 |
|
---|
| 25 | <sect2 role="package">
|
---|
| 26 | <title>Introduction to systemd</title>
|
---|
| 27 |
|
---|
| 28 | <para>
|
---|
| 29 | Even though <application>systemd</application> was built in
|
---|
| 30 | LFS, there are some features provided by the package that
|
---|
| 31 | some BLFS packages need, but their dependencies didn't fit
|
---|
| 32 | into LFS.
|
---|
| 33 | </para>
|
---|
| 34 |
|
---|
| 35 | <para>
|
---|
[ac38e9dc] | 36 | The main reason why <application>systemd</application>
|
---|
| 37 | needs to be rebuilt is that some packages expect
|
---|
| 38 | working <command>systemd-logind</command> service
|
---|
| 39 | which requires a PAM module from the
|
---|
| 40 | <application>systemd</application> source that
|
---|
| 41 | couldn't be built in LFS.
|
---|
[d1ea8a45] | 42 | </para>
|
---|
[1068c0d] | 43 | <!--
|
---|
[d1ea8a45] | 44 | <para>
|
---|
| 45 | Unlike other packages in BLFS, there is no set version of
|
---|
| 46 | <application>systemd</application> in this page's title and
|
---|
| 47 | no set version specified for download. Version updates to
|
---|
| 48 | <application>systemd</application> make it possible that the
|
---|
| 49 | user's system may have a <application>systemd</application>
|
---|
| 50 | version different from the one in the current LFS book.
|
---|
| 51 | Therefore, users should use the version of
|
---|
| 52 | <application>systemd</application> that is currently
|
---|
| 53 | installed on their system.
|
---|
| 54 | </para>
|
---|
[1068c0d] | 55 | -->
|
---|
[7274e6c] | 56 | <para>
|
---|
| 57 | This package is known to build and work properly using an
|
---|
[ab88249] | 58 | LFS-&lfs-version; platform using systemd-&lfs-systemd-version; source.
|
---|
[7274e6c] | 59 | </para>
|
---|
| 60 |
|
---|
[d1ea8a45] | 61 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 62 | <itemizedlist spacing="compact">
|
---|
| 63 | <listitem>
|
---|
| 64 | <para>Systemd Download (HTTP): <ulink url="&systemd-download-http;"/></para>
|
---|
| 65 | </listitem>
|
---|
| 66 | <listitem>
|
---|
| 67 | <para>Systemd Patch Download (HTTP): <ulink url="&systemd-patch-download-http;"/></para>
|
---|
| 68 | </listitem>
|
---|
| 69 | </itemizedlist>
|
---|
[f60f672] | 70 | <!--
|
---|
[d1ea8a45] | 71 | <para>
|
---|
| 72 | Make sure you download the "compat" patch whose version matches
|
---|
| 73 | the <application>systemd</application> version you are building.
|
---|
| 74 | </para>
|
---|
| 75 |
|
---|
| 76 | <note>
|
---|
| 77 | <para>
|
---|
| 78 | If you are unsure which version needs to be downloaded, issue
|
---|
[f60f672] | 79 | <command>systemctl - -version</command> in order to find out.
|
---|
[d1ea8a45] | 80 | Some of the commands below might need the version information.
|
---|
| 81 | Issue the following command to store the
|
---|
| 82 | <application>systemd</application> version number into an
|
---|
| 83 | environment variable:
|
---|
| 84 | </para>
|
---|
| 85 |
|
---|
[f60f672] | 86 | <screen><userinput>export SYSTEMD_VERSION=$(systemctl - -version | head -n1 | awk '{print $2}')</userinput></screen>
|
---|
[d1ea8a45] | 87 | </note>
|
---|
[f60f672] | 88 | -->
|
---|
[d1ea8a45] | 89 | <bridgehead renderas="sect3">systemd Dependencies</bridgehead>
|
---|
| 90 |
|
---|
[ac38e9dc] | 91 | <bridgehead renderas="sect4">Required</bridgehead>
|
---|
[d1ea8a45] | 92 | <para role="required">
|
---|
| 93 | <xref linkend="linux-pam"/>
|
---|
| 94 | </para>
|
---|
| 95 |
|
---|
| 96 | <bridgehead renderas="sect4">Recommended Runtime Dependency</bridgehead>
|
---|
| 97 | <para role="recommended">
|
---|
| 98 | <xref linkend="polkit"/>
|
---|
| 99 | </para>
|
---|
| 100 |
|
---|
| 101 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
| 102 | <para role="optional">
|
---|
[ac38e9dc] | 103 | <xref linkend="cacerts"/>,
|
---|
[d1ea8a45] | 104 | <xref linkend="curl"/>,
|
---|
| 105 | <xref linkend="elfutils"/>,
|
---|
| 106 | <xref linkend="gnutls"/>,
|
---|
[ac38e9dc] | 107 | <xref linkend="iptables"/>,
|
---|
[d1ea8a45] | 108 | <xref linkend="libgcrypt"/>,
|
---|
[b13775d] | 109 | <xref linkend="libidn"/>,
|
---|
[ac38e9dc] | 110 | <xref linkend="libxkbcommon"/>,
|
---|
| 111 | <xref linkend="python2"/> or
|
---|
[d1ea8a45] | 112 | <xref linkend="python3"/>,
|
---|
[ac38e9dc] | 113 | <xref linkend="qemu"/>,
|
---|
[b13775d] | 114 | <xref linkend="valgrind"/>,
|
---|
[ac38e9dc] | 115 | <ulink url="https://www.kernel.org/pub/linux/utils/cryptsetup/">cryptsetup</ulink>,
|
---|
| 116 | <ulink url="http://sourceforge.net/projects/gnu-efi/">gnu-efi</ulink>,
|
---|
| 117 | <ulink url="https://www.kernel.org/pub/linux/utils/kernel/kexec/">kexec-tools</ulink>,
|
---|
[d1ea8a45] | 118 | <ulink url="https://www.gnu.org/software/libmicrohttpd/">libmicrohttpd</ulink>,
|
---|
[b13775d] | 119 | <ulink url="http://sourceforge.net/projects/libseccomp/">libseccomp</ulink>,
|
---|
[ac38e9dc] | 120 | <ulink url="http://lxml.de/">lxml</ulink> (Python Module),
|
---|
| 121 | <ulink url="https://code.google.com/p/lz4/">lz4</ulink>,
|
---|
| 122 | <ulink url="http://fukuchi.org/works/qrencode/">qrencode</ulink>,
|
---|
| 123 | <ulink url="http://sourceforge.net/projects/linuxquota/">quota-tools</ulink> and
|
---|
| 124 | <ulink url="https://pypi.python.org/pypi/Sphinx">Sphinx</ulink>
|
---|
[d1ea8a45] | 125 | </para>
|
---|
| 126 |
|
---|
| 127 | <note>
|
---|
| 128 | <para>
|
---|
| 129 | In order to build the <application>systemd</application>
|
---|
| 130 | <application>Python</application> module, lxml package
|
---|
| 131 | needs to be installed for the corresponding
|
---|
| 132 | <application>Python</application> version (2 or 3).
|
---|
| 133 | Note that <command>configure</command> defaults to
|
---|
| 134 | <application>Python 2</application>. In order to build
|
---|
| 135 | the module for <application>Python 3</application>,
|
---|
| 136 | make sure you pass the <envar>PYTHON=python3</envar>
|
---|
| 137 | environment variable to the <command>configure</command>
|
---|
| 138 | command below.
|
---|
| 139 | </para>
|
---|
| 140 | </note>
|
---|
| 141 |
|
---|
[ac38e9dc] | 142 | <bridgehead renderas="sect4">Optional (to rebuild the manual pages)</bridgehead>
|
---|
[d1ea8a45] | 143 | <para role="optional">
|
---|
[ac38e9dc] | 144 | <xref linkend="DocBook"/>,
|
---|
| 145 | <xref linkend="docbook-xsl"/> and
|
---|
| 146 | <xref linkend="libxslt"/>
|
---|
[d1ea8a45] | 147 | </para>
|
---|
| 148 |
|
---|
| 149 | <para condition="html" role="usernotes">User Notes:
|
---|
| 150 | <ulink url="&blfs-wiki;/systemd"/>
|
---|
| 151 | </para>
|
---|
| 152 | </sect2>
|
---|
| 153 |
|
---|
| 154 | <sect2 role="installation">
|
---|
| 155 | <title>Installation of systemd</title>
|
---|
| 156 |
|
---|
| 157 | <para>
|
---|
| 158 | First, apply the required patch:
|
---|
| 159 | </para>
|
---|
| 160 |
|
---|
[f60f672] | 161 | <screen><userinput>patch -Np1 -i ../systemd-&lfs-systemd-version;-compat-1.patch &&
|
---|
| 162 | autoreconf -fi</userinput></screen>
|
---|
| 163 | <!--
|
---|
[ac38e9dc] | 164 | <para>
|
---|
| 165 | Additionally, apply any patch that is also applied in LFS.
|
---|
| 166 | </para>
|
---|
[f60f672] | 167 | -->
|
---|
[ac38e9dc] | 168 | <para>
|
---|
| 169 | Disable two tests that always fail:
|
---|
| 170 | </para>
|
---|
| 171 |
|
---|
| 172 | <screen><userinput>sed -e 's:test/udev-test.pl ::g' \
|
---|
| 173 | -e 's:test-copy$(EXEEXT) ::g' \
|
---|
| 174 | -i Makefile.in</userinput></screen>
|
---|
| 175 |
|
---|
[d1ea8a45] | 176 | <para>
|
---|
| 177 | Rebuild <application>systemd</application> by running the
|
---|
| 178 | following commands:
|
---|
| 179 | </para>
|
---|
| 180 |
|
---|
[b13775d] | 181 | <screen><userinput>cc_cv_CFLAGS__flto=no \
|
---|
| 182 | ./configure --prefix=/usr \
|
---|
[d1ea8a45] | 183 | --sysconfdir=/etc \
|
---|
| 184 | --localstatedir=/var \
|
---|
| 185 | --with-rootprefix= \
|
---|
| 186 | --with-rootlibdir=/lib \
|
---|
| 187 | --enable-split-usr \
|
---|
[b13775d] | 188 | --disable-firstboot \
|
---|
| 189 | --disable-ldconfig \
|
---|
| 190 | --disable-sysusers \
|
---|
[ac38e9dc] | 191 | --without-python \
|
---|
[f60f672] | 192 | --docdir=/usr/share/doc/systemd-&lfs-systemd-version; &&
|
---|
[d1ea8a45] | 193 | make</userinput></screen>
|
---|
| 194 |
|
---|
| 195 | <note>
|
---|
| 196 | <para>
|
---|
| 197 | For the best results, make sure you run the testsuite from
|
---|
| 198 | a system that is booted by the same
|
---|
| 199 | <application>systemd</application> version you are rebuilding.
|
---|
| 200 | </para>
|
---|
| 201 | </note>
|
---|
| 202 |
|
---|
| 203 | <para>
|
---|
| 204 | To test the results, issue: <command>make -k check</command>.
|
---|
| 205 | </para>
|
---|
| 206 |
|
---|
| 207 | <warning>
|
---|
| 208 | <para>
|
---|
| 209 | Installing the package will override all files installed by
|
---|
| 210 | <application>systemd</application> in LFS. It is critical that
|
---|
| 211 | nothing uses either <application>systemd</application> or
|
---|
| 212 | <application>Udev</application> libraries or programs during
|
---|
| 213 | the installation phrase. Best way to achieve that is to do the
|
---|
| 214 | installation in the rescue mode. To switch to the rescue mode,
|
---|
| 215 | issue the following command as the
|
---|
[c32ea611] | 216 | <systemitem class="username">root</systemitem> user from a TTY:
|
---|
[d1ea8a45] | 217 | </para>
|
---|
| 218 |
|
---|
| 219 | <screen role="root"><userinput>systemctl start rescue.target</userinput></screen>
|
---|
| 220 | </warning>
|
---|
| 221 |
|
---|
| 222 | <para>
|
---|
[b13775d] | 223 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
| 224 | </para>
|
---|
[d1ea8a45] | 225 |
|
---|
| 226 | <screen role="root"><userinput>make install</userinput></screen>
|
---|
| 227 |
|
---|
| 228 | <para>
|
---|
[b13775d] | 229 | Move NSS libraries to <filename class="directory">/lib</filename>
|
---|
| 230 | by running the following command as the <systemitem
|
---|
[d1ea8a45] | 231 | class="username">root</systemitem> user:
|
---|
| 232 | </para>
|
---|
| 233 |
|
---|
[b13775d] | 234 | <screen role="root"><userinput>mv -v /usr/lib/libnss_{myhostname,mymachines,resolve}.so.2 /lib</userinput></screen>
|
---|
[d1ea8a45] | 235 |
|
---|
| 236 | <para>
|
---|
[b13775d] | 237 | Remove an unnecessary directory by running the following command
|
---|
| 238 | as the <systemitem class="username">root</systemitem> user:
|
---|
[d1ea8a45] | 239 | </para>
|
---|
| 240 |
|
---|
| 241 | <screen role="root"><userinput>rm -rfv /usr/lib/rpm</userinput></screen>
|
---|
| 242 |
|
---|
[ab88249] | 243 | <!--
|
---|
[d1ea8a45] | 244 | <para>
|
---|
[b13775d] | 245 | Remove a reference to a non-existent group by running the following
|
---|
| 246 | command as the <systemitem class="username">root</systemitem> user:
|
---|
[d1ea8a45] | 247 | </para>
|
---|
| 248 |
|
---|
| 249 | <screen role="root"><userinput>sed -i "s:0775 root lock:0755 root root:g" /usr/lib/tmpfiles.d/legacy.conf</userinput></screen>
|
---|
[ab88249] | 250 | -->
|
---|
[d1ea8a45] | 251 |
|
---|
| 252 | </sect2>
|
---|
| 253 |
|
---|
| 254 | <sect2 role="configuration">
|
---|
| 255 | <title>Configuring systemd</title>
|
---|
| 256 |
|
---|
| 257 | <para>
|
---|
[ac38e9dc] | 258 | The <filename>/etc/pam.d/system-sesion</filename> file needs to
|
---|
[d1ea8a45] | 259 | be modified and a new file needs to be created in order for
|
---|
| 260 | <command>systemd-logind</command> to work correctly. To accomplish
|
---|
| 261 | that, run the following commands as the <systemitem
|
---|
| 262 | class="username">root</systemitem> user:
|
---|
| 263 | </para>
|
---|
| 264 |
|
---|
[ac38e9dc] | 265 | <screen role="root"><userinput>cat >> /etc/pam.d/system-session << "EOF" &&
|
---|
[d1ea8a45] | 266 | <literal># Begin Systemd addition
|
---|
| 267 |
|
---|
| 268 | session required pam_loginuid.so
|
---|
[ac38e9dc] | 269 | session optional pam_systemd.so
|
---|
[d1ea8a45] | 270 |
|
---|
| 271 | # End Systemd addition</literal>
|
---|
| 272 | EOF
|
---|
| 273 |
|
---|
| 274 | cat > /etc/pam.d/systemd-user << "EOF"
|
---|
| 275 | <literal># Begin /etc/pam.d/systemd-user
|
---|
| 276 |
|
---|
| 277 | account required pam_access.so
|
---|
| 278 | account include system-account
|
---|
| 279 |
|
---|
| 280 | session required pam_env.so
|
---|
| 281 | session required pam_limits.so
|
---|
| 282 | session include system-session
|
---|
| 283 |
|
---|
| 284 | auth required pam_deny.so
|
---|
| 285 | password required pam_deny.so
|
---|
| 286 |
|
---|
| 287 | # End /etc/pam.d/systemd-user</literal>
|
---|
| 288 | EOF</userinput></screen>
|
---|
| 289 |
|
---|
| 290 | <para>
|
---|
| 291 | At this point it would be a nice idea to reboot to
|
---|
[f2d55c92] | 292 | test if the reinstallation was successful.
|
---|
[d1ea8a45] | 293 | </para>
|
---|
| 294 |
|
---|
| 295 | </sect2>
|
---|
| 296 |
|
---|
| 297 | <sect2 role="content">
|
---|
| 298 | <title>Contents</title>
|
---|
| 299 |
|
---|
| 300 | <para>
|
---|
| 301 | A list of the installed files, along with their short
|
---|
| 302 | descriptions can be found at
|
---|
[035e5d56] | 303 | <ulink url="&lfs-root;/chapter06/systemd.html#contents-systemd"/>.
|
---|
[d1ea8a45] | 304 | </para>
|
---|
| 305 |
|
---|
| 306 | <para>
|
---|
| 307 | Below are listed newly installed libraries and directories
|
---|
| 308 | along with short descriptions.
|
---|
| 309 | </para>
|
---|
| 310 |
|
---|
| 311 | <segmentedlist>
|
---|
| 312 | <segtitle>Installed Programs</segtitle>
|
---|
| 313 | <segtitle>Installed Libraries</segtitle>
|
---|
| 314 | <segtitle>Installed Directories</segtitle>
|
---|
| 315 |
|
---|
| 316 | <seglistitem>
|
---|
| 317 | <seg>
|
---|
| 318 | None
|
---|
| 319 | </seg>
|
---|
| 320 | <seg>
|
---|
[ac38e9dc] | 321 | pam_systemd.so
|
---|
[d1ea8a45] | 322 | (in <filename class="directory">/lib/security</filename>)
|
---|
| 323 | </seg>
|
---|
| 324 | <seg>
|
---|
[ac38e9dc] | 325 | None
|
---|
[d1ea8a45] | 326 | </seg>
|
---|
| 327 | </seglistitem>
|
---|
| 328 | </segmentedlist>
|
---|
| 329 |
|
---|
| 330 | <variablelist>
|
---|
| 331 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 332 | <?dbfo list-presentation="list"?>
|
---|
| 333 | <?dbhtml list-presentation="table"?>
|
---|
| 334 |
|
---|
| 335 | <varlistentry id="pam_systemd">
|
---|
| 336 | <term><filename class="libraryfile">pam_systemd.so</filename></term>
|
---|
| 337 | <listitem>
|
---|
| 338 | <para>
|
---|
| 339 | is a PAM module used to register user sessions with the
|
---|
| 340 | <application>systemd</application> login manager,
|
---|
| 341 | <command>systemd-logind</command>.
|
---|
| 342 | </para>
|
---|
| 343 | <indexterm zone="systemd pam_systemd">
|
---|
| 344 | <primary sortas="c-pam_systemd">pam_systemd.so</primary>
|
---|
| 345 | </indexterm>
|
---|
| 346 | </listitem>
|
---|
| 347 | </varlistentry>
|
---|
| 348 |
|
---|
| 349 | </variablelist>
|
---|
| 350 |
|
---|
| 351 | </sect2>
|
---|
| 352 |
|
---|
| 353 | </sect1>
|
---|