浏览代码

Fix circular deps between util-linux and eudev/systemd:
- build util-linux in chapter 5 for both books
- move eudev before util-linux in chapter 6
- make utils-linux libs and headers accessible to /usr in
"Creating essential ..."
- not related, but forgotten at previous commit: make also libfl flex
library accessible to /usr

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

Pierre Labastie 5 年之前
父节点
当前提交
effe07a910
共有 7 个文件被更改,包括 59 次插入71 次删除
  1. 9 0
      chapter01/changelog.xml
  2. 1 1
      chapter05/util-linux.xml
  3. 3 3
      chapter06/chapter06.xml
  4. 34 25
      chapter06/createfiles.xml
  5. 6 27
      chapter06/eudev.xml
  6. 0 11
      chapter06/systemd.xml
  7. 6 4
      chapter06/util-linux.xml

+ 9 - 0
chapter01/changelog.xml

@@ -45,6 +45,15 @@
     <listitem>
     <listitem>
       <para>2020-04-19</para>
       <para>2020-04-19</para>
       <itemizedlist>
       <itemizedlist>
+        <listitem>
+          <para>[pierre] - Build util-linux in chapter 5 for both books.
+          link util-linux libraries and headers from /usr to /tools.
+          Copy util-linux pkg-config files from /tools to /usr, changing
+          any occurence of /tools to /usr. Also move eudev before util-linux.
+          Fixes <ulink url="&lfs-ticket-root;4637">#4637</ulink>,
+          <ulink url="&lfs-ticket-root;4638">#4638</ulink>, and
+          <ulink url="&lfs-ticket-root;4642">#4642</ulink>.</para>
+        </listitem>
         <listitem>
         <listitem>
           <para>[pierre] - Reinstate flex in chapter 5, so that ar and ranlib
           <para>[pierre] - Reinstate flex in chapter 5, so that ar and ranlib
           (binutils) link against libfl. This allows to run tests for bison,
           (binutils) link against libfl. This allows to run tests for bison,

+ 1 - 1
chapter05/util-linux.xml

@@ -5,7 +5,7 @@
   %general-entities;
   %general-entities;
 ]>
 ]>
 
 
-<sect1 id="ch-tools-util-linux" role="wrap" revision="systemd">
+<sect1 id="ch-tools-util-linux" role="wrap">
   <?dbhtml filename="util-linux.html"?>
   <?dbhtml filename="util-linux.html"?>
 
 
   <sect1info condition="script">
   <sect1info condition="script">

+ 3 - 3
chapter06/chapter06.xml

@@ -88,13 +88,13 @@
   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="systemd.xml"/>
   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="systemd.xml"/>
   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="dbus.xml"/>
   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="dbus.xml"/>
 
 
+  <!-- sysv only -->
+  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="eudev.xml"/>
+
   <!-- Both sysv on systemd builds -->
   <!-- Both sysv on systemd builds -->
   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="procps.xml"/>
   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="procps.xml"/>
   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="util-linux.xml"/>
   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="util-linux.xml"/>
 
 
-  <!-- sysv only -->
-  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="eudev.xml"/>
-
   <!-- Both sysv and systemd builds -->
   <!-- Both sysv and systemd builds -->
   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="e2fsprogs.xml"/>
   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="e2fsprogs.xml"/>
 
 

+ 34 - 25
chapter06/createfiles.xml

@@ -43,21 +43,21 @@
 ln -sv /tools/bin/{env,install,perl,printf}         /usr/bin
 ln -sv /tools/bin/{env,install,perl,printf}         /usr/bin
 ln -sv /tools/lib/libgcc_s.so{,.1}                  /usr/lib
 ln -sv /tools/lib/libgcc_s.so{,.1}                  /usr/lib
 ln -sv /tools/lib/libstdc++.{a,so{,.6}}             /usr/lib
 ln -sv /tools/lib/libstdc++.{a,so{,.6}}             /usr/lib
