diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index 78a4c1690..78d017e9a 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -39,6 +39,11 @@ 2012-12-28 + + [bdubbs] - Fix the location for mounting /dev/shm + inside chroot. Fixes + #3258. + [matthew] - Move the build of Procps to before E2fsprogs as the latter requires ps to be available during its diff --git a/chapter06/kernfs.xml b/chapter06/kernfs.xml index 4667d6012..51bcbe59c 100644 --- a/chapter06/kernfs.xml +++ b/chapter06/kernfs.xml @@ -74,16 +74,17 @@ mount -vt sysfs sysfs $LFS/sys In some host systems, /dev/shm is a symbolic link to /run/shm. - Inside a chroot environment, this symbolic link needs to be - changed to a normal directory before mounting as a temporary - file system: + Inside a chroot environment, this temporary file system needs + to be mounted separate from the host file system: -if [ -h /dev/shm ]; then - rm -f $LFS/dev/shm - mkdir $LFS/dev/shm -fi - -mount -vt tmpfs shm $LFS/dev/shm +if [ -h $LFS/dev/shm ]; then + link=$(readlink $LFS/dev/shm) + mkdir -p $LFS/$link + mount -vt tmpfs shm $LFS/$link + unset link +else + mount -vt tmpfs shm $LFS/dev/shm +fi diff --git a/chapter09/reboot.xml b/chapter09/reboot.xml index 78d7ac550..59a24d4d2 100644 --- a/chapter09/reboot.xml +++ b/chapter09/reboot.xml @@ -33,7 +33,15 @@ Then unmount the virtual file systems: umount -v $LFS/dev/pts -umount -v $LFS/dev/shm + +if [ -h $LFS/dev/shm ]; then + link=$(readlink $LFS/dev/shm) + umount -v $LFS/$link + unset link +else + umount -v $LFS/dev/shm +fi + umount -v $LFS/dev umount -v $LFS/proc umount -v $LFS/sys