mirror of
https://github.com/Zeckmathederg/glfs.git
synced 2025-01-31 20:42:34 +08:00
7829562994
git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@18320 af4574ff-66df-0310-9fd7-8a98e5e911e0
306 lines
9.9 KiB
XML
306 lines
9.9 KiB
XML
<?xml version="1.0" encoding="ISO-8859-1"?>
|
|
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
|
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
|
<!ENTITY % general-entities SYSTEM "../../general.ent">
|
|
%general-entities;
|
|
|
|
<!ENTITY systemd-download-http "http://anduin.linuxfromscratch.org/sources/other/systemd/systemd-&systemd-version;.tar.xz">
|
|
<!ENTITY systemd-download-ftp " ">
|
|
<!ENTITY systemd-md5sum "281604885d5a87f0359244f6f84037cb">
|
|
<!ENTITY systemd-size "3.9 MB">
|
|
<!ENTITY systemd-buildsize "429 MB (an additional 89 MB for tests)">
|
|
<!ENTITY systemd-time "7.7 SBU (an additional 0.5 SBU for tests)">
|
|
|
|
]>
|
|
|
|
<sect1 id="systemd" xreflabel="Systemd-&systemd-version;" revision="systemd">
|
|
<?dbhtml filename="systemd.html"?>
|
|
|
|
<sect1info>
|
|
<othername>$LastChangedBy$</othername>
|
|
<date>$Date$</date>
|
|
</sect1info>
|
|
|
|
<title>Systemd-&systemd-version;</title>
|
|
|
|
<indexterm zone="systemd">
|
|
<primary sortas="a-systemd">systemd</primary>
|
|
</indexterm>
|
|
|
|
<sect2 role="package">
|
|
<title>Introduction to systemd</title>
|
|
|
|
<para>
|
|
While <application>systemd</application> was installed when
|
|
building LFS, there are many features provided by the package that
|
|
were not included in the initial installation because
|
|
<application>Linux-PAM</application> was not yet installed.
|
|
The <application>systemd</application> package needs to be
|
|
rebuilt to provide a working <command>systemd-logind</command> service,
|
|
which provides many additional features for dependent packages.
|
|
</para>
|
|
|
|
&lfs80_checked;
|
|
|
|
<bridgehead renderas="sect3">Package Information</bridgehead>
|
|
<itemizedlist spacing="compact">
|
|
<listitem>
|
|
<para>Download (HTTP): <ulink url="&systemd-download-http;"/></para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>Download (FTP): <ulink url="&systemd-download-ftp;"/></para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>Download MD5 sum: &systemd-md5sum;</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>Download size: &systemd-size;</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>Estimated disk space required: &systemd-buildsize;</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>Estimated build time: &systemd-time;</para>
|
|
</listitem>
|
|
</itemizedlist>
|
|
|
|
<bridgehead renderas="sect3">systemd Dependencies</bridgehead>
|
|
|
|
<bridgehead renderas="sect4">Required</bridgehead>
|
|
<para role="required">
|
|
<xref linkend="linux-pam"/>
|
|
</para>
|
|
|
|
<bridgehead renderas="sect4">Recommended Runtime Dependency</bridgehead>
|
|
<para role="recommended">
|
|
<xref linkend="polkit"/> and <xref linkend="python3"/> <!-- hwdb -->
|
|
</para>
|
|
|
|
<bridgehead renderas="sect4">Optional</bridgehead>
|
|
<para role="optional">
|
|
<xref linkend="cacerts"/>,
|
|
<xref linkend="curl"/>,
|
|
<xref linkend="elfutils"/>,
|
|
<xref linkend="gnutls"/>,
|
|
<xref linkend="iptables"/>,
|
|
<xref linkend="libgcrypt"/>,
|
|
<xref linkend="libidn"/>,
|
|
<xref linkend="libxkbcommon"/>,
|
|
<xref linkend="qemu"/>,
|
|
<xref linkend="valgrind"/>,
|
|
<xref linkend="zsh"/> (for the zsh completions),
|
|
<ulink url="https://www.kernel.org/pub/linux/utils/cryptsetup/">cryptsetup</ulink>,
|
|
<ulink url="http://sourceforge.net/projects/gnu-efi/">gnu-efi</ulink>,
|
|
<ulink url="https://www.kernel.org/pub/linux/utils/kernel/kexec/">kexec-tools</ulink>,
|
|
<ulink url="https://www.gnu.org/software/libmicrohttpd/">libmicrohttpd</ulink>,
|
|
<ulink url="http://sourceforge.net/projects/libseccomp/">libseccomp</ulink>,
|
|
<ulink url="https://github.com/Cyan4973/lz4">lz4</ulink>,
|
|
<ulink url="http://fukuchi.org/works/qrencode/">qrencode</ulink>,
|
|
<ulink url="http://sourceforge.net/projects/linuxquota/">quota-tools</ulink> and
|
|
<ulink url="https://pypi.python.org/pypi/Sphinx">Sphinx</ulink>
|
|
</para>
|
|
|
|
<bridgehead renderas="sect4">Optional (to rebuild the manual pages)</bridgehead>
|
|
<para role="optional">
|
|
<xref linkend="DocBook"/>,
|
|
<xref linkend="docbook-xsl"/> and
|
|
<xref linkend="libxslt"/>
|
|
</para>
|
|
|
|
<para condition="html" role="usernotes">User Notes:
|
|
<ulink url="&blfs-wiki;/systemd"/>
|
|
</para>
|
|
</sect2>
|
|
|
|
<sect2 role="installation">
|
|
<title>Installation of systemd</title>
|
|
|
|
<!-- Not needed as of v231 -renodr
|
|
<para>First, fix a potential security issue with framebuffer
|
|
devices:</para>
|
|
|
|
<screen><userinput>sed -e 's@DRI and frame buffer@DRI@' \
|
|
-e '/SUBSYSTEM==\"graphics\", KERNEL==\"fb\*\"/d' \
|
|
-i src/login/70-uaccess.rules</userinput></screen>
|
|
-->
|
|
|
|
<para>
|
|
Disable two tests that always fail:
|
|
</para>
|
|
|
|
<screen><userinput>sed -e 's:test/udev-test.pl ::g' \
|
|
-e 's:test-copy$(EXEEXT) ::g' \
|
|
-i Makefile.in</userinput></screen>
|
|
|
|
<para>
|
|
Rebuild <application>systemd</application> by running the
|
|
following commands:
|
|
</para>
|
|
|
|
<screen><userinput>cc_cv_CFLAGS__flto=no \
|
|
XSLTPROC="/usr/bin/xsltproc" \
|
|
./configure --prefix=/usr \
|
|
--sysconfdir=/etc \
|
|
--localstatedir=/var \
|
|
--with-rootprefix= \
|
|
--with-rootlibdir=/lib \
|
|
--enable-split-usr \
|
|
--disable-firstboot \
|
|
--disable-ldconfig \
|
|
--disable-sysusers \
|
|
--without-python \
|
|
--with-default-dnssec=no \
|
|
--docdir=/usr/share/doc/systemd-&systemd-version; &&
|
|
make</userinput></screen>
|
|
|
|
<note>
|
|
<para>
|
|
For the best results, make sure you run the testsuite from
|
|
a system that is booted by the same
|
|
<application>systemd</application> version you are rebuilding.
|
|
</para>
|
|
</note>
|
|
|
|
<para>
|
|
To test the results, issue: <command>make -k check</command>.
|
|
</para>
|
|
|
|
<warning>
|
|
<para>
|
|
Installing the package will overwrite all files installed by
|
|
<application>systemd</application> in LFS. It is critical that
|
|
nothing uses either <application>systemd</application> or
|
|
<application>Udev</application> libraries during the installation.
|
|
The best way to ensure that these libraries are not being used is to
|
|
run the installation in rescue mode. To switch to rescue mode,
|
|
run the following command as the
|
|
<systemitem class="username">root</systemitem> user (from a TTY):
|
|
</para>
|
|
|
|
<screen role="root"><userinput>systemctl start rescue.target</userinput></screen>
|
|
</warning>
|
|
|
|
<para>
|
|
Now, as the <systemitem class="username">root</systemitem> user:
|
|
</para>
|
|
|
|
<screen role="root"><userinput>make install</userinput></screen>
|
|
|
|
<para>
|
|
If <application>RPM</application> is not installed, remove an
|
|
unnecessary directory by running the following command as the
|
|
<systemitem class="username">root</systemitem> user:
|
|
</para>
|
|
|
|
<screen role="root"><userinput>rm -rfv /usr/lib/rpm</userinput></screen>
|
|
|
|
</sect2>
|
|
|
|
<sect2 role="configuration">
|
|
<title>Configuring systemd</title>
|
|
|
|
<para>
|
|
The <filename>/etc/pam.d/system-sesion</filename> file needs to
|
|
be modified and a new file needs to be created in order for
|
|
<command>systemd-logind</command> to work correctly. Run the following
|
|
commands as the <systemitem class="username">root</systemitem> user:
|
|
</para>
|
|
|
|
<screen role="root"><userinput>cat >> /etc/pam.d/system-session << "EOF"
|
|
<literal># Begin Systemd addition
|
|
|
|
session required pam_loginuid.so
|
|
session optional pam_systemd.so
|
|
|
|
# End Systemd addition</literal>
|
|
EOF
|
|
|
|
cat > /etc/pam.d/systemd-user << "EOF"
|
|
<literal># Begin /etc/pam.d/systemd-user
|
|
|
|
account required pam_access.so
|
|
account include system-account
|
|
|
|
session required pam_env.so
|
|
session required pam_limits.so
|
|
session include system-session
|
|
|
|
auth required pam_deny.so
|
|
password required pam_deny.so
|
|
|
|
# End /etc/pam.d/systemd-user</literal>
|
|
EOF</userinput></screen>
|
|
|
|
<para>
|
|
At this point, you should reload the systemd daemon, and reenter
|
|
multi-user mode with the following commands (as the
|
|
<systemitem class="username">root</systemitem> user):
|
|
</para>
|
|
|
|
<screen role="root"><userinput>systemctl daemon-reload
|
|
systemctl start multi-user.target</userinput></screen>
|
|
|
|
<warning><para>If upgrading from a previous version of systemd and an
|
|
initrd is used for system boot, you should generate a new initrd before
|
|
rebooting the system.</para></warning>
|
|
|
|
</sect2>
|
|
|
|
<sect2 role="content">
|
|
<title>Contents</title>
|
|
|
|
<para>
|
|
A list of the installed files, along with their short
|
|
descriptions can be found at
|
|
<ulink url="&lfs-root;/chapter06/systemd.html#contents-systemd"/>.
|
|
</para>
|
|
|
|
<para>
|
|
Listed below are the newly installed libraries and directories
|
|
along with short descriptions.
|
|
</para>
|
|
|
|
<segmentedlist>
|
|
<segtitle>Installed Programs</segtitle>
|
|
<segtitle>Installed Libraries</segtitle>
|
|
<segtitle>Installed Directories</segtitle>
|
|
|
|
<seglistitem>
|
|
<seg>
|
|
None
|
|
</seg>
|
|
<seg>
|
|
pam_systemd.so
|
|
(in <filename class="directory">/lib/security</filename>)
|
|
</seg>
|
|
<seg>
|
|
None
|
|
</seg>
|
|
</seglistitem>
|
|
</segmentedlist>
|
|
|
|
<variablelist>
|
|
<bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
|
<?dbfo list-presentation="list"?>
|
|
<?dbhtml list-presentation="table"?>
|
|
|
|
<varlistentry id="pam_systemd">
|
|
<term><filename class="libraryfile">pam_systemd.so</filename></term>
|
|
<listitem>
|
|
<para>
|
|
is a PAM module used to register user sessions with the
|
|
<application>systemd</application> login manager,
|
|
<command>systemd-logind</command>.
|
|
</para>
|
|
<indexterm zone="systemd pam_systemd">
|
|
<primary sortas="c-pam_systemd">pam_systemd.so</primary>
|
|
</indexterm>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</sect2>
|
|
|
|
</sect1>
|