Changing ownership
Right now the /stage1 directory
is owned by the user lfs, a user that exists only on your
host system. Although you will probably want to delete the
/stage1 directory once you have
finished your LFS system, you may want to keep it around, for example to
build more LFS systems. But if you keep the
/stage1 directory as it is, you end up
with files owned by a user ID without a corresponding account. This is
dangerous because a user account created later on could get this same user ID
and would suddenly own the /stage1
directory and all the files therein, thus exposing these files to possible
malicious manipulation.
To avoid this issue, you could add the lfs user to
your new LFS system later on when creating the /etc/passwd
file, taking care to assign it the same user and group IDs as on your host
system. Alternatively, you can (and the book assumes you do) assign the
contents of the /stage1 directory to
user root by running the following command:
chown -R 0:0 /stage1
The command uses "0:0" instead of "root:root", because chown is unable
to resolve the name "root" until glibc has been installed.