util-linux.xml 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <?xml version="1.0" encoding="UTF-8"?>
  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. <sect1 id="ch-tools-util-linux" role="wrap" revision="systemd">
  8. <?dbhtml filename="util-linux.html"?>
  9. <sect1info condition="script">
  10. <productname>util-linux</productname>
  11. <productnumber>&util-linux-version;</productnumber>
  12. <address>&util-linux-url;</address>
  13. </sect1info>
  14. <title>Util-linux-&util-linux-version;</title>
  15. <indexterm zone="ch-tools-util-linux">
  16. <primary sortas="a-Util-linux">Util-linux</primary>
  17. <secondary>tools</secondary>
  18. </indexterm>
  19. <sect2 role="package">
  20. <title/>
  21. <para>Util-linux 软件包包含一些工具程序。</para>
  22. <segmentedlist>
  23. <segtitle>&buildtime;</segtitle>
  24. <segtitle>&diskspace;</segtitle>
  25. <seglistitem>
  26. <seg>&util-linux-ch5-sbu;</seg>
  27. <seg>&util-linux-ch5-du;</seg>
  28. </seglistitem>
  29. </segmentedlist>
  30. </sect2>
  31. <sect2 role="installation">
  32. <title>安装 Util-linux</title>
  33. <para>准备编译 Util-linux:</para>
  34. <screen><userinput remap="configure">./configure --prefix=/tools \
  35. --without-python \
  36. --disable-makeinstall-chown \
  37. --without-systemdsystemunitdir \
  38. --without-ncurses \
  39. PKG_CONFIG=""</userinput></screen>
  40. <variablelist>
  41. <title>配置选项的含义:</title>
  42. <varlistentry>
  43. <term><parameter>--without-python</parameter></term>
  44. <listitem>
  45. <!--para>This switch disables using <application>Python</application>
  46. if it is installed on the host system. It avoids trying to build
  47. unneeded bindings.</para-->
  48. <para>如果宿主系统安装了 <application>Python</application>,
  49. 该选项防止构建系统使用它,这样就不会构建不需要的语言绑定。
  50. </para>
  51. </listitem>
  52. </varlistentry>
  53. <varlistentry>
  54. <term><parameter>--disable-makeinstall-chown</parameter></term>
  55. <listitem>
  56. <!--para>This switch disables using the <command>chown</command> command
  57. during installation. This is not needed when installing into the
  58. /tools directory and avoids the necessity of installing as
  59. root.</para-->
  60. <para>这个开关在安装时禁用 <command>chown</command>,
  61. 在安装到 /tools 目录时我们不需要这样做,禁用它就不必用 root
  62. 身份进行安装。</para>
  63. </listitem>
  64. </varlistentry>
  65. <varlistentry>
  66. <term><parameter>--without-ncurses</parameter></term>
  67. <listitem>
  68. <!--para>This switch disables using the ncurses library for
  69. the build process. This is not needed when installing into the
  70. /tools directory and avoids problems on some host distros.</para-->
  71. <para>这个开关在构建过程中禁用 ncurses 库,在安装到
  72. /tools 目录时我们不需要它,
  73. 禁用它可以避免某些宿主发行版上的问题。</para>
  74. </listitem>
  75. </varlistentry>
  76. <varlistentry>
  77. <term><parameter>--without-systemdsystemunitdir</parameter></term>
  78. <listitem>
  79. <!--para>On systems that use systemd, the package tries to install
  80. a systemd specific file to a non-existent directory in /tools.
  81. This switch disables the unnecessary action.</para-->
  82. <para>在使用 systemd 的系统上,该软件包会试图向 /tools
  83. 中一个不存在的目录安装 systemd 专用的文件,
  84. 该选项可以阻止这个不必要的行为。</para>
  85. </listitem>
  86. </varlistentry>
  87. <varlistentry>
  88. <term><envar>PKG_CONFIG=""</envar></term>
  89. <listitem>
  90. <!--para>Setting this environment variable prevents adding unneeded
  91. features that may be available on the host. Note that the location
  92. shown for setting this environment variable is different from other
  93. LFS sections where variables are set preceding the command. This
  94. location is shown to demonstrate an alternative way of setting an
  95. environment variable when using configure.</para-->
  96. <para>设置这个环境变量可以防止引入那些宿主系统上可用,
  97. 但对 LFS 来说不必要的特性。
  98. 注意到本书中其他环境变量都在命令之前被设置,
  99. 而这个环境变量设定处于命令行中的不同位置,
  100. 这是为了展示在使用 configure 脚本时设置环境变量的另一种方法。
  101. </para>
  102. </listitem>
  103. </varlistentry>
  104. </variablelist>
  105. <para>编译该软件包:</para>
  106. <screen><userinput remap="make">make</userinput></screen>
  107. <para>安装该软件包:</para>
  108. <screen><userinput remap="install">make install</userinput></screen>
  109. </sect2>
  110. <sect2 role="content">
  111. <title/>
  112. <para>该软件包的详细信息可以在
  113. <xref linkend="contents-utillinux"/> 中找到。</para>
  114. </sect2>
  115. </sect1>