diff --git a/chapter07/kernfs.xml b/chapter07/kernfs.xml
index 575044106..067a614f4 100644
--- a/chapter07/kernfs.xml
+++ b/chapter07/kernfs.xml
@@ -63,11 +63,14 @@
Now mount the remaining virtual kernel file systems:
-mount -v --bind /dev/pts $LFS/dev/pts
+
+
+mount -vt devpts devpts -o gid=5,mode=0620 $LFS/dev/pts
mount -vt proc proc $LFS/proc
mount -vt sysfs sysfs $LFS/sys
mount -vt tmpfs tmpfs $LFS/run
-
+
In some host systems, /dev/shm is a
symbolic link to a directory, typically
/run/shm.
diff --git a/chapter08/bash.xml b/chapter08/bash.xml
index 4b5b47e62..1490e7791 100644
--- a/chapter08/bash.xml
+++ b/chapter08/bash.xml
@@ -83,7 +83,7 @@
Expect and run the tests as the tester user:
-su -s /usr/bin/expect tester << EOF
+su -s /usr/bin/expect tester << "EOF"
set timeout -1
spawn make tests
expect eof
diff --git a/chapter08/expect.xml b/chapter08/expect.xml
index 810bc55a2..5c21e390f 100644
--- a/chapter08/expect.xml
+++ b/chapter08/expect.xml
@@ -48,6 +48,25 @@
Installation of Expect
+ Expect needs PTYs to work. Verify that the PTYs are working
+ properly inside the chroot environment by performing a simple
+ test:
+
+python3 -c 'from pty import spawn; spawn(["echo", "ok"])'
+
+ This command should output ok.
+ If, instead, the output includes OSError: out of pty
+ devices, then the environment is not set up for proper
+ PTY operation. You need to exit from the chroot environment, read
+ again, and ensure the
+ devpts file system (and
+ other virtual kernel file systems) mounted correctly. Then reenter
+ the chroot environment following .
+ This issue needs to be resolved before continuing, or the test suites
+ requring Expect (for example the test suites of Bash, Binutils, GCC,
+ GDBM, and of course Expect itself) will fail catastrophically, and other
+ subtle breakages may also happen.
+
Prepare Expect for compilation:
./configure --prefix=/usr \
@@ -82,27 +101,10 @@
make
-
- The test suite for Expect is considered critical.
- Do not skip it under any circumstances.
-
-
To test the results, issue:
make test
- If any test fails with the message
- The system has no more ptys. Ask your system
- administrator to create more, it indicates
- you've not mounted the
- devpts file system
- correctly. You need to exit from the chroot environment, read
- again, and ensure the
- devpts file system (and
- other virtual kernel file systems) mounted correctly. Then reenter
- the chroot environment following .
- This issue needs to be resolved before continuing.
-
Install the package:
make install