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 |
|
---|
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">
|
---|
9 | ]>
|
---|
10 |
|
---|
11 | <sect1 id="systemd" xreflabel="Systemd">
|
---|
12 | <?dbhtml filename="systemd.html"?>
|
---|
13 |
|
---|
14 | <sect1info>
|
---|
15 | <othername>$LastChangedBy$</othername>
|
---|
16 | <date>$Date$</date>
|
---|
17 | </sect1info>
|
---|
18 |
|
---|
19 | <title>Systemd-&lfs-systemd-version;</title>
|
---|
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>
|
---|
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.
|
---|
42 | </para>
|
---|
43 | <!--
|
---|
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>
|
---|
55 | -->
|
---|
56 | <para>
|
---|
57 | This package is known to build and work properly using an
|
---|
58 | LFS-&lfs-version; platform using systemd-228 source.
|
---|
59 | </para>
|
---|
60 |
|
---|
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>
|
---|
70 | <!--
|
---|
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
|
---|
79 | <command>systemctl - -version</command> in order to find out.
|
---|
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 |
|
---|
86 | <screen><userinput>export SYSTEMD_VERSION=$(systemctl - -version | head -n1 | awk '{print $2}')</userinput></screen>
|
---|
87 | </note>
|
---|
88 | -->
|
---|
89 | <bridgehead renderas="sect3">systemd Dependencies</bridgehead>
|
---|
90 |
|
---|
91 | <bridgehead renderas="sect4">Required</bridgehead>
|
---|
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">
|
---|
103 | <xref linkend="cacerts"/>,
|
---|
104 | <xref linkend="curl"/>,
|
---|
105 | <xref linkend="elfutils"/>,
|
---|
106 | <xref linkend="gnutls"/>,
|
---|
107 | <xref linkend="iptables"/>,
|
---|
108 | <xref linkend="libgcrypt"/>,
|
---|
109 | <xref linkend="libidn"/>,
|
---|
110 | <xref linkend="libxkbcommon"/>,
|
---|
111 | <xref linkend="python2"/> or
|
---|
112 | <xref linkend="python3"/>,
|
---|
113 | <xref linkend="qemu"/>,
|
---|
114 | <xref linkend="valgrind"/>,
|
---|
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>,
|
---|
118 | <ulink url="https://www.gnu.org/software/libmicrohttpd/">libmicrohttpd</ulink>,
|
---|
119 | <ulink url="http://sourceforge.net/projects/libseccomp/">libseccomp</ulink>,
|
---|
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>
|
---|
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 |
|
---|
142 | <bridgehead renderas="sect4">Optional (to rebuild the manual pages)</bridgehead>
|
---|
143 | <para role="optional">
|
---|
144 | <xref linkend="DocBook"/>,
|
---|
145 | <xref linkend="docbook-xsl"/> and
|
---|
146 | <xref linkend="libxslt"/>
|
---|
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 |
|
---|
161 | <screen><userinput>patch -Np1 -i ../systemd-&lfs-systemd-version;-compat-1.patch &&
|
---|
162 | autoreconf -fi</userinput></screen>
|
---|
163 | <!--
|
---|
164 | <para>
|
---|
165 | Additionally, apply any patch that is also applied in LFS.
|
---|
166 | </para>
|
---|
167 | -->
|
---|
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 |
|
---|
176 | <para>
|
---|
177 | Rebuild <application>systemd</application> by running the
|
---|
178 | following commands:
|
---|
179 | </para>
|
---|
180 |
|
---|
181 | <screen><userinput>cc_cv_CFLAGS__flto=no \
|
---|
182 | ./configure --prefix=/usr \
|
---|
183 | --sysconfdir=/etc \
|
---|
184 | --localstatedir=/var \
|
---|
185 | --with-rootprefix= \
|
---|
186 | --with-rootlibdir=/lib \
|
---|
187 | --enable-split-usr \
|
---|
188 | --disable-firstboot \
|
---|
189 | --disable-ldconfig \
|
---|
190 | --disable-sysusers \
|
---|
191 | --without-python \
|
---|
192 | --docdir=/usr/share/doc/systemd-&lfs-systemd-version; &&
|
---|
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
|
---|
216 | <systemitem class="username">root</systemitem> user from a TTY:
|
---|
217 | </para>
|
---|
218 |
|
---|
219 | <screen role="root"><userinput>systemctl start rescue.target</userinput></screen>
|
---|
220 | </warning>
|
---|
221 |
|
---|
222 | <para>
|
---|
223 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
224 | </para>
|
---|
225 |
|
---|
226 | <screen role="root"><userinput>make install</userinput></screen>
|
---|
227 |
|
---|
228 | <para>
|
---|
229 | Move NSS libraries to <filename class="directory">/lib</filename>
|
---|
230 | by running the following command as the <systemitem
|
---|
231 | class="username">root</systemitem> user:
|
---|
232 | </para>
|
---|
233 |
|
---|
234 | <screen role="root"><userinput>mv -v /usr/lib/libnss_{myhostname,mymachines,resolve}.so.2 /lib</userinput></screen>
|
---|
235 |
|
---|
236 | <para>
|
---|
237 | Remove an unnecessary directory by running the following command
|
---|
238 | as the <systemitem class="username">root</systemitem> user:
|
---|
239 | </para>
|
---|
240 |
|
---|
241 | <screen role="root"><userinput>rm -rfv /usr/lib/rpm</userinput></screen>
|
---|
242 |
|
---|
243 | <para>
|
---|
244 | Remove a reference to a non-existent group by running the following
|
---|
245 | command as the <systemitem class="username">root</systemitem> user:
|
---|
246 | </para>
|
---|
247 |
|
---|
248 | <screen role="root"><userinput>sed -i "s:0775 root lock:0755 root root:g" /usr/lib/tmpfiles.d/legacy.conf</userinput></screen>
|
---|
249 |
|
---|
250 | </sect2>
|
---|
251 |
|
---|
252 | <sect2 role="configuration">
|
---|
253 | <title>Configuring systemd</title>
|
---|
254 |
|
---|
255 | <para>
|
---|
256 | The <filename>/etc/pam.d/system-sesion</filename> file needs to
|
---|
257 | be modified and a new file needs to be created in order for
|
---|
258 | <command>systemd-logind</command> to work correctly. To accomplish
|
---|
259 | that, run the following commands as the <systemitem
|
---|
260 | class="username">root</systemitem> user:
|
---|
261 | </para>
|
---|
262 |
|
---|
263 | <screen role="root"><userinput>cat >> /etc/pam.d/system-session << "EOF" &&
|
---|
264 | <literal># Begin Systemd addition
|
---|
265 |
|
---|
266 | session required pam_loginuid.so
|
---|
267 | session optional pam_systemd.so
|
---|
268 |
|
---|
269 | # End Systemd addition</literal>
|
---|
270 | EOF
|
---|
271 |
|
---|
272 | cat > /etc/pam.d/systemd-user << "EOF"
|
---|
273 | <literal># Begin /etc/pam.d/systemd-user
|
---|
274 |
|
---|
275 | account required pam_access.so
|
---|
276 | account include system-account
|
---|
277 |
|
---|
278 | session required pam_env.so
|
---|
279 | session required pam_limits.so
|
---|
280 | session include system-session
|
---|
281 |
|
---|
282 | auth required pam_deny.so
|
---|
283 | password required pam_deny.so
|
---|
284 |
|
---|
285 | # End /etc/pam.d/systemd-user</literal>
|
---|
286 | EOF</userinput></screen>
|
---|
287 |
|
---|
288 | <para>
|
---|
289 | At this point it would be a nice idea to reboot to
|
---|
290 | test if the reinstallation was successful.
|
---|
291 | </para>
|
---|
292 |
|
---|
293 | </sect2>
|
---|
294 |
|
---|
295 | <sect2 role="content">
|
---|
296 | <title>Contents</title>
|
---|
297 |
|
---|
298 | <para>
|
---|
299 | A list of the installed files, along with their short
|
---|
300 | descriptions can be found at
|
---|
301 | <ulink url="&lfs-root;/chapter06/systemd.html#contents-systemd"/>.
|
---|
302 | </para>
|
---|
303 |
|
---|
304 | <para>
|
---|
305 | Below are listed newly installed libraries and directories
|
---|
306 | along with short descriptions.
|
---|
307 | </para>
|
---|
308 |
|
---|
309 | <segmentedlist>
|
---|
310 | <segtitle>Installed Programs</segtitle>
|
---|
311 | <segtitle>Installed Libraries</segtitle>
|
---|
312 | <segtitle>Installed Directories</segtitle>
|
---|
313 |
|
---|
314 | <seglistitem>
|
---|
315 | <seg>
|
---|
316 | None
|
---|
317 | </seg>
|
---|
318 | <seg>
|
---|
319 | pam_systemd.so
|
---|
320 | (in <filename class="directory">/lib/security</filename>)
|
---|
321 | </seg>
|
---|
322 | <seg>
|
---|
323 | None
|
---|
324 | </seg>
|
---|
325 | </seglistitem>
|
---|
326 | </segmentedlist>
|
---|
327 |
|
---|
328 | <variablelist>
|
---|
329 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
330 | <?dbfo list-presentation="list"?>
|
---|
331 | <?dbhtml list-presentation="table"?>
|
---|
332 |
|
---|
333 | <varlistentry id="pam_systemd">
|
---|
334 | <term><filename class="libraryfile">pam_systemd.so</filename></term>
|
---|
335 | <listitem>
|
---|
336 | <para>
|
---|
337 | is a PAM module used to register user sessions with the
|
---|
338 | <application>systemd</application> login manager,
|
---|
339 | <command>systemd-logind</command>.
|
---|
340 | </para>
|
---|
341 | <indexterm zone="systemd pam_systemd">
|
---|
342 | <primary sortas="c-pam_systemd">pam_systemd.so</primary>
|
---|
343 | </indexterm>
|
---|
344 | </listitem>
|
---|
345 | </varlistentry>
|
---|
346 |
|
---|
347 | </variablelist>
|
---|
348 |
|
---|
349 | </sect2>
|
---|
350 |
|
---|
351 | </sect1>
|
---|