1

Please forgive my ignorance... I have a number of Debian Chroot environments for testing software. They were necessary due to our package maintainer testing us under the same.

My test scripts use Valgrind, but Valgrind fails with the error:

valgrind: warning (non-fatal): readlink("/proc/self/exe") failed

I know what the issue is (/proc is not mounted), and I know how to solve it (mount -t proc none proc/). However, I don't know where to put the command so it runs automatically whenever I chroot.

Simply adding the following to the Chroot's fstab resulted in a Valgrind error when attempting to use the tool:

proc<TAB>    none<TAB>    /proc

And

proc<TAB>    /proc

Where, exactly, do we put the command "mount -t proc ..." in a Debian Chroot environment?


Here's a very related question: mount dev, proc, sys in a chroot environment?. The best I can tell, folks answer with what to do, and not where to do it. I'm trying to figure out where to do it (besides manually on the command line).

jww
  • 12,722

1 Answers1

1

You can place those commands into a bash shell script, like Arch Linux has made such a script arch-chroot ; download arch-install-scripts-15-1-any.pkg.tar.xz

which takes care of these problems in question both in Arch-Linux and Manjaro , where I used it successfully, too. Possibly mores Arch-derivates like Parabola are compatible just as well.

While a simple standard chroot into a secondary Manjaro installation will not allow you to run

pacman --sync linux

(the silver bullet after a system crash), replacing the line with

arch-chroot /run/media/YOURSELF/manja-disk2

will enable you to fix your secondary Arch-derivate installation via

pacman --sync linux

like a charm. The bash script arch-chroot takes care of /dev /sys /proc and much more, which are left alone by the standard chroot .

see also: wiki

y guy
  • 31
  • 3