6.32. To Boot or to Chroot?

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 chroot into the temporary system.

The boot method is needed when you are building on a different architecture. For example, if you are building a PowerPC system from an x86, you can't chroot. The chroot method is for when you are building on the same architecture. If you are building on, and for, an x86 system, you can simply chroot. The rule of thumb here is if the architectures match and you are running the same series 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.

Powerpc64 is slightly different from some of the other architectures, because a 64-bit kernel running 32-bit userspace can successfully chroot and execute 64-bit programs. However, if the kernel personality has been set to 32-bit by a utility such as linux32, it will eventually fail when glibc thinks it is building on a 32-bit system and tries to include incompatible assembler code in the 64-bit glibc.

To see if you can successfully chroot to build the final powerpc64 system, enter the following command which tests if you are running a 64-bit Linux 2.6 kernel (with a 64-bit personality):

uname -a | grep '^Linux.*2\.6\..*ppc64' && \
    echo "ok to chroot" || echo "you must boot"

For the boot method, follow If You Are Going to Boot.

For the chroot method, follow If You Are Going to Chroot.