aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXi Ruoyao <xry111@xry111.site>2023-03-08 20:03:55 +0800
committerXi Ruoyao <xry111@xry111.site>2023-03-08 20:03:55 +0800
commit716077268052a05c243cb6473a6b556c23158bea (patch)
tree33cf92d3e073d4647d00c4f32addd952bd6a301c
parent95105f36a3a16a582a45cd29085c557d8d3955f0 (diff)
parent835e40ce16b6043f6349cc37ff83ee701d961ee5 (diff)
Merge remote-tracking branch 'origin/trunk' into xry111/arm64
-rw-r--r--chapter02/hostreqs.xml10
-rw-r--r--chapter08/binutils.xml23
-rw-r--r--chapter08/expect.xml17
-rw-r--r--chapter10/kernel.xml17
4 files changed, 42 insertions, 25 deletions
diff --git a/chapter02/hostreqs.xml b/chapter02/hostreqs.xml
index e3a06df4e..78a9c0561 100644
--- a/chapter02/hostreqs.xml
+++ b/chapter02/hostreqs.xml
@@ -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";
diff --git a/chapter08/binutils.xml b/chapter08/binutils.xml
index 5722780fe..3e29a5153 100644
--- a/chapter08/binutils.xml
+++ b/chapter08/binutils.xml
@@ -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>
diff --git a/chapter08/expect.xml b/chapter08/expect.xml
index 9068259be..39b6517a3 100644
--- a/chapter08/expect.xml
+++ b/chapter08/expect.xml
@@ -88,10 +88,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
diff --git a/chapter10/kernel.xml b/chapter10/kernel.xml
index 27bd6e2f9..1cc02a139 100644
--- a/chapter10/kernel.xml
+++ b/chapter10/kernel.xml
@@ -111,6 +111,7 @@
General setup ---&gt;
[ ] Compile the kernel with warnings as errors [CONFIG_WERROR]
&lt; &gt; Enable kernel headers through /sys/kernel/kheaders.tar.xz [CONFIG_IKHEADERS]
+ [ ] Configure standard kernel features (expert users) [CONFIG_EXPERT]
General architecture-dependent options ---&gt;
[*] Stack Protector buffer overflow detection [CONFIG_STACKPROTECTOR]
[*] Strong Stack Protector [CONFIG_STACKPROTECTOR_STRONG]
@@ -140,8 +141,7 @@ General setup ---&gt;
[*] Control Group support [CONFIG_CGROUPS] ---&gt;
[*] Memory controller [CONFIG_MEMCG]
[ ] Enable deprecated sysfs features to support old userspace tools [CONFIG_SYSFS_DEPRECATED]
- [*] Configure standard kernel features (expert users) [CONFIG_EXPERT] ---&gt;
- [*] open by fhandle syscalls [CONFIG_FHANDLE]
+ [ ] Configure standard kernel features (expert users) [CONFIG_EXPERT]
General architecture-dependent options ---&gt;
[*] Enable seccomp to safely compute untrusted bytecode [CONFIG_SECCOMP]
[*] Stack Protector buffer overflow detection [CONFIG_STACKPROTECTOR]
@@ -227,6 +227,19 @@ File systems ---&gt;
</varlistentry>
<varlistentry>
+ <term>
+ <parameter>
+ Configure standard kernel features (expert users)
+ </parameter>
+ </term>
+ <listitem>
+ <para>This will make some options show up in the configuration
+ interface but changing those options may be dangerous. Do not use
+ this unless you know what you are doing.</para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
<term><parameter>Strong Stack Protector</parameter></term>
<listitem>
<para>Enable SSP for the kernel. We've enabled it for the entire