]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
add simple chroot example
authorJim Meyering <jim@meyering.net>
Sun, 19 Mar 2000 17:57:16 +0000 (17:57 +0000)
committerJim Meyering <jim@meyering.net>
Sun, 19 Mar 2000 17:57:16 +0000 (17:57 +0000)
doc/sh-utils.texi

index 069a39e1f62c6768a0657064187e94456c2a7291..41ccf52cc1b4c092df30a07bad28ce7b1dcf086d 100644 (file)
@@ -2783,6 +2783,29 @@ variable or @code{/bin/sh} if not set, invoked with the @samp{-i} option.
 The only options are @samp{--help} and @samp{--version}.  @xref{Common
 options}.
 
+Here are a few tips to help avoid common problems in using chroot.
+To start with a simple example, make @var{command} refer to a statically
+linked binary.  If you were to use a dynamically linked executable, then
+you'd have to arrange to have the shared libraries in the right place under
+your new root directory.
+
+For example, if you create a statically linked `ls' executable,
+and put it in /tmp/empty, you can run this command as root:
+
+@example
+$ chroot /tmp/empty /ls -Rl /
+@end example
+
+Then you'll see output like this:
+
+@example
+/:
+total 1023
+-rwxr-xr-x    1 0        0         1041745 Aug 16 11:17 ls
+@end example
+
+@c FIXME: add a more complex example
+
 
 @node env invocation
 @section @code{env}: Run a command in a modified environment