Adjustments for /dev/pts

1. Declare UNIX98 PTY requirement in host system requirements and check
   it in the script.  All desktop or server distros should have it now,
   but let's stop anyone from building on a embedded distro w/o UNIX98
   PTY early...
2. Use Expect test suite as a guard against mishandled $LFS/dev/pts.
3. No need to test the basic function of Expect in Binutils anymore
   because if ($LFS)/dev/pts is not good, the Expect test suite would
   have failed.
This commit is contained in:
Xi Ruoyao 2023-03-08 11:21:34 +08:00
parent e0fb1098a4
commit 835e40ce16
No known key found for this signature in database
GPG Key ID: ACAAD20E19E710E3
3 changed files with 27 additions and 23 deletions

View File

@ -105,6 +105,12 @@
compiling the kernel and configuring the boot loader (assuming the host
uses GRUB) are located in <xref linkend="chapter-bootable"/>.</para>
<para>We require the host kernel to support UNIX 98 pseudo terminal
(PTY). It should be enabled on all desktop or server distros shipping
Linux &min-kernel; or a newer kernel. If you are building a custom
host kernel, ensure <option>CONFIG_UNIX98_PTYS</option> is set to
<literal>y</literal> in the kernel configuration.</para>
</listitem>
<listitem>
@ -230,6 +236,10 @@ ver_check Texinfo texi2any 4.7
ver_check Xz xz 5.0.0
ver_kernel &min-kernel;
if mount | grep -q 'devpts on /dev/pts' &amp;&amp; [ -e /dev/ptmx ]
then echo "OK: Linux Kernel supports UNIX 98 PTY";
else echo "ERROR: Linux Kernel does NOT support UNIX 98 PTY"; fi
alias_check() {
if $1 --version 2>&amp;1 | grep -qi $2
then printf "OK: %-4s is $2\n" "$1";

View File

@ -41,29 +41,6 @@
<sect2 role="installation">
<title>Installation of Binutils</title>
<para>Verify that the PTYs are working properly inside the chroot
environment by performing a simple test:</para>
<screen><userinput remap="test">expect -c "spawn ls"</userinput></screen>
<para>This command should output the following:</para>
<screen><computeroutput>spawn ls</computeroutput></screen>
<para>If, instead, the output includes the message below, then the environment
is not set up for proper PTY operation. This issue needs to be resolved before
running the test suites for Binutils and GCC:</para>
<screen><computeroutput>The system has no more ptys.
Ask your system administrator to create more.</computeroutput></screen>
<!-- Fixed in binutils-2.39
<para>
Now make a fix identified upstream that affects building some packages:
</para>
<screen><userinput remap="pre">sed -e '/R_386_TLS_LE /i \ || (TYPE) == R_386_TLS_IE \\' \
-i ./bfd/elfxx-x86.h</userinput></screen>
-->
<para>The Binutils documentation recommends building Binutils
in a dedicated build directory:</para>

View File

@ -82,10 +82,27 @@
<screen><userinput remap="make">make</userinput></screen>
<important>
<para>The test suite for Expect is considered critical.
Do not skip it under any circumstances.</para>
</important>
<para>To test the results, issue:</para>
<screen><userinput remap="test">make test</userinput></screen>
<para>If any test fails with the message
<quote><computeroutput>The system has no more ptys. Ask your system
administrator to create more</computeroutput></quote>, it indicates
you've not mounted the
<systemitem class="filesystem">devpts</systemitem> file system
correctly. You need to exit from the chroot environment, read
<xref linkend='ch-tools-kernfs'/> again, and ensure the
<systemitem class="filesystem">devpts</systemitem> file system (and
other virtual kernel file systems) mounted correctly. Then reenter
the chroot environment following <xref linkend='ch-tools-chroot'/>.
This issue needs to be resolved before continuing.</para>
<para>Install the package:</para>
<screen><userinput remap="install">make install