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