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://www.freedesktop.org/software/systemd/">
|
---|
8 | <!ENTITY systemd-patch-download-http "http://www.linuxfromscratch.org/patches/downloads/systemd/">
|
---|
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</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 | There are two reasons why <application>systemd</application>
|
---|
37 | needs to be rebuilt. Some packages require GUdev library to
|
---|
38 | be present in order to compile while others expect working
|
---|
39 | <command>systemd-logind</command> service in order to work
|
---|
40 | properly. To build the GUdev library, make sure that you have
|
---|
41 | installed first set of required dependencies. In order to get
|
---|
42 | <command>systemd-logind</command> to work properly, make sure
|
---|
43 | that you have installed second set of required dependencies.
|
---|
44 | </para>
|
---|
45 |
|
---|
46 | <para>
|
---|
47 | Unlike other packages in BLFS, there is no set version of
|
---|
48 | <application>systemd</application> in this page's title and
|
---|
49 | no set version specified for download. Version updates to
|
---|
50 | <application>systemd</application> make it possible that the
|
---|
51 | user's system may have a <application>systemd</application>
|
---|
52 | version different from the one in the current LFS book.
|
---|
53 | Therefore, users should use the version of
|
---|
54 | <application>systemd</application> that is currently
|
---|
55 | installed on their system.
|
---|
56 | </para>
|
---|
57 |
|
---|
58 | <para>
|
---|
59 | This package is known to build and work properly using an
|
---|
60 | LFS-7.6 systemd platform using systemd-216 source.
|
---|
61 | </para>
|
---|
62 |
|
---|
63 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
64 | <itemizedlist spacing="compact">
|
---|
65 | <listitem>
|
---|
66 | <para>Systemd Download (HTTP): <ulink url="&systemd-download-http;"/></para>
|
---|
67 | </listitem>
|
---|
68 | <listitem>
|
---|
69 | <para>Systemd Patch Download (HTTP): <ulink url="&systemd-patch-download-http;"/></para>
|
---|
70 | </listitem>
|
---|
71 | </itemizedlist>
|
---|
72 |
|
---|
73 | <para>
|
---|
74 | Make sure you download the "compat" patch whose version matches
|
---|
75 | the <application>systemd</application> version you are building.
|
---|
76 | </para>
|
---|
77 |
|
---|
78 | <note>
|
---|
79 | <para>
|
---|
80 | If you are unsure which version needs to be downloaded, issue
|
---|
81 | <command>systemctl --version</command> in order to find out.
|
---|
82 | Some of the commands below might need the version information.
|
---|
83 | Issue the following command to store the
|
---|
84 | <application>systemd</application> version number into an
|
---|
85 | environment variable:
|
---|
86 | </para>
|
---|
87 |
|
---|
88 | <screen><userinput>export SYSTEMD_VERSION=$(systemctl --version | head -n1 | awk '{print $2}')</userinput></screen>
|
---|
89 | </note>
|
---|
90 |
|
---|
91 | <bridgehead renderas="sect3">systemd Dependencies</bridgehead>
|
---|
92 |
|
---|
93 | <bridgehead renderas="sect4">Required (GUdev)</bridgehead>
|
---|
94 | <para role="required">
|
---|
95 | <xref linkend="glib2"/> and
|
---|
96 | <xref linkend="gobject-introspection"/>
|
---|
97 | </para>
|
---|
98 |
|
---|
99 | <bridgehead renderas="sect4">Required (Logind)</bridgehead>
|
---|
100 | <para role="required">
|
---|
101 | <xref linkend="linux-pam"/>
|
---|
102 | </para>
|
---|
103 |
|
---|
104 | <bridgehead renderas="sect4">Recommended Runtime Dependency</bridgehead>
|
---|
105 | <para role="recommended">
|
---|
106 | <xref linkend="polkit"/>
|
---|
107 | </para>
|
---|
108 |
|
---|
109 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
110 | <para role="optional">
|
---|
111 | <xref linkend="curl"/>,
|
---|
112 | <xref linkend="elfutils"/>,
|
---|
113 | <xref linkend="gnutls"/>,
|
---|
114 | <xref linkend="gtk-doc"/>,
|
---|
115 | <xref linkend="libgcrypt"/>,
|
---|
116 | <xref linkend="libidn"/>,
|
---|
117 | <xref linkend="python3"/>,
|
---|
118 | <xref linkend="valgrind"/>,
|
---|
119 | <ulink url="https://code.google.com/p/cryptsetup/">cryptsetup</ulink>,
|
---|
120 | <ulink url="https://www.gnu.org/software/libmicrohttpd/">libmicrohttpd</ulink>,
|
---|
121 | <ulink url="http://fukuchi.org/works/qrencode/">libqrencode</ulink>,
|
---|
122 | <ulink url="http://sourceforge.net/projects/libseccomp/">libseccomp</ulink>,
|
---|
123 | <ulink url="http://lxml.de/">lxml</ulink> (Python Module), and
|
---|
124 | <ulink url="https://code.google.com/p/lz4/">lz4</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 (for rebuilding manual pages)</bridgehead>
|
---|
143 | <para role="optional">
|
---|
144 | <xref linkend="libxslt"/>,
|
---|
145 | <xref linkend="DocBook"/>, and
|
---|
146 | <xref linkend="docbook-xsl"/>
|
---|
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-${SYSTEMD_VERSION}-compat-1.patch</userinput></screen>
|
---|
162 |
|
---|
163 | <para>
|
---|
164 | Rebuild <application>systemd</application> by running the
|
---|
165 | following commands:
|
---|
166 | </para>
|
---|
167 |
|
---|
168 | <screen><userinput>cc_cv_CFLAGS__flto=no \
|
---|
169 | ./configure --prefix=/usr \
|
---|
170 | --sysconfdir=/etc \
|
---|
171 | --localstatedir=/var \
|
---|
172 | --with-rootprefix= \
|
---|
173 | --with-rootlibdir=/lib \
|
---|
174 | --enable-split-usr \
|
---|
175 | --disable-firstboot \
|
---|
176 | --disable-ldconfig \
|
---|
177 | --disable-sysusers \
|
---|
178 | --docdir=/usr/share/doc/systemd-${SYSTEMD_VERSION} &&
|
---|
179 | make</userinput></screen>
|
---|
180 |
|
---|
181 | <note>
|
---|
182 | <para>
|
---|
183 | For the best results, make sure you run the testsuite from
|
---|
184 | a system that is booted by the same
|
---|
185 | <application>systemd</application> version you are rebuilding.
|
---|
186 | </para>
|
---|
187 | </note>
|
---|
188 |
|
---|
189 | <para>
|
---|
190 | To test the results, issue: <command>make -k check</command>.
|
---|
191 | </para>
|
---|
192 |
|
---|
193 | <warning>
|
---|
194 | <para>
|
---|
195 | Installing the package will override all files installed by
|
---|
196 | <application>systemd</application> in LFS. It is critical that
|
---|
197 | nothing uses either <application>systemd</application> or
|
---|
198 | <application>Udev</application> libraries or programs during
|
---|
199 | the installation phrase. Best way to achieve that is to do the
|
---|
200 | installation in the rescue mode. To switch to the rescue mode,
|
---|
201 | issue the following command as the
|
---|
202 | <systemitem class="username">root</systemitem> user from a TTY:
|
---|
203 | </para>
|
---|
204 |
|
---|
205 | <screen role="root"><userinput>systemctl start rescue.target</userinput></screen>
|
---|
206 | </warning>
|
---|
207 |
|
---|
208 | <para>
|
---|
209 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
210 | </para>
|
---|
211 |
|
---|
212 | <screen role="root"><userinput>make install</userinput></screen>
|
---|
213 |
|
---|
214 | <para>
|
---|
215 | Move NSS libraries to <filename class="directory">/lib</filename>
|
---|
216 | by running the following command as the <systemitem
|
---|
217 | class="username">root</systemitem> user:
|
---|
218 | </para>
|
---|
219 |
|
---|
220 | <screen role="root"><userinput>mv -v /usr/lib/libnss_{myhostname,mymachines,resolve}.so.2 /lib</userinput></screen>
|
---|
221 |
|
---|
222 | <para>
|
---|
223 | Remove an unnecessary directory by running the following command
|
---|
224 | as the <systemitem class="username">root</systemitem> user:
|
---|
225 | </para>
|
---|
226 |
|
---|
227 | <screen role="root"><userinput>rm -rfv /usr/lib/rpm</userinput></screen>
|
---|
228 |
|
---|
229 | <para>
|
---|
230 | Remove a reference to a non-existent group by running the following
|
---|
231 | command as the <systemitem class="username">root</systemitem> user:
|
---|
232 | </para>
|
---|
233 |
|
---|
234 | <screen role="root"><userinput>sed -i "s:0775 root lock:0755 root root:g" /usr/lib/tmpfiles.d/legacy.conf</userinput></screen>
|
---|
235 |
|
---|
236 | </sect2>
|
---|
237 |
|
---|
238 | <sect2 role="configuration">
|
---|
239 | <title>Configuring systemd</title>
|
---|
240 |
|
---|
241 | <para>
|
---|
242 | If the <application>systemd</application> PAM module was built,
|
---|
243 | the <filename>/etc/pam.d/system-sesion</filename> file needs to
|
---|
244 | be modified and a new file needs to be created in order for
|
---|
245 | <command>systemd-logind</command> to work correctly. To accomplish
|
---|
246 | that, run the following commands as the <systemitem
|
---|
247 | class="username">root</systemitem> user:
|
---|
248 | </para>
|
---|
249 |
|
---|
250 | <screen role="root"><userinput>cat >> /etc/pam.d/system-session << "EOF"
|
---|
251 | <literal># Begin Systemd addition
|
---|
252 |
|
---|
253 | session required pam_loginuid.so
|
---|
254 | -session optional pam_systemd.so
|
---|
255 |
|
---|
256 | # End Systemd addition</literal>
|
---|
257 | EOF
|
---|
258 |
|
---|
259 | cat > /etc/pam.d/systemd-user << "EOF"
|
---|
260 | <literal># Begin /etc/pam.d/systemd-user
|
---|
261 |
|
---|
262 | account required pam_access.so
|
---|
263 | account include system-account
|
---|
264 |
|
---|
265 | session required pam_env.so
|
---|
266 | session required pam_limits.so
|
---|
267 | session include system-session
|
---|
268 |
|
---|
269 | auth required pam_deny.so
|
---|
270 | password required pam_deny.so
|
---|
271 |
|
---|
272 | # End /etc/pam.d/systemd-user</literal>
|
---|
273 | EOF</userinput></screen>
|
---|
274 |
|
---|
275 | <para>
|
---|
276 | At this point it would be a nice idea to reboot to
|
---|
277 | test if the reinstallation was sucessful.
|
---|
278 | </para>
|
---|
279 |
|
---|
280 | </sect2>
|
---|
281 |
|
---|
282 | <sect2 role="content">
|
---|
283 | <title>Contents</title>
|
---|
284 |
|
---|
285 | <para>
|
---|
286 | A list of the installed files, along with their short
|
---|
287 | descriptions can be found at
|
---|
288 | <ulink url="&lfs-root;/chapter06/systemd.html#contents-systemd"/>.
|
---|
289 | </para>
|
---|
290 |
|
---|
291 | <para>
|
---|
292 | Below are listed newly installed libraries and directories
|
---|
293 | along with short descriptions.
|
---|
294 | </para>
|
---|
295 |
|
---|
296 | <segmentedlist>
|
---|
297 | <segtitle>Installed Programs</segtitle>
|
---|
298 | <segtitle>Installed Libraries</segtitle>
|
---|
299 | <segtitle>Installed Directories</segtitle>
|
---|
300 |
|
---|
301 | <seglistitem>
|
---|
302 | <seg>
|
---|
303 | None
|
---|
304 | </seg>
|
---|
305 | <seg>
|
---|
306 | libgudev-1.0.so and pam_systemd.so
|
---|
307 | (in <filename class="directory">/lib/security</filename>)
|
---|
308 | </seg>
|
---|
309 | <seg>
|
---|
310 | /usr/include/gudev-1.0 and
|
---|
311 | /usr/share/gtk-doc/html/gudev
|
---|
312 | </seg>
|
---|
313 | </seglistitem>
|
---|
314 | </segmentedlist>
|
---|
315 |
|
---|
316 | <variablelist>
|
---|
317 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
318 | <?dbfo list-presentation="list"?>
|
---|
319 | <?dbhtml list-presentation="table"?>
|
---|
320 |
|
---|
321 | <varlistentry id="libgudev-1.0">
|
---|
322 | <term><filename class="libraryfile">libgudev-1.0.so</filename></term>
|
---|
323 | <listitem>
|
---|
324 | <para>
|
---|
325 | is a GObject-based wrapper library for libudev.
|
---|
326 | </para>
|
---|
327 | <indexterm zone="systemd libgudev-1.0">
|
---|
328 | <primary sortas="c-libgudev-1.0">libgudev-1.0.so</primary>
|
---|
329 | </indexterm>
|
---|
330 | </listitem>
|
---|
331 | </varlistentry>
|
---|
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>
|
---|