+ln -sv /tools/lib/libfl.so*                         /usr/lib
 
 
-ln -sv bash /bin/sh</userinput></screen>
+ln -sv bash /bin/sh
 
 
-<!--for lib in blkid lzma mount uuid
+for lib in blkid mount uuid fdisk
 do
 do
     ln -sv /tools/lib/lib$lib.so* /usr/lib
     ln -sv /tools/lib/lib$lib.so* /usr/lib
-done-->
-<!--ln -svf /tools/include/blkid    /usr/include
-ln -svf /tools/include/libmount /usr/include
-ln -svf /tools/include/uuid     /usr/include-->
-<!--for pc in blkid mount uuid
+    sed 's|/tools|/usr|' /tools/lib/pkgconfig/${lib}.pc \
+        &gt; /usr/lib/pkgconfig/${lib}.pc
+done
+for incdir in blkid libmount uuid libfdisk
 do
 do
-    sed 's@tools@usr@g' /tools/lib/pkgconfig/${pc}.pc \
-        > /usr/lib/pkgconfig/${pc}.pc
-done-->
+    ln -svf /tools/include/$incdir    /usr/include
+done</userinput></screen>
+
   <variablelist>
   <variablelist>
     <title>The purpose of each link:</title>
     <title>The purpose of each link:</title>
 
 
@@ -164,30 +164,39 @@ done-->
         for C++ support in GMP.</para>
         for C++ support in GMP.</para>
       </listitem>
       </listitem>
     </varlistentry>
     </varlistentry>
-<!--
+
     <varlistentry>
     <varlistentry>
-      <term><parameter><filename>/usr/lib/libstdc++.la</filename></parameter></term>
+      <term><parameter><filename>/bin/sh</filename></parameter></term>
       <listitem>
       <listitem>
-        <para>This prevents a <filename class="directory">/tools</filename>
-        reference that would otherwise be in
-        <filename>/usr/lib/libstdc++.la</filename> after GCC is installed.</para>
+        <para>Many shell scripts hard-code <filename>/bin/sh</filename>.</para>
       </listitem>
       </listitem>
     </varlistentry>
     </varlistentry>
--->
-    <!--<varlistentry revision="systemd">-->
-<!--    <varlistentry>
-      <term><parameter><filename>/usr/lib/lib{blkid,lzma,mount,uuid}.{a,la,so*}</filename></parameter></term>
+
+    <varlistentry>
+      <term>
+        <parameter><filename>/usr/lib/libfl.so*</filename></parameter>
+      </term>
       <listitem>
       <listitem>
-        <para>These links prevent utilities from acquiring an
-        unnecessary reference to the
-        <filename class="directory">/tools</filename> directory.</para>
+        <para>This link allows binutils to find the flex library, and to
+	build enhanced versions of ar and ranlib.</para>
       </listitem>
       </listitem>
-    </varlistentry>-->
+    </varlistentry>
 
 
     <varlistentry>
     <varlistentry>
-      <term><parameter><filename>/bin/sh</filename></parameter></term>
+      <term>
+        <parameter>
+          <filename>/usr/lib/lib{blkid,fdisk,mount,uuid}.so*</filename>,
+          <filename>/usr/include/{blkid,libfdisk,libmount,uuid}</filename>,
+          <filename>/usr/lib/pkgconfig/{blkid,fdisk,mount,uuid}.pc</filename>
+        </parameter>
+      </term>
       <listitem>
       <listitem>
-        <para>Many shell scripts hard-code <filename>/bin/sh</filename>.</para>
+        <para>These links and files allow
+        <phrase revision="sysv">eudev</phrase>
+        <phrase revision="systemd">systemd</phrase> to find the
+        util-linux libraries installed in chapter 5, without creating
+        wrong references to /tools. The uuid library is also needed for
+        building a python module.</para>
       </listitem>
       </listitem>
     </varlistentry>
     </varlistentry>
 
 

+ 6 - 27
chapter06/eudev.xml

