Mailing List Archive

Qemu-user chroot handbook chapter - mdev issue
Hi all,

I have been looking at the handbook section regarding a qemu-user chroot
and have some serious concerns about part of it. Specifically, in the
section for setting up the chroot it is suggested to run

chroot . /bin/busybox mdev -s

Since I (like most others) am currently running udev, this seems to me like
a very bad idea. (And indeed this is confirmed when I try it on my dev VM,
where the permissions for /dev/pts /dev/null /dev/random etc. are messed up
by this)

Can someone please explain the logic here, since as far as I can tell so
far, simply omitting this step does no major harm.

Cheers

Phil Tooley
Re: Qemu-user chroot handbook chapter - mdev issue [ In reply to ]
On 07/22/14 15:28, Phil Tooley wrote:
> Hi all,
>
> I have been looking at the handbook section regarding a qemu-user chroot
> and have some serious concerns about part of it. Specifically, in the
> section for setting up the chroot it is suggested to run
>
> chroot . /bin/busybox mdev -s
>
> Since I (like most others) am currently running udev, this seems to me like
> a very bad idea. (And indeed this is confirmed when I try it on my dev VM,
> where the permissions for /dev/pts /dev/null /dev/random etc. are messed up
> by this)
>
> Can someone please explain the logic here, since as far as I can tell so
> far, simply omitting this step does no major harm.
>
> Cheers
>
> Phil Tooley
>

Read the mdev primer:

http://git.busybox.net/busybox/tree/docs/mdev.txt

Basically it does a population of /dev via /sys and if it has a config
file, will set permissions.

So if you omit this step you may have a <chroot>/dev which has incorrect
permissions for your chroot.

If you are running a chroot and you `mount --bind /dev <chroot>/dev`
then changing the permissions in /dev may mess up your real root.

My recommendation is to not do a bind mount and just populate a fresh
<chroot>/dev.

--
Anthony G. Basile, Ph. D.
Chair of Information Technology
D'Youville College
Buffalo, NY 14201
(716) 829-8197