[lfs-dev] [lfs-book] r10440 - in trunk/BOOK: . chapter01 chapter06

Bruce Dubbs bruce.dubbs at gmail.com
Fri Jan 17 07:52:57 PST 2014

xinglp wrote:
> 2014/1/17 Bruce Dubbs <bruce.dubbs at gmail.com>:
>> Armin K. wrote:
>>> On 01/17/2014 05:03 AM, Bruce Dubbs wrote:
>>>> Moving to -dev.
>>>> xinglp wrote:
>>>>>> OK, thanks.  Can you test:
>>>>>> rm -rf --one-file-system /run/* /tmp/*
>>>>> Same error.
>>>> For background see
>>>> http://www.mail-archive.com/lfs-book@linuxfromscratch.org/msg18517.html
>>>> I'm not sure how to handle this.  At the end of Chapter 6 we don't need
>>>> either /dev/shm or /run/shm.
>>>> What we do when mounting virtual file systems is:
>>>> if [ -h $LFS/dev/shm ]; then
>>>>      link=$(readlink $LFS/dev/shm)
>>>>      mkdir -pv $LFS/$link
>>>>      mount -vt tmpfs shm $LFS/$link
>>>>      unset link
>>>> else
>>>>      mount -vt tmpfs shm $LFS/dev/shm
>>>> fi
>>>> This means that /run/shm only exists if /dev/shm is a symlink.
>>>> We are still in chroot when cleaning up but we can still umount /run/shm
>>>> before deleting.  Probably something like:
>>>> [ -e /run/shm ] && umount /run/shm
>>>> rm -rf /run/* /tmp/*
>>>> How does this sound?

>>> Sorry to jump in, but I want to mention that maybe mounting a tmpfs at
>>> /run itself during the build might be easier.

>> I now remember you mentioning that before.  Let me run a test of that.

> Or use "mount -o bind /run $LFS/run", which is better?

I haven't finished testing yet as I'm also working on a util-linux 
integration with udev problem, but why would we want to bind mount /run? 
  The only place /run is used in the book is for the tests in 
util-linux.  Mounting a tmpfs is fairly painless.  I don't think a bind 
mount would be appropriate because of the potential of interfering with 
the host system.

   -- Bruce

More information about the lfs-dev mailing list