@@ -49,17 +49,8 @@
 
 
 <screen><userinput remap="pre">sed -i '/keyboard_lookup_key/d' src/udev/udev-builtin-keyboard.c</userinput></screen>
 <screen><userinput remap="pre">sed -i '/keyboard_lookup_key/d' src/udev/udev-builtin-keyboard.c</userinput></screen>
 -->
 -->
-<!--
-    <para>First, add a workaround to prevent the /tools directory from being 
-    hard coded into Eudev binary files library locations:</para>
-
-<screen><userinput remap="pre">cat &gt; config.cache &lt;&lt; "EOF"
-HAVE_BLKID=1
-BLKID_LIBS="-lblkid"
-BLKID_CFLAGS="-I/tools/include"
-EOF</userinput></screen>
--->
-<para>Prepare Eudev for compilation:</para>
+
+    <para>Prepare Eudev for compilation:</para>
 
 
 <screen><userinput remap="configure">./configure --prefix=/usr           \
 <screen><userinput remap="configure">./configure --prefix=/usr           \
             --bindir=/sbin          \
             --bindir=/sbin          \
@@ -71,35 +62,24 @@ EOF</userinput></screen>
             --with-rootlibdir=/lib  \
             --with-rootlibdir=/lib  \
             --enable-manpages       \
             --enable-manpages       \
             --disable-static</userinput></screen>
             --disable-static</userinput></screen>
-<!--           - -config-cache</userinput></screen> -->
 
 
-<para>Compile the package:</para>
+    <para>Compile the package:</para>
 
 
 <screen><userinput remap="make">make</userinput></screen>
 <screen><userinput remap="make">make</userinput></screen>
-<!--
-<screen><userinput remap="make">LIBRARY_PATH=/tools/lib make</userinput></screen>
 
 
-<note><para>The LIBRARY_PATH variable here and the LD_LIBRARY_PATH variable
-below are needed to allow the use of libraries that were installed in /tools,
-but have not yet been installed in the main system.  LIBRARY_PATH is
-used to find libraries during the linking process.  LD_LIBRARY_PATH is
-used to find libraries during program execution.</para></note>
--->
-<para>Create some directories now that are needed for tests, but
-will also be used as a part of installation:</para>
+    <para>Create some directories now that are needed for tests, but
+    will also be used as a part of installation:</para>
 
 
 <screen><userinput remap="test">mkdir -pv /lib/udev/rules.d
 <screen><userinput remap="test">mkdir -pv /lib/udev/rules.d
 mkdir -pv /etc/udev/rules.d</userinput></screen>
 mkdir -pv /etc/udev/rules.d</userinput></screen>
 
 
-<para>To test the results, issue:</para>
+    <para>To test the results, issue:</para>
 
 
 <screen><userinput remap="test">make check</userinput></screen>
 <screen><userinput remap="test">make check</userinput></screen>
-<!--<screen><userinput remap="test">make LD_LIBRARY_PATH=/tools/lib check</userinput></screen>-->
 
 
     <para>Install the package:</para>
     <para>Install the package:</para>
 
 
 <screen><userinput remap="install">make install</userinput></screen>
 <screen><userinput remap="install">make install</userinput></screen>
-<!--<screen><userinput remap="install">make LD_LIBRARY_PATH=/tools/lib install</userinput></screen>-->
 
 
     <para>Install some custom rules and support files useful in an LFS 
     <para>Install some custom rules and support files useful in an LFS 
     environment:</para>
     environment:</para>
@@ -128,7 +108,6 @@ make -f &udev-lfs-version;/Makefile.lfs install</userinput></screen>
     into a binary database <filename>/etc/udev/hwdb.bin</filename>. Create the
     into a binary database <filename>/etc/udev/hwdb.bin</filename>. Create the
     initial database:</para>
     initial database:</para>
 
 
-<!--<screen><userinput>LD_LIBRARY_PATH=/tools/lib udevadm hwdb - -update</userinput></screen>-->
 <screen><userinput>udevadm hwdb --update</userinput></screen>
 <screen><userinput>udevadm hwdb --update</userinput></screen>
 
 
     <para>This command needs to be run each time the hardware information is
     <para>This command needs to be run each time the hardware information is

