cross-ng: chapter 7: set up lo interface

This commit is contained in:
Xi Ruoyao 2021-08-27 03:41:29 +08:00
parent 3a5d53a529
commit 1ea79fdb82
No known key found for this signature in database
GPG Key ID: D95E4716CCBB34DC
4 changed files with 103 additions and 2 deletions

View File

@ -70,8 +70,13 @@
<listitem> <listitem>
<para>A few operations, from <para>A few operations, from
<quote>Preparing Virtual Kernel File Systems</quote> to <quote>Preparing Virtual Kernel File Systems</quote> to
<quote>Setting up Environment</quote> must be done as the <quote>Setting up Environment</quote> must be done.</para>
<systemitem class="username">root</systemitem> user.</para> </listitem>
<listitem>
<para>The operations in <xref linkend="ch-tools-lo"/> must be done
before starting or continuing from
<xref linkend="chapter-building-system"/>.</para>
</listitem> </listitem>
</itemizedlist> </itemizedlist>

View File

@ -24,6 +24,7 @@
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="python.xml"/> <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="python.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="texinfo.xml"/> <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="texinfo.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"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="iproute2.xml"/>
<!-- <!--
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="tcl.xml"/> <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="tcl.xml"/>

93
chapter07/iproute2.xml Normal file
View File

@ -0,0 +1,93 @@
<?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;
]>
<sect1 id="ch-tools-lo" role="wrap">
<?dbhtml filename="lo-iface.html"?>
<sect1info condition="script">
<productname>iproute2</productname>
<productnumber>&iproute2-version;</productnumber>
<address>&iproute2-url;</address>
</sect1info>
<title>Setting Up Loopback Network Interface with IPRoute-&iproute2-version;</title>
<indexterm zone="ch-tools-lo">
<primary sortas="a-IPRoute2">IPRoute2</primary>
<secondary>tools</secondary>
</indexterm>
<sect2 role="package">
<title/>
<para>The IPRoute2 package contains programs for basic and advanced IPV4-based
networking. Now we need <command>ip</command> from it to bring up
loopback network interface, which is expected by the testsuites of
various packages.</para>
<segmentedlist>
<segtitle>&buildtime;</segtitle>
<segtitle>&diskspace;</segtitle>
<seglistitem>
<seg>&iproute2-tmp-sbu;</seg>
<seg>&iproute2-tmp-du;</seg>
</seglistitem>
</segmentedlist>
</sect2>
<sect2 role="installation">
<title>Use IPRoute2 to Set Up Loopback Network Interface</title>
<para>IPRoute2 package has several dependencies not installed yet, but
we only need <command>ip</command> utility from the package now.
Disable the build of other utilities:</para>
<screen><userinput remap="pre">sed '/SUBDIRS/s/=.*/=lib ip/' -i Makefile</userinput></screen>
<para>Compile the package:</para>
<screen><userinput remap="make">PKG_CONFIG=false make</userinput></screen>
<variablelist>
<title>The meaning of the environment variable:</title>
<varlistentry>
<term><parameter>PKG_CONFIG=false</parameter></term>
<listitem>
<para>The building system attempts to find dependencies with
<command>pkg-config</command>, which is not installed yet.
We can override it since <command>ip</command> utility does not
need these dependencies.</para>
</listitem>
</varlistentry>
</variablelist>
<para>It's not needed to install the <command>ip</command> utility now.
Just bring up the loopback interface:</para>
<screen><userinput remap="install">ip/ip link set lo up</userinput></screen>
<para>Verify the result:</para>
<screen><userinput remap="install">ip/ip addr</userinput></screen>
<para>The command above should show <literal>127.0.0.1/8</literal>
as the IPv4 address of <literal>lo</literal>, and
<literal>::1/128</literal> as the IPv6 address.</para>
</sect2>
<sect2 role="content">
<title/>
<para>Details on this package are located in <xref linkend="contents-iproute2" role="."/></para>
</sect2>
</sect1>

View File

@ -354,6 +354,8 @@
<!ENTITY iproute2-home "&kernel;linux/utils/net/iproute2/"> <!ENTITY iproute2-home "&kernel;linux/utils/net/iproute2/">
<!ENTITY iproute2-fin-du "15 MB"> <!ENTITY iproute2-fin-du "15 MB">
<!ENTITY iproute2-fin-sbu "0.2 SBU"> <!ENTITY iproute2-fin-sbu "0.2 SBU">
<!ENTITY iproute2-tmp-du "15 MB">
<!ENTITY iproute2-tmp-sbu "less than 0.1 SBU">
<!ENTITY jinja2-version "3.0.3"> <!ENTITY jinja2-version "3.0.3">
<!ENTITY jinja2-size "263 KB"> <!ENTITY jinja2-size "263 KB">