source: chapter02/hostreqs.xml@ 6be4bf1

xry111/loongarch xry111/loongarch-12.1 xry111/loongarch-12.2
Last change on this file since 6be4bf1 was 289f284, checked in by Xi Ruoyao <xry111@…>, 8 months ago

Merge remote-tracking branch 'origin/trunk' into xry111/loongarch

  • Property mode set to 100644
File size: 9.4 KB
Line 
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
8<sect1 id="ch-partitioning-hostreqs" xreflabel="Host System Requirements">
9 <?dbhtml filename="hostreqs.html"?>
10
11 <title>Host System Requirements</title>
12
13 <sect2>
14 <title>Hardware</title>
15
16 <para>The LFS editors recommend that the system CPU have at least
17 four cores and that the system have at least 8 GB of memory.
18 Older systems that do not meet these requirements will still work,
19 but the time to build packages will be significantly longer
20 than documented.
21 </para>
22
23 </sect2>
24
25 <sect2>
26 <title>Software</title>
27
28 <para>Your host system should have the following software with the
29 minimum versions indicated. This should not be an issue for most
30 modern Linux distributions. Also note that many distributions will
31 place software headers into separate packages, often in the form of
32 <quote>&lt;package-name&gt;-devel</quote> or
33 <quote>&lt;package-name&gt;-dev</quote>. Be sure to install those if
34 your distribution provides them.</para>
35
36 <para>Earlier versions of the listed software packages may work, but have
37 not been tested.</para>
38
39 <itemizedlist spacing="compact">
40
41 <listitem>
42 <para><emphasis role="strong">Bash-3.2</emphasis> (/bin/sh
43 should be a symbolic or hard link to bash)</para>
44 </listitem>
45
46 <listitem>
47 <para><emphasis role="strong">Binutils-2.38</emphasis> (Versions
48 greater than &binutils-version; are not recommended as they have
49 not been tested)</para>
50 </listitem>
51
52 <listitem>
53 <para><emphasis role="strong">Bison-2.7</emphasis> (/usr/bin/yacc
54 should be a link to bison or a small script that executes bison)</para>
55 </listitem>
56
57 <!-- In Coreutils-8.1 the nproc program is added. -->
58 <listitem>
59 <para><emphasis role="strong">Coreutils-8.1</emphasis></para>
60 </listitem>
61
62 <listitem>
63 <para><emphasis role="strong">Diffutils-2.8.1</emphasis></para>
64 </listitem>
65
66 <listitem>
67 <para><emphasis role="strong">Findutils-4.2.31</emphasis></para>
68 </listitem>
69
70 <listitem>
71 <para><emphasis role="strong">Gawk-4.0.1</emphasis> (/usr/bin/awk
72 should be a link to gawk)</para>
73 </listitem>
74
75 <listitem>
76 <para><emphasis role="strong">GCC-12.2</emphasis> including the C++
77 compiler, <command>g++</command> (Versions greater than &gcc-version; are
78 not recommended as they have not been tested). C and C++ standard
79 libraries (with headers) must also be present so the C++ compiler can
80 build hosted programs</para>
81 </listitem>
82
83 <listitem>
84 <para><emphasis role="strong">Grep-2.5.1a</emphasis></para>
85 </listitem>
86
87 <listitem>
88 <para><emphasis role="strong">Gzip-1.3.12</emphasis></para>
89 </listitem>
90
91 <listitem>
92 <para><emphasis role="strong">Linux Kernel-&min-kernel;</emphasis></para>
93
94 <para>The reason for the kernel version requirement is that we specify
95 that version when building <application>glibc</application> in
96 <xref linkend="chapter-cross-tools"/> and
97 <xref linkend="chapter-building-system"/>, and
98 &min-kernel; is the oldest kernel release supported by Glibc for
99 LoongArch.</para>
100
101 <important>
102 <para>
103 If a Linux distribution on LoongArch provides a kernel older than
104 &min-kernel;, it indicates the distribution is using a preliminary
105 version of the kernel ABI. The preliminary draft was rejected by
106 the kernel maintainers and it's fundamentally incompatible with
107 the packages we will built for LFS. Such <quote>old-world</quote>
108 distributions (for example, Loongnix) cannot be used as a host
109 distro for building LFS.
110 </para>
111
112 <para>
113 Do not attempt to update the kernel to &min-kernel; or later on
114 a old-world distro because doing so will cause a boot failure.
115 Use a <quote>new-world</quote> distribution providing Linux Kernel
116 &min-kernel; or newer instead. You may need to contact the vendor
117 of your hardware to get a firmware update for booting a new-world
118 distribution because the boot protocol of LoongArch is stabilized
119 after the launch of the early LoongArch hardwares.
120 </para>
121 </important>
122
123 <para>We require the host kernel to support UNIX 98 pseudo terminal
124 (PTY). It should be enabled on all desktop or server distros shipping
125 Linux &min-kernel; or a newer kernel. If you are building a custom
126 host kernel, ensure <option>CONFIG_UNIX98_PTYS</option> is set to
127 <literal>y</literal> in the kernel configuration.</para>
128
129 </listitem>
130
131 <listitem>
132 <para><emphasis role="strong">M4-1.4.10</emphasis></para>
133 </listitem>
134
135 <listitem>
136 <para><emphasis role="strong">Make-4.0</emphasis></para>
137 </listitem>
138
139 <listitem>
140 <para><emphasis role="strong">Patch-2.5.4</emphasis></para>
141 </listitem>
142
143 <listitem>
144 <para><emphasis role="strong">Perl-5.8.8</emphasis></para>
145 </listitem>
146
147 <listitem>
148 <para><emphasis role="strong">Python-3.4</emphasis></para>
149 </listitem>
150
151 <listitem>
152 <para><emphasis role="strong">Sed-4.1.5</emphasis></para>
153 </listitem>
154
155 <listitem>
156 <para><emphasis role="strong">Tar-1.22</emphasis></para>
157 </listitem>
158
159 <listitem>
160 <para><emphasis role="strong">Texinfo-5.0</emphasis></para>
161 </listitem>
162
163 <listitem>
164 <para><emphasis role="strong">Xz-5.0.0</emphasis></para>
165 </listitem>
166
167 </itemizedlist>
168
169 <important>
170 <para>Note that the symlinks mentioned above are required to build an LFS
171 system using the instructions contained within this book. Symlinks that
172 point to other software (such as dash, mawk, etc.) may work, but are not
173 tested or supported by the LFS development team, and may require either
174 deviation from the instructions or additional patches to some
175 packages.</para>
176 </important>
177
178 <!-- Use an empty sect2 element to prevent a pdf warning. -->
179 <bridgehead renderas="sect2"
180 id="version-check"
181 xreflabel="Host System Requirements">
182 </bridgehead>
183 <!--<title> </title>-->
184
185 <para >To see whether your host system has all the appropriate versions, and
186 the ability to compile programs, run the following commands:</para>
187
188<screen role="nodump"><?dbfo keep-together="auto"?><userinput>cat &gt; version-check.sh &lt;&lt; "EOF"
189<literal>#!/bin/bash
190# A script to list version numbers of critical development tools
191
192# If you have tools installed in other directories, adjust PATH here AND
193# in ~lfs/.bashrc (section 4.4) as well.
194
195LC_ALL=C
196PATH=/usr/bin:/bin
197
198bail() { echo "FATAL: $1"; exit 1; }
199grep --version > /dev/null 2> /dev/null || bail "grep does not work"
200sed '' /dev/null || bail "sed does not work"
201sort /dev/null || bail "sort does not work"
202
203ver_check()
204{
205 if ! type -p $2 &amp;>/dev/null
206 then
207 echo "ERROR: Cannot find $2 ($1)"; return 1;
208 fi
209 v=$($2 --version 2>&amp;1 | grep -E -o '[0-9]+\.[0-9\.]+[a-z]*' | head -n1)
210 if printf '%s\n' $3 $v | sort --version-sort --check &amp;>/dev/null
211 then
212 printf "OK: %-9s %-6s >= $3\n" "$1" "$v"; return 0;
213 else
214 printf "ERROR: %-9s is TOO OLD ($3 or later required)\n" "$1";
215 return 1;
216 fi
217}
218
219ver_kernel()
220{
221 kver=$(uname -r | grep -E -o '^[0-9\.]+')
222 if printf '%s\n' $1 $kver | sort --version-sort --check &amp;>/dev/null
223 then
224 printf "OK: Linux Kernel $kver >= $1\n"; return 0;
225 else
226 printf "ERROR: Linux Kernel ($kver) is TOO OLD ($1 or later required)\n" "$kver";
227 return 1;
228 fi
229}
230
231# Coreutils first because --version-sort needs Coreutils >= 7.0
232ver_check Coreutils sort 8.1 || bail "Coreutils too old, stop"
233ver_check Bash bash 3.2
234ver_check Binutils ld 2.38
235ver_check Bison bison 2.7
236ver_check Diffutils diff 2.8.1
237ver_check Findutils find 4.2.31
238ver_check Gawk gawk 4.0.1
239ver_check GCC gcc 12.2
240ver_check "GCC (C++)" g++ 12.2
241ver_check Grep grep 2.5.1a
242ver_check Gzip gzip 1.3.12
243ver_check M4 m4 1.4.10
244ver_check Make make 4.0
245ver_check Patch patch 2.5.4
246ver_check Perl perl 5.8.8
247ver_check Python python3 3.4
248ver_check Sed sed 4.1.5
249ver_check Tar tar 1.22
250ver_check Texinfo texi2any 5.0
251ver_check Xz xz 5.0.0
252ver_kernel &min-kernel;
253
254if mount | grep -q 'devpts on /dev/pts' &amp;&amp; [ -e /dev/ptmx ]
255then echo "OK: Linux Kernel supports UNIX 98 PTY";
256else echo "ERROR: Linux Kernel does NOT support UNIX 98 PTY"; fi
257
258alias_check() {
259 if $1 --version 2>&amp;1 | grep -qi $2
260 then printf "OK: %-4s is $2\n" "$1";
261 else printf "ERROR: %-4s is NOT $2\n" "$1"; fi
262}
263echo "Aliases:"
264alias_check awk GNU
265alias_check yacc Bison
266alias_check sh Bash
267
268echo "Compiler check:"
269if printf "int main(){}" | g++ -x c++ -
270then echo "OK: g++ works";
271else echo "ERROR: g++ does NOT work"; fi
272rm -f a.out
273
274if [ "$(nproc)" = "" ]; then
275 echo "ERROR: nproc is not available or it produces empty output"
276else
277 echo "OK: nproc reports $(nproc) logical cores are available"
278fi</literal>
279EOF
280
281bash version-check.sh</userinput></screen>
282
283 </sect2>
284</sect1>
Note: See TracBrowser for help on using the repository browser.