1

Why do we need to change root (chroot) to continue building my Linux system in LFS starting chapter 6? In chapter 5, we built all the tools using the host system, I understand that all the compilers needed to proceed are all installed in chapter 5, so we can change root and not use any tools from the host.

But can we still build the lfs system without changing root? What exactly is the role of change root in this case?

1 Answer 1

5

You need to chroot so the compiled programs can be placed and linked to correct places and files. You want to compile a program and install it's files in /usr/share/program/somefiles instead of /mnt/lfs/usr/share/program/somefiles so it can find those files when the new system is running.

Also, in chroot, you can make sure your new system doesn't link to the host system's libraries since you don't have access to them.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .