From 01247ac90a16aa37dc31dec1d743d77d09194234 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Mon, 20 Nov 2023 07:18:26 +0800 Subject: kernfs: Revise command creating the link target in case /dev/shm is a symlink When /dev/shm is a symlink we need to create its target or some tests will fail and Python 3 will be misconfigured. We wrote it as: mkdir -pv $LFS/$(readlink $LFS/dev/shm) But if $LFS/dev/shm is a relative symlink (say ../run/shm), we end up: mkdir -pv /mnt/lfs/../run/shm This command will create /mnt/run/shm, not $LFS/mnt/shm as we expected. Twist it a little to make it work for both absolute symlinks and relative symlinks. --- chapter07/kernfs.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter07/kernfs.xml b/chapter07/kernfs.xml index 4757b257d..049f6e804 100644 --- a/chapter07/kernfs.xml +++ b/chapter07/kernfs.xml @@ -107,7 +107,7 @@ mount -vt tmpfs tmpfs $LFS/run we must explicitly mount a tmpfs: if [ -h $LFS/dev/shm ]; then - mkdir -pv $LFS/$(readlink $LFS/dev/shm) + (cd $LFS/dev; mkdir $(readlink shm)) else mount -vt tmpfs -o nosuid,nodev tmpfs $LFS/dev/shm fi -- cgit v1.2.3-54-g00ecf