Ignore:
Timestamp:
09/24/2017 07:04:44 AM (7 years ago)
Author:
DJ Lucas <dj@…>
Branches:
10.0, 10.0-rc1, 10.1, 10.1-rc1, 11.0, 11.0-rc1, 11.0-rc2, 11.0-rc3, 11.1, 11.1-rc1, 11.2, 11.2-rc1, 11.3, 11.3-rc1, 12.0, 12.0-rc1, 12.1, 12.1-rc1, 8.2, 8.3, 8.4, 9.0, 9.1, arm, bdubbs/gcc13, ml-11.0, multilib, renodr/libudev-from-systemd, s6-init, trunk, xry111/arm64, xry111/arm64-12.0, xry111/clfs-ng, xry111/lfs-next, xry111/loongarch, xry111/loongarch-12.0, xry111/loongarch-12.1, xry111/mips64el, xry111/pip3, xry111/rust-wip-20221008, xry111/update-glibc
Children:
7886729e
Parents:
f682fb5f
Message:

Use upstream systemd tarball with meson build system and supply only prebuilt man pages.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@11306 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chapter06/systemd.xml

    rf682fb5f r81ed05f  
    4141    <title>Installation of systemd</title>
    4242
    43     <para>Create a file to allow systemd to build when using Util-Linux
    44     built in Chapter 5, to disable LTO by default, and to build without
    45     xlstproc:</para>
    46 
    47 <screen><userinput remap="pre">cat &gt; config.cache &lt;&lt; "EOF"
    48 <literal>KILL=/bin/kill
    49 MOUNT_PATH=/bin/mount
    50 UMOUNT_PATH=/bin/umount
    51 HAVE_BLKID=1
    52 BLKID_LIBS="-lblkid"
    53 BLKID_CFLAGS="-I/tools/include/blkid"
    54 HAVE_LIBMOUNT=1
    55 MOUNT_LIBS="-lmount"
    56 MOUNT_CFLAGS="-I/tools/include/libmount"
    57 cc_cv_CFLAGS__flto=no
    58 SULOGIN="/sbin/sulogin"
    59 GPERF_LEN_TYPE=size_t
    60 XSLTPROC="/usr/bin/xsltproc"</literal>
    61 EOF</userinput></screen>
    62 
    63     <para>LTO is disabled by default because it causes
    64     <command>systemd</command> and other auxiliary programs to link to
    65     <filename class="libraryfile">libgcc_s.so</filename>, slows the build down
    66     and makes the compiled code larger.</para>
     43    <para>Create a symlink to work around missing xsltproc:</para>
     44
     45<screen><userinput remap="pre">ln -s /tools/bin/true /usr/bin/xsltproc</userinput></screen>
    6746
    6847    <para>Prepare systemd for compilation:</para>
    6948
    70 <screen><userinput remap="configure">./configure --prefix=/usr            \
    71             --sysconfdir=/etc        \
    72             --localstatedir=/var     \
    73             --config-cache           \
    74             --with-rootprefix=       \
    75             --with-rootlibdir=/lib   \
    76             --enable-split-usr       \
    77             --disable-firstboot      \
    78             --disable-ldconfig       \
    79             --disable-sysusers       \
    80             --without-python         \
    81             --with-default-dnssec=no \
    82             --docdir=/usr/share/doc/systemd-&systemd-version;</userinput></screen>
     49<screen><userinput remap="configure">PKG_CONFIG_PATH=/usr/lib/pkgconfig:/tools/lib/pkgconfig \
     50LANG=en_US.UTF-8                          \
     51    meson --prefix /usr                   \
     52          --sysconfdir /etc               \
     53          --localstatedir /var            \
     54          -Dblkid=true                    \
     55          -Dbuildtype=release             \
     56          -Ddefault-dnssec=no             \
     57          -Dfirstboot=false               \
     58          -Dkill-path=/bin/kill           \
     59          -Dkmod-path=/bin/kmod           \
     60          -Dldconfig=false                \
     61          -Dmount-path=/bin/mount         \
     62          -Drootprefix=                   \
     63          -Drootlibdir=/lib               \
     64          -Dsplit-usr=true                \
     65          -Dsulogin-path=/sbin/sulogin    \
     66          -Dsysusers=false                \
     67          -Dumount-path=/bin/umount       \
     68          -Db_lto=false                   \
     69          -Dc_link_args="-lblkid -lmount" \
     70          -Dc_args="-I/tools/include/blkid -I/tools/include/libmount" \
     71          $PWD build</userinput></screen>
    8372
    8473    <variablelist>
    85       <title>The meaning of the configure options:</title>
    86 
    87       <varlistentry>
    88         <term><parameter>--config-cache</parameter></term>
    89         <listitem>
    90           <para>This switch tells the build system to use
    91           the <filename>config.cache</filename> file which
    92           was created earlier.</para>
    93         </listitem>
    94       </varlistentry>
    95 
    96       <varlistentry>
    97         <term><parameter>--with-root*</parameter></term>
    98         <listitem>
    99           <para>These switches ensure that core programs and
    100           shared libraries are installed in the subdirectories
    101           of the root partition.</para>
    102         </listitem>
    103       </varlistentry>
    104 
    105       <varlistentry>
    106         <term><parameter>--enable-split-usr</parameter></term>
    107         <listitem>
    108           <para>This switch ensures that systemd will work on
    109           systems where /bin, /lib and /sbin directories are not
    110           symlinks to their /usr counterparts.</para>
    111         </listitem>
    112       </varlistentry>
    113 
    114       <varlistentry>
    115         <term><parameter>--without-python</parameter></term>
    116         <listitem>
    117           <para>This switch prevents <command>configure</command>
    118           from trying to use Python which isn't built
    119           in LFS.</para>
    120         </listitem>
    121       </varlistentry>
    122 
    123       <varlistentry>
    124         <term><parameter>--disable-firstboot</parameter></term>
     74      <title>The meaning of the meson options:</title>
     75
     76      <varlistentry>
     77        <term><parameter>-D*-path=*</parameter></term>
     78        <listitem>
     79          <para>These switches provide location of binaries needed by
     80          systemd at runtime that have not yet been installed, or who's
     81          pkgconfig files are currently only in
     82          <filename>/tools/lib/pkgconfig</filename>.</para>
     83        </listitem>
     84      </varlistentry>
     85
     86      <varlistentry>
     87        <term><parameter>-Ddefault-dnssec=no</parameter></term>
     88        <listitem>
     89          <para>This switch turns off the experimental DNSSEC support.</para>
     90        </listitem>
     91      </varlistentry>
     92
     93      <varlistentry>
     94        <term><parameter>-Dfirstboot=false</parameter></term>
    12595        <listitem>
    12696          <para>This switch prevents installation of systemd
     
    132102
    133103      <varlistentry>
    134         <term><parameter>--disable-ldconfig</parameter></term>
     104        <term><parameter>-Dldconfig=no</parameter></term>
    135105        <listitem>
    136106          <para>This switch prevents installation of a systemd
     
    143113
    144114      <varlistentry>
    145         <term><parameter>--disable-sysusers</parameter></term>
     115        <term><parameter>-Droot*</parameter></term>
     116        <listitem>
     117          <para>These switches ensure that core programs and
     118          shared libraries are installed in the subdirectories
     119          of the root partition.</para>
     120        </listitem>
     121      </varlistentry>
     122
     123      <varlistentry>
     124        <term><parameter>-Dsplit-usr=true</parameter></term>
     125        <listitem>
     126          <para>This switch ensures that systemd will work on
     127          systems where /bin, /lib and /sbin directories are not
     128          symlinks to their /usr counterparts.</para>
     129        </listitem>
     130      </varlistentry>
     131
     132      <varlistentry>
     133        <term><parameter>-Dsysusers=false</parameter></term>
    146134        <listitem>
    147135          <para>This switch prevents installation of systemd
     
    154142
    155143      <varlistentry>
    156         <term><parameter>--with-default-dnssec=no</parameter></term>
    157         <listitem>
    158           <para>This switch turns off the experimental DNSSEC support.</para>
     144        <term><parameter>-Dc_link_args="-lblkid -lmount"</parameter></term>
     145        <listitem>
     146          <para>This switch manually adds libblkid and libmount to the
     147          linker flags as they only exist in <filename>/tools/lib</filename>
     148          until <application>Util-Linux</application> is installed later in
     149          this chapter.</para>
     150        </listitem>
     151      </varlistentry>
     152
     153      <varlistentry>
     154        <term><parameter>-Dc_args="-I/tools/include/blkid -I/tools/include/libmount"</parameter></term>
     155        <listitem>
     156          <para>This switch manually adds the include paths for libblkid and
     157          libmount to the CFLAGS variable as the packages are not yet installed
     158          in the final system.</para>
    159159        </listitem>
    160160      </varlistentry>
     
    164164    <para>Compile the package:</para>
    165165
    166 <screen><userinput remap="make">make</userinput></screen>
    167 
    168     <para>This package has a test suite, but it can only be run after the
    169     package has been reinstalled in BLFS.</para>
    170 
     166<screen><userinput remap="make">tar -xf ../systemd-man-pages-&systemd-version;.tar.xz
     167cd build
     168LANG=en_US.UTF-8 ninja</userinput></screen>
     169<!--
     170    <para>To test the package, execute the following command:</para>
     171
     172<screen><userinput remap="test">LANG=en_US.UTF-8 ninja test</userinput></screen>
     173-->
    171174    <para>Install the package:</para>
    172175
    173 <screen><userinput remap="install">make install</userinput></screen>
    174 
    175 <!-- These get installed into /lib now by default.
    176     <para>Move the NSS libraries to <filename class="directory">/lib</filename>:</para>
    177 
    178 <screen><userinput remap="install">mv -v /usr/lib/libnss_{myhostname,mymachines,resolve}.so.2 /lib</userinput></screen>
    179 -->
     176<screen><userinput remap="install">LANG=en_US.UTF-8 ninja install</userinput></screen>
    180177
    181178    <para>Remove an unnecessary directory:</para>
     
    190187done
    191188ln -sfv ../lib/systemd/systemd /sbin/init</userinput></screen>
     189
     190    <para>Remove our earlier created symlink for xsltproc:</para>
     191
     192<screen><userinput remap="install">rm -f /usr/bin/xsltproc</userinput></screen>
    192193
    193194    <para>Create the <filename>/etc/machine-id</filename> file needed by
Note: See TracChangeset for help on using the changeset viewer.