From ce11e97f013485bdedd834b960c88a1452701648 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Tue, 6 Feb 2024 00:15:33 +0800 Subject: [PATCH] kernfs: Use a separate devpts filesystem for chroot environment IIRC we switched from separate devpts to bind mount, and matched the UID of tester with the host UID owning the TTY, to satisify the Bash test suite. But now we are always using UID 101 for tester and expect to spawn a PTY for Bash test suite (so when building LFS in a TTY owned by the root user of the host tester won't be UID 0). Thus we can switch back to a separate devpts mount which is cleaner and safer. And we are already using a separate devpts mount in Chapter 11. --- chapter07/kernfs.xml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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.