1

Consider the following directory tree (mychroot):

mychroot/
├── proc
│   └── cpuinfo
└── usr
    └── bin
        └── ls

On Fedora 20:

$ fakechroot chroot ./mychroot/  /usr/bin/ls proc
cpuinfo

Version:

$ fakechroot --version
fakechroot version 2.9

On Ubuntu:

$ fakechroot chroot ./mychroot/  /usr/bin/ls proc

lists the /proc entries from outside chroot.

Version:

$ fakechroot --version
fakechroot version 2.17.2

What could be going on here? Thanks for any insights.

Update:

Definitely looks like a change in behavior. I installed 2.10 on Ubuntu and I see the same result as on Fedora (with 2.9):

$ /usr/local/bin/fakechroot --version
fakechroot version 2.10
$ /usr/local/bin/fakechroot chroot ./mychroot  /usr/bin/ls proc
cpuinfo

Filed an issue upstream.

  • Do you have the same configuration on both machines? specifically FAKECHROOT_EXCLUDE_PATH. – Gilles Apr 20 '14 at 19:29
  • @Gilles I have not set that variable on any of the distros. I have a feeling there could be a regressive behavior? – Amit Apr 21 '14 at 0:20
  • Check the configuration files in /etc/fakechroot and ~/.fakechroot, not just the environment. – Gilles Apr 21 '14 at 0:23
  • On Ubuntu, there is a systemwide env file in /etc/fakechroot, which it was loading. On Fedora there was none. Perhaps different packaging. However: fakechroot -e none .. fixes it. Thanks a lot! – Amit Apr 21 '14 at 0:32
1

Fakechroot can be configured to exclude some paths, i.e. those paths will refer to the same location inside the (fake) chroot and outside. This is especially useful for directories like /dev and /proc which it is useful to have everywhere as a lot of programs depend on them.

Excluded paths can be defined via:

  • the FAKECHROOT_EXCLUDE_PATH environment variable;
  • a FAKECHROOT_EXCLUDE_PATH setting in configuration files in ~/.fakechroot and /etc/fakechroot, named COMMAND.env where COMMAND is the command invoked by fakechroot (e.g. chroot.env).

Check whether /proc is on the excluded list in Ubuntu via the environment, in ~/.fakechroot/chroot.env or in /etc/fakechroot/chroot.env. In the Debian package, /etc/fakechroot/chroot.env adds /dev, /proc and /sys to FAKECHROOT_EXCLUDE_PATH. If you don't want that, copy /etc/fakechroot/chroot.env to ~/.fakechroot/chroot.env and edit the relevant line, or else pass the -e argument to specify a different configuration file (e.g. fakechroot -e /dev/null chroot …).

  • Will specifying FAKECHROOT_EXCLUDE_PATH while executing the command override the setting in any configuration file? If so, can you give an example? FAKECHROOT_EXCLUDE_PATH=/proc:/sys fakechroot chroot ./mychroot /usr/bin/ls proc doesn't seem to work. Thanks a lot. – Amit Apr 21 '14 at 0:45
  • @Amit No, the configuration file appends to FAKECHROOT_EXCLUDE_PATH. If you want to remove /proc from the list, you need to use a different configuration file. – Gilles Apr 21 '14 at 1:02
  • Thanks. Okay, now I could get what I wanted by using "-e none" on 2.17, but the package included in Fedora is 2.9 which doesn't have, "-e" option. So, I removed all possible env files from Ubuntu, but it still doesn't obey the FAKECHROOT_EXCLUDE_PATH env variable. Can you suggest an alternative which would work with both versions? – Amit Apr 21 '14 at 1:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.