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.
This commit is contained in:
Poltern 2023-11-22 17:34:16 +05:00
parent 870b8218b8
commit 18060affab

View File

@ -103,7 +103,7 @@ mount -vt tmpfs tmpfs $LFS/run</userinput></screen>
tmpfs:</para> tmpfs:</para>
<screen><userinput>if [ -h $LFS/dev/shm ]; then <screen><userinput>if [ -h $LFS/dev/shm ]; then
mkdir -pv $LFS/$(readlink $LFS/dev/shm) (cd $LFS/dev; mkdir $(readlink shm))
else else
mount -vt tmpfs -o nosuid,nodev tmpfs $LFS/dev/shm mount -vt tmpfs -o nosuid,nodev tmpfs $LFS/dev/shm
fi</userinput></screen> fi</userinput></screen>