Johannes Schauer Marin Rodrigues wrote:

> Yes. This is because if you just run "mmdebstrap --unshare-helper
> /usr/sbin/chroot" then it will do nothing else then do a chroot into
> the given directory. Since you cannot create any device nodes as the
> unshared user, /dev/null is missing. You can either bind-mound
> /dev/null and all the other device nodes from the outside yourself or
> you can use another trick and enter a chroot tarball like this:
>
> mmdebstrap --variant=custom --skip=update \
>     --setup-hook='tar-in chroot.tar /' \
>     --customize-hook='chroot "$1" bash' \
>     unstable /dev/null

Hmm, I tried the above only now and it fails with the following output

I: automatically chosen mode: unshare
I: chroot architecture amd64 is equal to the host's architecture
I: automatically chosen format: tar
I: using /tmp/mmdebstrap.ZYXCWIX0Ip as tempdir
I: running special hook: tar-in chroot.tar /
tar: ./dev/console: Cannot mknod: Operation not permitted
tar: ./dev/full: Cannot mknod: Operation not permitted
tar: ./dev/null: Cannot mknod: Operation not permitted
tar: ./dev/ptmx: Cannot mknod: Operation not permitted
tar: ./dev/random: Cannot mknod: Operation not permitted
tar: ./dev/tty: Cannot mknod: Operation not permitted
tar: ./dev/urandom: Cannot mknod: Operation not permitted
tar: ./dev/zero: Cannot mknod: Operation not permitted
tar: Exiting with failure status due to previous errors
E: hookhelper failed: E: tar failed
E: special hook failed with exit code 512
I: removing tempdir /tmp/mmdebstrap.ZYXCWIX0Ip...

The file chroot.tar was created by

  mmdebstrap unstable chroot.tar

And the following also works

  mmdebstrap --customize-hook='chroot "$1" /bin/bash' unstable /dev/null

Any suggestions?

Attachment: signature.asc
Description: PGP signature

Reply via email to