Gentoo Archives: gentoo-amd64

From: Peter Humphrey <prh@××××××××××.uk>
To: gentoo-amd64@l.g.o
Subject: [gentoo-amd64] chroot howto?
Date: Wed, 13 Jul 2005 09:05:06
Message-Id: 42D4D8F4.2050007@gotadsl.co.uk
I've decided to have a play with chroot on this ~amd64 xfce4 box, so I
followed the instructions at
http://www.gentoo.org/proj/en/base/amd64/technotes/index.xml?part=1&chap=4
to set up the jail in a separate partition mounted on /mnt/gentoo32. My
idea is to use it for e.g. firefox-bin and its plugins, and maybe wine.

I have a few questions. First, the technotes are far from clear in
explaining how the 32-bit chroot jail works, and unhelpful to a chroot
acolyte like me in detailing how to build it, so I had to use my
initiative - always a grave risk ;-)

I unpacked an x86 stage 3, and set up hosts, networks and users as
instructed, but when I tried "linux32 chroot /mnt/gentoo32 /bin/bash" I
got a permission-refused error on /bin/bash. (I tried both with and
without --login; it made no difference.) So I unpacked a portage
snapshot, rebooted from the installation CD and tried again. I could
then chroot. I reasoned that /bin/bash could not be executed because
there was no 32-bit kernel, so I emerged and compiled gentoo-sources in
/mnt/gentoo32. After that I could chroot from the installed system.

But how much more of a Gentoo system do I need to build in the chroot
jail? Emerge --sync? Emerge system? I have /mnt/tmp bound to
/mnt/gentoo32/mnt/tmp, and /mnt/home, /mnt/boot, /mnt/usr/share and
/mnt/usr/portage/distfiles bound similarly. Do I need to env-update
whenever I chroot? What difference is there between chroot with and
without --login, apart from sourcing /etc/profile etc?

And when I've built it, how do I go about using it? No amount of
googling helps me to understand, and the Gentoo docs are more-or-less
silent on the subject.

-- 
Rgds
Peter Humphrey
Linux Counter 5290, Aug 93.

-- 
gentoo-amd64@g.o mailing list

Replies

Subject Author
Re: [gentoo-amd64] chroot howto? Barry.SCHWARTZ@×××××××××××××.org