Opened 13 years ago

Closed 13 years ago

#3088 closed defect (fixed)

6.2.3. Mounting Virtual Kernel File Systems from a LFS 7.1 host system

Reported by: Wayne Blaszczyk Owned by: lfs-book@…
Priority: normal Milestone: 7.2
Component: Book Version: SVN
Severity: normal Keywords:
Cc:

Description

The instruction 'mount -vt tmpfs shm $LFS/dev/shm' in section 6.2.3 does not work if the host system is LFS 7.1.

This is because the mountvirtfs start script creates a symlynk /dev/shm which points to /run/shm.

So the instruction 'mount -vt tmpfs shm $LFS/dev/shm' mounts onto /run/shm rather than /mnt/lfs/dev/shm.

Change History (5)

comment:1 by bdubbs@…, 13 years ago

If we are doing 'mount -v --bind /dev $LFS/dev' and $LFS/dev/pts already points to /run, we probably do not need to do 'mount -vt tmpfs shm $LFS/dev/shm' at all.

Do things seem to work OK if you just drop the 'mount -vt tmpfs shm $LFS/dev/shm' command?

comment:2 by bdubbs@…, 13 years ago

Proposed solution in Chapter 6.2:

Change

mount -vt tmpfs shm $LFS/dev/shm

to

if [ ! -h /dev/shm ]; then mount -vt tmpfs shm $LFS/dev/shm; fi

comment:3 by Wayne Blaszczyk, 13 years ago

By dropping the 'mount -vt tmpfs shm $LFS/dev/shm' command altogether, after entering the chroot environment, the /dev/shm is pointing to a non existent /run/shm. I'm not sure if this will cause any problems down the line. (I'm currently not going through the process of building another LFS environment).

comment:4 by bdubbs@…, 13 years ago

Thinking about this some more, I think the following might work:

if [ -h /dev/shm ]; then 
  rm -f $LFS/dev/shm
  mkdir $LFS/dev/shm
fi
  
mount -vt tmpfs shm $LFS/dev/shm

I'll note that my jhalfs build log has:

shm on /run/shm type tmpfs (rw)

which is wrong, but does not affect the build.

comment:5 by bdubbs@…, 13 years ago

Resolution: fixed
Status: newclosed

Recreated $LFS/dev/shm if it is a symbolic link.

Fixed in revision 9860.

Note: See TracTickets for help on using tickets.