[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Build fails, cannot mount /proc while inside chroot



On Mon, Sep 1, 2008 at 18:51, Daniel Baumann <daniel@debian.org> wrote:
> looks good, except of the error :) the only thing left i can image is
> that you mounted the partition with nodev. could you please check that
> as well (type 'mount' to see it)?
It appears to be mounted with the devices option on; I can create a
device node and then read from it (I think that's a sufficient test,
and it doesn't mention nodev or devices.bbbbbbbbbbbbbbbb):
debian:/live# mknod chroot/dev/hda b 3 0
debian:/live# mknod chroot/dev/hda1 b 3 1
debian:/live# mount -t proc proc /live/chroot/proc/
debian:/live# chroot /live/chroot/
I have no name!@debian:/# fdisk -l
<this works; list of VBox disk /dev/hda here>

However, note the "I have no name!" bit.  geteuid32() returns -1
inside the chroot:
debian:/live# strace -f -o output.log chroot /live/chroot/ mount -t
proc proc /proc
mount: only root can do that
debian:/live# tail output.log
13425 open("/usr/lib/locale/en.UTF-8/LC_IDENTIFICATION", O_RDONLY) =
-1 ENOENT (No such file or directory)
13425 open("/usr/lib/locale/en.utf8/LC_IDENTIFICATION", O_RDONLY) = -1
ENOENT (No such file or directory)
13425 open("/usr/lib/locale/en/LC_IDENTIFICATION", O_RDONLY) = -1
ENOENT (No such file or directory)
13425 umask(022)                        = 022
13425 open("/dev/null", O_RDWR|O_LARGEFILE) = -1 EINVAL (Invalid argument)
13425 getuid32()                        = 0
13425 geteuid32()                       = -1 ENOENT (No such file or directory)
13425 write(2, "mount: only root can do that"..., 28) = 28
13425 write(2, "\n"..., 1)              = 1
13425 exit_group(1)                     = ?
while it doesn't in the real root (as seen by strace'ing `whoami').

Will


Reply to: