<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
  <!ENTITY % general-entities SYSTEM "../../general.ent">
  %general-entities;
]>

<sect1 id="ch-temp-system-choose">
  <?dbhtml filename="choose.html"?>

  <title>To Boot or to Chroot?</title>

  <para os="a">There are two different ways you can proceed from this point
  to build the final system. You can build a kernel, a bootloader, and
  a few other utilities, boot into the temporary system, and build the
  rest there. Alternatively, you can mount a few virtual filesystems and
  chroot into the temporary system.</para>

  <para os="b">The <command>chroot</command> (change root) program is used to
  enter a virtual environment and start a new shell whose root directory will
  be set to the CLFS partition. This is very similar to rebooting and
  instructing the kernel to mount the CLFS partition as the root partition.
  The major advantage is that <quote>chrooting</quote> allows the builder to
  continue using the host while CLFS is being built. While waiting for package
  compilation to complete, a user can switch to a different virtual console
  (VC) or X desktop and continue using the computer as normal.</para>

  <!-- We also describe some alternative booting methods in <xref linkend="ch-boot-whatnext"/> -->

  <para os="c">The main downside to chrooting is that you are more limited in
  when you can use it - booting will always work for any CLFS build, but the
  chroot method can only be used when you are building on the same
  architecture. For example, if you are building on, and for, an x86 system,
  you can simply chroot. Booting is required when you are compiling for a
  different architecture, such as building a PowerPC system from an x86. The
  rule of thumb here is that if the architectures match and you are running
  the same series kernel (specifically, a &glibc-kernel-version; or newer
  Linux kernel) you can just chroot. If you aren't running the same series
  kernel, or are wanting to run a different ABI, you will need to use the boot
  option.</para>

  <para os="d">If you are in any doubt about this, you can try the following
  commands to see if you can chroot:</para>

<screen os="e"><userinput>/tools/lib/libc.so.6
/tools/bin/gcc -v</userinput></screen>

  <para os="f">If either of these commands fail, you will have to follow the
  boot method.</para>

  <para os="g">For the boot method, follow <xref linkend="chapter-boot"/>.</para>

  <para os="h">For the chroot method, follow <xref linkend="chapter-chroot"/>.</para>

</sect1>
