John Rodenbiker wrote:
> I'm building LFS 6.2-3 from the Live CD to an i686-compatible platform.
>
> Throughout section 5 I was copying tarballs and patches to $LFS/sources
> as needed.
>
If running from Live CD, and your host system system supports loop back
devices, you need not copy. See below. That answer also applies here I
think.
> I naively expected to do the same for section 6, but after mounting the
> CD under the chroot it looks like the sources are trapped in a
> filesystem image.
>
> How can I access the sources on the CD from the chroot environment (if
> at all)?
>
From the host system, mount the CD. Find the file system image on the
CD. On my host,
/media/cdrom/root.ext2
is it.
Assign that to a loop back devices, similar to this.
losetup /dev/loop0 /media/cdrom/root.ext2
Check the man page.
Mount that device somewhere convenient, similar to this.
mkdir /mnt/lfs_cdrom_root.ext2
mount -o ro /dev/loop0 /mnt/lfs_cdrom_root.ext2
There is a mount option that will automatically handle the loop back
device (un)assignment for you when you mount and un-mount, if you want
to use it. See the man page.
Anyway, if you have /lfs/sources made, then mount with a "--bind" before
entering the chroot environment. Again, from memory (so check the man page)
mount --bind /mnt/mnt/lfs_cdrom_root.ext2/lfs-sources $LFS/sources
The "loop" can be any unused loop in /dev/ that is not in use.
If your "cdrom" is a "(re)writer", the read only option may not be
needed. I added updated sources, patches and a few BLFS early-need items
to my copy.
> Thanks.
>
HTH and hope I got it right (working from memory is risky: be careful
and use the man pages).
--
Wit
--
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page