Gentoo Archives: gentoo-embedded

From: "Anthony G. Basile" <basile@××××××××××××××.edu>
To: gentoo-embedded@l.g.o
Subject: Re: [gentoo-embedded] Qemu-user chroot handbook chapter - mdev issue
Date: Thu, 24 Jul 2014 22:49:15
Message-Id: 53CF9F80.8040109@opensource.dyc.edu
In Reply to: [gentoo-embedded] Qemu-user chroot handbook chapter - mdev issue by Phil Tooley
1 On 07/22/14 15:28, Phil Tooley wrote:
2 > Hi all,
3 >
4 > I have been looking at the handbook section regarding a qemu-user chroot
5 > and have some serious concerns about part of it. Specifically, in the
6 > section for setting up the chroot it is suggested to run
7 >
8 > chroot . /bin/busybox mdev -s
9 >
10 > Since I (like most others) am currently running udev, this seems to me like
11 > a very bad idea. (And indeed this is confirmed when I try it on my dev VM,
12 > where the permissions for /dev/pts /dev/null /dev/random etc. are messed up
13 > by this)
14 >
15 > Can someone please explain the logic here, since as far as I can tell so
16 > far, simply omitting this step does no major harm.
17 >
18 > Cheers
19 >
20 > Phil Tooley
21 >
22
23 Read the mdev primer:
24
25 http://git.busybox.net/busybox/tree/docs/mdev.txt
26
27 Basically it does a population of /dev via /sys and if it has a config
28 file, will set permissions.
29
30 So if you omit this step you may have a <chroot>/dev which has incorrect
31 permissions for your chroot.
32
33 If you are running a chroot and you `mount --bind /dev <chroot>/dev`
34 then changing the permissions in /dev may mess up your real root.
35
36 My recommendation is to not do a bind mount and just populate a fresh
37 <chroot>/dev.
38
39 --
40 Anthony G. Basile, Ph. D.
41 Chair of Information Technology
42 D'Youville College
43 Buffalo, NY 14201
44 (716) 829-8197