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 BCF6A13877A for ; Sat, 2 Aug 2014 10:08:39 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 67A5DE096D; Sat, 2 Aug 2014 10:08:33 +0000 (UTC) Received: from smarthost01c.mail.zen.net.uk (smarthost01c.mail.zen.net.uk [212.23.1.5]) by pigeon.gentoo.org (Postfix) with ESMTP id 4F1B7E093E for ; Sat, 2 Aug 2014 10:08:32 +0000 (UTC) Received: from [82.69.80.10] (helo=wstn.localnet) by smarthost01c.mail.zen.net.uk with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1XDWEp-0007KF-Bx for gentoo-user@lists.gentoo.org; Sat, 02 Aug 2014 10:08:31 +0000 From: Peter Humphrey To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] What to put in chroot mtab Date: Sat, 02 Aug 2014 11:08:30 +0100 Message-ID: <1794742.fjLTEISsYR@wstn> Organization: at home User-Agent: KMail/4.12.5 (Linux/3.12.21-gentoo-r1; KDE/4.12.5; x86_64; ; ) In-Reply-To: References: <3566559.YT61t9IyHV@wstn> <9a05ccce-1c76-4c5b-9093-8d8652d58e65@email.android.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-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" X-Originating-smarthost01c-IP: [82.69.80.10] X-Archives-Salt: 071abbc8-d7cd-4847-9690-b9ead7d1a707 X-Archives-Hash: 122863f391baa6ec0168c916f552914e On Friday 01 August 2014 16:44:11 Canek Pel=E1ez Vald=E9s wrote: > I was only offering options. The OP will use whatever he decides to u= se. All interesting stuff. Personally, I'm not ready to go for systemd, as = the openrc system I have works well for me and I understand it (mostly). I settled on an init script to set up the chroot, with a suitable mtab = ready to be copied in. For anyone who's interested, this is the init: start() { ebegin "Mounting 32-bit chroot dirs" mount -t proc /proc /mnt/atom/proc mount --rbind /dev /mnt/atom/dev mount --rbind /sys /mnt/atom/sys mount -t nfs 192.168.0.2:/usr/portage/packages /mnt/atom/usr/portag= e/packages cp /root/mtab.atom /mnt/atom/etc/mtab eend $? "An error occurred while attempting to mount 32-bit chroot = directories" } stop() { ebegin "Unmounting 32-bit chroot dirs" rm /mnt/atom/etc/mtab umount -f /mnt/atom/dev/mqueue umount -f /mnt/atom/dev/pts umount -f /mnt/atom/dev/shm umount -f /mnt/atom/dev umount -f /mnt/atom/proc umount -f /mnt/atom/sys/fs/cgroup/openrc umount -f /mnt/atom/sys/fs/cgroup/cpuset umount -f /mnt/atom/sys/fs/cgroup/cpu umount -f /mnt/atom/sys/fs/cgroup/cpuacct umount -f /mnt/atom/sys/fs/cgroup/freezer umount -f /mnt/atom/sys/fs/cgroup umount -f /mnt/atom/sys/kernel/debug umount -f /mnt/atom/sys umount -f /mnt/atom/usr/portage/packages eend $? "An error occurred while attempting to unmount 32-bit chroo= t directories" } (I've omitted several sleeps from the /stop/ procedure.) If I left out = any of the lower-level umounts, the ones above it would fail. # cat /root/mtab.atom devtmpfs /dev devtmpfs rw,relatime,size=3D8201684k,nr_inodes=3D2050421,= mode=3D755 0 0 /sys /sys none rw,bind,rbind 0 0 /dev /dev none rw,bind,rbind 0 0 proc /proc proc rw,relatime 0 0 tmpfs /run tmpfs rw,nosuid,nodev,relatime,size=3D1640604k,mode=3D755 0 = 0 mqueue /dev/mqueue mqueue rw,nosuid,nodev,noexec,relatime 0 0 devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=3D5,mode=3D620 0 0= shm /dev/shm tmpfs rw,nosuid,nodev,relatime 0 0 sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0 debugfs /sys/kernel/debug debugfs rw,nosuid,nodev,noexec,relatime 0 0 cgroup_root /sys/fs/cgroup tmpfs rw,nosuid,nodev,noexec,relatime,size=3D= 10240k,mode=3D755 0 0 openrc /sys/fs/cgroup/openrc cgroup rw,nosuid,nodev,noexec,relatime,rel= ease_agent=3D/lib64/rc/sh/cgroup-release-agent.sh,name=3Dopenrc 0 0 cpuset /sys/fs/cgroup/cpuset cgroup rw,nosuid,nodev,noexec,relatime,cpu= set 0 0 cpu /sys/fs/cgroup/cpu cgroup rw,nosuid,nodev,noexec,relatime,cpu 0 0 cpuacct /sys/fs/cgroup/cpuacct cgroup rw,nosuid,nodev,noexec,relatime,c= puacct 0 0 freezer /sys/fs/cgroup/freezer cgroup rw,nosuid,nodev,noexec,relatime,f= reezer 0 0 /dev/mapper/vg7-atom / ext4 rw,relatime,commit=3D0 1 2 That probably has a lot more stuff in it than I need; I just removed th= e things I certainly didn't need from a copy of the host mtab. There's a similar init script and mtab for the other chroot. I've no doubt all you systemd people will throw up your hands in dismay= at the work involved in setting that up. It didn't take long, really. --=20 Regards Peter