From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 2271E1391DB for ; Fri, 1 Aug 2014 20:46:11 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C39B3E0B14; Fri, 1 Aug 2014 20:46:03 +0000 (UTC) Received: from smtpq1.gn.mail.iss.as9143.net (smtpq1.gn.mail.iss.as9143.net [212.54.34.164]) by pigeon.gentoo.org (Postfix) with ESMTP id 62949E0ADE for ; Fri, 1 Aug 2014 20:46:02 +0000 (UTC) Received: from [212.54.34.135] (helo=smtp4.gn.mail.iss.as9143.net) by smtpq1.gn.mail.iss.as9143.net with esmtp (Exim 4.71) (envelope-from ) id 1XDJiD-0000jC-LW for gentoo-user@lists.gentoo.org; Fri, 01 Aug 2014 22:46:01 +0200 Received: from 53579160.cm-6-8c.dynamic.ziggo.nl ([83.87.145.96] helo=data.antarean.org) by smtp4.gn.mail.iss.as9143.net with esmtp (Exim 4.71) (envelope-from ) id 1XDJiD-0001wu-9K for gentoo-user@lists.gentoo.org; Fri, 01 Aug 2014 22:46:01 +0200 Received: from [192.168.45.104] (53579160.cm-6-8c.dynamic.ziggo.nl [83.87.145.96]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by data.antarean.org (Postfix) with ESMTPSA id 4C5E04C for ; Fri, 1 Aug 2014 22:45:36 +0200 (CEST) User-Agent: K-9 Mail for Android In-Reply-To: <53DB95E1.5010709@gmail.com> References: <3566559.YT61t9IyHV@wstn> <6536155.f0GWtIUbSO@wstn> <53DB95E1.5010709@gmail.com> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Subject: Re: [gentoo-user] What to put in chroot mtab From: "J. Roeleveld" Date: Fri, 01 Aug 2014 22:46:00 +0200 To: gentoo-user@lists.gentoo.org Message-ID: Content-Transfer-Encoding: quoted-printable X-Ziggo-spambar: ---- X-Ziggo-spamscore: -4.9 X-Ziggo-spamreport: ALL_TRUSTED=-1,BAYES_00=-1.9,PROLO_TRUST_RDNS=-3,RDNS_DYNAMIC=0.982 X-Ziggo-Spam-Status: No X-Spam-Status: No X-Spam-Flag: No X-Archives-Salt: 2dbe901d-bde4-4453-822f-d6429cbc78f8 X-Archives-Hash: 1cd3156d8b51eda0ab93eb318ac8171e On 1 August 2014 15:28:01 CEST, Dale wrote: >Peter Humphrey wrote: >> On Friday 01 August 2014 14:07:08 I wrote: >> >>> I run a couple of chroots on this box to build packages for other >boxes on >>> the LAN. So far, I haven't worked out what I should populate >/etc/mtab with >>> in each chroot. Is it enough to "grep ext4 /etc/mtab > >>> /mnt/chroot/etc/mtab"? That catches all the physical partitions, but >I >>> imagine I need to add some /proc, /sys and /dev entries as well, but >is >>> there a simple formula for doing this? >> I meant to add that one chroot is 32-bit and the other is 64. The >host is an=20 >> i5 running openrc. >> > >It has been a good while since I used this. So, make sure it makes >sense to you before trying this. This may not work if something has >changed in the past several years. Use with caution if at all.=20 > >This is a little script, if you want to call it that, that I used to do >mine. It also lists the command to use to do a 32 bit chroot from a 64 >bit rig. Here it is: > >root@fireball / # cat /root/xx.chroot-mount-32bit > > >mount -o bind /dev /mnt/gentoo32/dev >mount -o bind /dev/pts /mnt/gentoo32/dev/pts >mount -o bind /dev/shm /mnt/gentoo32/dev/shm >mount -o bind /proc /mnt/gentoo32/proc >mount -o bind /proc/bus/usb /mnt/gentoo32/proc/bus/usb >mount -o bind /sys /mnt/gentoo32/sys >mkdir -p /mnt/gentoo32/usr/portage/ >mount -o bind /usr/portage /mnt/gentoo32/usr/portage/ > > >echo " mounting finished" > >echo "run linux32 chroot /mnt/gentoo32 /bin/bash next" >root@fireball / # > > >You may have different mount points at the very least so edit to match >what you have. Again, things could have changed and that no longer >will >work. It may not be a bad idea to let someone who has done this more >recently to give a thumbs up to that.=20 > >That last command should be: > >linux32 chroot /mnt/gentoo32 /bin/bash > >Dale > >:-) :-)=20 That script is too long :) cd /mnt/gentoo mount -o rbind /dev dev mount -o rbind /sys sys mount -o rbind /proc proc cp -L /etc/resolv.conf etc/resolv.conf cd .. chroot gentoo /bin/bash To undo: cd /mnt/gentoo umount -l proc sys dev If you need a 32bit chroot, put linux32 before the chroot like Dale menti= oned. -- Joost --=20 Sent from my Android device with K-9 Mail. Please excuse my brevity.