+ 0 - 11
chapter06/systemd.xml

@@ -50,13 +50,6 @@
 
 
 <screen><userinput remap="pre">ln -sf /tools/bin/true /usr/bin/xsltproc</userinput></screen>
 <screen><userinput remap="pre">ln -sf /tools/bin/true /usr/bin/xsltproc</userinput></screen>
 
 
-    <para>Because we have not yet installed the final version of Util-Linux,
-    create links to the libraries in the appropriate location:</para>
-
-<screen><userinput remap="pre">for file in /tools/lib/lib{blkid,mount,uuid}.so*; do
-    ln -sf $file /usr/lib/
-done</userinput></screen>
-
     <para>Set up the man pages:</para>
     <para>Set up the man pages:</para>
 
 
 <screen><userinput remap="pre">tar -xf ../systemd-man-pages-&systemd-version;.tar.xz</userinput></screen>
 <screen><userinput remap="pre">tar -xf ../systemd-man-pages-&systemd-version;.tar.xz</userinput></screen>
@@ -76,7 +69,6 @@ done</userinput></screen>
 <screen><userinput remap="configure">mkdir -p build
 <screen><userinput remap="configure">mkdir -p build
 cd       build
 cd       build
 
 
-PKG_CONFIG_PATH="/usr/lib/pkgconfig:/tools/lib/pkgconfig" \
 LANG=en_US.UTF-8                   \
 LANG=en_US.UTF-8                   \
 meson --prefix=/usr                \
 meson --prefix=/usr                \
       --sysconfdir=/etc            \
       --sysconfdir=/etc            \
@@ -234,9 +226,6 @@ meson --prefix=/usr                \
 
 
 <screen><userinput remap="adjust">rm -f /usr/lib/sysctl.d/50-pid-max.conf</userinput></screen>
 <screen><userinput remap="adjust">rm -f /usr/lib/sysctl.d/50-pid-max.conf</userinput></screen>
 
 
-    <para>Cleanup symbolic links to Util-Linux libraries:</para>
-
-<screen><userinput remap="adjust">rm -fv /usr/lib/lib{blkid,uuid,mount}.so*</userinput></screen>
     <!--
     <!--
     <para>Prevent systemd from creating <filename>/run/nologin</filename>
     <para>Prevent systemd from creating <filename>/run/nologin</filename>
     to allow unprivileged user logins without
     to allow unprivileged user logins without

+ 6 - 4
chapter06/util-linux.xml

@@ -60,11 +60,13 @@
 <screen><userinput remap="pre">sed -e 's/2^64/(2^64/' -e 's/E &lt;/E) &lt;=/' -e 's/ne /eq /' \
 <screen><userinput remap="pre">sed -e 's/2^64/(2^64/' -e 's/E &lt;/E) &lt;=/' -e 's/ne /eq /' \
     -i tests/ts/ipcs/limits2</userinput></screen>
     -i tests/ts/ipcs/limits2</userinput></screen>
 -->
 -->
-<!-- those symlinks are not created anymore
-    <para revision="systemd">Remove the earlier created symlinks:</para>
 
 
-<screen revision="systemd"><userinput remap="pre">rm -vf /usr/include/{blkid,libmount,uuid}</userinput></screen>
--->
+    <para>Remove the earlier created symlinks and files:</para>
+
+<screen><userinput remap="pre">rm -vf /usr/include/{blkid,libfdisk,libmount,uuid}
+rm -vf /usr/lib/{blkid,fdisk,mount,uuid}.so*
+rm -vf /usr/lib/pkgconfig/{blkid,fdisk,mount,uuid}.pc</userinput></screen>
+
     <para>Prepare Util-linux for compilation:</para>
     <para>Prepare Util-linux for compilation:</para>
 
 
 <screen revision="sysv"><userinput remap="configure">./configure ADJTIME_PATH=/var/lib/hwclock/adjtime   \
 <screen revision="sysv"><userinput remap="configure">./configure ADJTIME_PATH=/var/lib/hwclock/adjtime   \